From bc063fc2006939e91063d653b2c86562a5964b94 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Fri, 10 Jul 2020 22:18:06 +0100 Subject: [PATCH] Adding choking gifs/command --- cogs/anime/interactive.py | 43 ++++++++++++++++++++++++++++++++++ images/FunCommands/choking.txt | 15 ++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 images/FunCommands/choking.txt diff --git a/cogs/anime/interactive.py b/cogs/anime/interactive.py index 52f180a9..8b50d5f3 100644 --- a/cogs/anime/interactive.py +++ b/cogs/anime/interactive.py @@ -286,6 +286,49 @@ class Interactive(commands.Cog): except FileNotFoundError as e: print(e) + @command(name="choke", aliases=["Choke"]) + @cooldown(1, 1, BucketType.user) + async def choke(self, ctx, target: Member): + """Allows users to choke a person in the server""" + + # Surround with try/except to catch any exceptions that may occur + try: + + # If the channel that the command has been sent is in the list of accepted channels + if str(ctx.channel) in settings.channels: + + # Open the file containing the choking gifs + with open('images/FunCommands/choking.txt') as file: + # Store content of the file in choking_array + choking_array = file.readlines() + + # Get the member and the userAvatar + member, userAvatar = getMember(ctx) + + # Set up the embed to display a random choking gif + embed = Embed( + title=f"<:qmq:676203031506976768> <:qmq:676203031506976768> | **{member.display_name}** choked **{target.display_name}**", + colour=Colour(int(random.choice(colour_list))), + timestamp=time) + embed.set_image(url=random.choice(choking_array)) + embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar)) + + # Send the embedded message to the user + await ctx.send(embed=embed) + + # else the command is sent in an invalid channel + else: + # Call error_function() and display it to the user + message = await ctx.send(error_function()) + + # Let the user read the message for 2.5 seconds + await asyncio.sleep(2.5) + # Delete the message + await message.delete() + + except FileNotFoundError as e: + print(e) + @command(name="marry", aliases=["Marry"]) @cooldown(1, 1, BucketType.user) async def marry(self, ctx, member: Member): diff --git a/images/FunCommands/choking.txt b/images/FunCommands/choking.txt new file mode 100644 index 00000000..35d39ce0 --- /dev/null +++ b/images/FunCommands/choking.txt @@ -0,0 +1,15 @@ +https://cdn.discordapp.com/attachments/716424509858644018/729562288624762971/unknown.gif +https://cdn.discordapp.com/attachments/716424509858644018/729563027531104336/tenor_2.gif +https://cdn.discordapp.com/attachments/716424509858644018/729562295134322718/unknown.gif +https://cdn.discordapp.com/attachments/716424509858644018/729565034547642409/giphy_1.gif +https://cdn.discordapp.com/attachments/716424509858644018/729565035013341195/DBvbJ4grTZuOgR3YyWCliY7znqMF1sehfeBTvW4pd3yUZF6Uy-1Ad36eR_Ho11Im1eEWqB8TQcM6mCjpd3LhLg.gif +https://cdn.discordapp.com/attachments/716424509858644018/729565035226988595/giphy_2.gif +https://cdn.discordapp.com/attachments/716424509858644018/729565197110345818/d4qelwv-b77885ba-b71e-463b-baf1-82146cf2eddd.gif +https://cdn.discordapp.com/attachments/716424509858644018/729565431261691954/tenor_3.gif +https://cdn.discordapp.com/attachments/716424509858644018/729566244579049533/0b7033dafc792ff9-anime-choking-gifs-tenor.gif +https://cdn.discordapp.com/attachments/716424509858644018/729566778954350672/SourGrizzledGavial-size_restricted.gif +https://cdn.discordapp.com/attachments/716424509858644018/729567686551404644/He_didnt_strangle_her_.gif +https://cdn.discordapp.com/attachments/716424509858644018/729568394508238918/tenor_5.gif +https://cdn.discordapp.com/attachments/716424509858644018/729568521083945042/tenor_6.gif +https://cdn.discordapp.com/attachments/716424509858644018/729569562399604786/tumblr_myp7nzBpkB1torue8o1_500.gif +https://cdn.discordapp.com/attachments/716424509858644018/729569673561112646/2uCh694.gif \ No newline at end of file