async def rip(ctx): #Setup verdict = "remember" requester = ctx.message.author msg = ctx.message.content.split(" ", 1) name = msg[1] all_clear = 0 person_check = 0 #Checking if target is single person or is in the list of members if name == "@everyone": await bot.say("I *alone* cannot " + verdict + " so many.") person_check = 1 if name == "@here": await self.bot.user("I *alone* cannot " + verdict + " so many.") person_check = 1 try: target = ctx.message.mentions[0] except IndexError: if person_check < 1: await bot.say("Please select a person for me to " + verdict + ".") person_check = 1 if target == bot.user: await bot.say("I cannot " + verdict + " *myself*.") person_check = 1 if person_check < 1: if target in ctx.message.server.roles: await bot.say("I *alone* cannot " + verdict + " so many.") else: if ctx.message.mentions[0] not in ctx.message.server.members: await bot.say("I cannot " + verdict + " a person that is not here.") else: all_clear = 1 if all_clear > 0: #executing process starts (just a eulogy) await bot.say(choice(responses)) #Sending message to target #getting server name that request was made server_of_origin = ctx.message.server #creating base embed embed = discord.Embed( title="🔔 **Attention** 🔔", description="Your funeral is being held on the server " + str(server_of_origin) + ".") #Setting up timestamp time_of_action = datetime.datetime.now() embed.set_footer( text="Requested by: " + str(requester) + ", at: " + str(time_of_action.strftime("%a, %b %d, %Y, %I:%M %p")) + ".") #embed message to offender await bot.send_message(target, embed=embed) #Writing within server #creating eulogy spoken_eulogy = eulogy.rememberence(name, verdict) #creating base embed embed = discord.Embed(title="🔔 **A Member Has Died** 🔔", description=spoken_eulogy, footer="foot", color=0x7d4a86) #Setting up embed timestamp time_of_action = datetime.datetime.now() embed.set_footer( text="Requested by: " + str(requester) + ", at: " + str(time_of_action.strftime("%a, %b %d, %Y, %I:%M %p")) + ".") #embed message for chat await bot.say(embed=embed)
async def mute(ctx): #Setup verdict = "mute" requester = ctx.message.author mute = discord.utils.get(ctx.message.server.roles, name="Executioner's Mute") msg = ctx.message.content.split(" ", 1) name = msg[1] all_clear = 0 person_check = 0 #Checking if target is single person or is in the list of members if name == "@everyone": await bot.say("I *alone* cannot " + verdict + " so many.") person_check = 1 if name == "@here": await bot.say("I *alone* cannot " + verdict + " so many.") person_check = 1 try: target = ctx.message.mentions[0] except IndexError: if person_check < 1: await bot.say("Please select a person for me to " + verdict + ".") person_check = 1 if target == bot.user: await bot.say("I cannot " + verdict + " *myself*.") person_check = 1 if person_check < 1: if target in ctx.message.server.roles: await bot.say("I *alone* cannot " + verdict + " so many.") else: if ctx.message.mentions[0] not in ctx.message.server.members: await bot.say("I cannot " + verdict + " a person that is not here.") else: all_clear = 1 if all_clear > 0: #checks to see if mute role exists, creates one if not if mute is None: perms = discord.Permissions(send_messages=False, read_messages=True, add_reactions=False) await bot.create_role(ctx.message.author.server, name="Executioner's Mute", permissions=perms) await bot.say("An `Executioner's Mute` role was created.") #checks if target is already muted elif mute in target.roles: await bot.say(name + " is already muted.") #muting process starts else: await bot.say(choice(responses)) mute = discord.utils.get(ctx.message.server.roles, name="Executioner's Mute") await bot.add_roles(ctx.message.mentions[0], mute) #Sending message to target #getting server name that request was made server_of_origin = ctx.message.server #creating base embed embed = discord.Embed( title="🔔 **Attention** 🔔", description="You have been muted on the server " + str(server_of_origin) + ".") #Setting up timestamp time_of_action = datetime.datetime.now() embed.set_footer( text="Requested by: " + str(requester) + ", at: " + str(time_of_action.strftime("%a, %b %d, %Y, %I:%M %p")) + ".") #embed message to offender await bot.send_message(target, embed=embed) #Writing within server #creating eulogy spoken_eulogy = eulogy.rememberence(name, verdict) #creating base embed embed = discord.Embed( title="🔔 **A Member Has Been Muted** 🔔", description=spoken_eulogy, footer="foot", color=0x7d4a86) #Setting up embed timestamp time_of_action = datetime.datetime.now() embed.set_footer( text="Requested by: " + str(requester) + ", at: " + str(time_of_action.strftime("%a, %b %d, %Y, %I:%M %p")) + ".") #embed message for chat await bot.say(embed=embed)