From 81eb7542f3f3ea2d3a1e141d11458aa1a1571ebd Mon Sep 17 00:00:00 2001 From: Parker Date: Fri, 12 Jul 2024 03:42:13 -0500 Subject: [PATCH] Remove `on_command_error` and move `on_ready` --- code/bot.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/code/bot.py b/code/bot.py index e8c6573..16e64bd 100644 --- a/code/bot.py +++ b/code/bot.py @@ -37,6 +37,10 @@ class MyBot(commands.Bot): bot.openai = openai.OpenAI(api_key=config.OPENAI_API_KEY) + async def on_ready(self): + config.LOG.info(f"{bot.user} has connected to Discord.") + config.LOG.info("Startup complete. Sync slash commands by DMing the bot ***sync") + bot = MyBot() bot.remove_command("help") @@ -44,17 +48,6 @@ bot.temp_command_count = {} # command_name: count bot.autoplay = [] # guild_id, guild_id, etc. -@bot.event -async def on_ready(): - config.LOG.info(f"{bot.user} has connected to Discord.") - config.LOG.info("Startup complete. Sync slash commands by DMing the bot ***sync") - - -@bot.event -async def on_command_error(ctx, error): - return - - @tasks.loop(minutes=45) async def get_access_token(): auth_url = "https://accounts.spotify.com/api/token"