Skip to content

Commit

Permalink
FIX: Corrected an error with commands
Browse files Browse the repository at this point in the history
  • Loading branch information
advtech92 committed Aug 14, 2024
1 parent 7698ec5 commit b3dfd48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions user/birthday.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def __init__(self, client):

# Ensure that the database and tables are set up
self.ensure_db()
self.setup_commands()

def ensure_db(self):
os.makedirs(os.path.dirname(self.db_path), exist_ok=True)
Expand Down Expand Up @@ -119,7 +118,7 @@ async def set_birthday_channel(interaction: discord.Interaction, channel: discor
self.set_birthday_channel(guild_id, channel.id)
await interaction.response.send_message(f"Birthday alerts will now be sent to {channel.mention}.", ephemeral=True)

self.client.tree.add_command(set_birthday_channel)

@tree.command(name="consent", description="Give consent for data storage.")
async def consent_command(interaction: discord.Interaction):
self.consent_manager.give_consent(interaction.user.id, interaction.guild.id)
Expand Down Expand Up @@ -162,6 +161,8 @@ async def get_birthday_command(interaction: discord.Interaction):
tree.add_command(set_birthday_command)
if not tree.get_command("get_birthday"):
tree.add_command(get_birthday_command)
if not tree.get_command("set_birthday_channel"):
tree.add_command(set_birthday_channel)


class BirthdayModal(discord.ui.Modal, title="Set your birthday"):
Expand Down

0 comments on commit b3dfd48

Please sign in to comment.