From e7948a4e67296b65264d20d1434a1d3a739f0bfb Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 16 Jul 2023 21:18:30 +0200 Subject: [PATCH] chore(main.py): remove redundant bot.run() call at the top of the file feat(main.py): add newline at the end of the file for consistency chore(functionscalls.py): remove extra blank lines feat(functionscalls.py): add unsplash_random_image_url constant for generating random image URLs feat(functionscalls.py): add add_reaction_to_last_message() function for adding reactions to the last message --- main.py | 5 +++-- src/functionscalls.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 2089689..3750492 100644 --- a/main.py +++ b/main.py @@ -14,8 +14,6 @@ bot.add_cog(cogs.Chat(bot)) bot.add_cog(cogs.ManageChat(bot)) bot.add_cog(cogs.Moderation(bot)) -bot.run(discord_token) # run the bot - # set the bot's watching status to watcing your messages to answer you @bot.event @@ -32,3 +30,6 @@ async def on_ready(): async def on_application_command_error(ctx, error): debug(error) await ctx.respond(error, ephemeral=True) + + +bot.run(discord_token) # run the bot \ No newline at end of file diff --git a/src/functionscalls.py b/src/functionscalls.py index 8e669f7..248d888 100644 --- a/src/functionscalls.py +++ b/src/functionscalls.py @@ -73,7 +73,9 @@ server_normal_channel_functions = [ } }, ] + unsplash_random_image_url = "https://source.unsplash.com/random/1920x1080" + async def add_reaction_to_last_message(message_to_react_to: discord.Message, emoji, message=""): if message == "": await message_to_react_to.add_reaction(emoji)