aboutsummaryrefslogtreecommitdiff
path: root/code/bot.py
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-07-12 03:42:13 -0500
committerParker <contact@pkrm.dev>2024-07-12 03:42:13 -0500
commit81eb7542f3f3ea2d3a1e141d11458aa1a1571ebd (patch)
tree581b20d28361ef70942384438bc688e4e896eb84 /code/bot.py
parented25329568d1b5a01eb3ba62e7853675f57658c1 (diff)
Remove `on_command_error` and move `on_ready`
Diffstat (limited to 'code/bot.py')
-rw-r--r--code/bot.py15
1 files 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"