Skip to content

Commit

Permalink
Fix uncommon error with command tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalk0 committed Oct 7, 2023
1 parent dffe612 commit 9cf111e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(self):
"streaming": 1,
"listening": 2,
"watching": 3,
"custom": 4, # Idk what it is
"competing": 5}
activity = discord.Activity(type=activity_type.get(self.config['BOT_ACTIVITY_TYPE']),
name=self.config['BOT_ACTIVITY_NAME'])
Expand All @@ -39,13 +40,14 @@ async def on_ready(self):
# Waits until internal cache is ready
await self.wait_until_ready()

# Hypixel guild
hypixel_guild = self.get_guild(int(self.config['HYPIXEL_GUILD_ID']))

# Import and sync commands and import tasks
command_tree = discord.app_commands.CommandTree(self)
commands_list(command_tree, hypixel_guild)
# Executed once when bot is ready
if self.first:
# Hypixel guild
hypixel_guild = self.get_guild(int(self.config['HYPIXEL_GUILD_ID']))

# Import and sync commands and import tasks
command_tree = discord.app_commands.CommandTree(self)
commands_list(command_tree, hypixel_guild)
await command_tree.sync()
await command_tree.sync(guild=hypixel_guild)
tasks.tasks_list(self)
Expand Down

0 comments on commit 9cf111e

Please sign in to comment.