modified: app.py

This commit is contained in:
SimolZimol
2025-10-26 00:23:34 +02:00
parent 30f93debd2
commit d2fa39a6b7

9
app.py
View File

@@ -32,6 +32,13 @@ async def on_ready():
activity=discord.Game(name="Hearts of Iron IV"),
status=discord.Status.online
)
# Sync hybrid commands on startup
try:
synced = await bot.tree.sync()
print(f'Synced {len(synced)} hybrid commands')
except Exception as e:
print(f'Failed to sync commands: {e}')
@bot.event
async def on_guild_join(guild):
@@ -53,7 +60,7 @@ def is_owner():
return commands.check(predicate)
# Owner Commands
@bot.command(name='reload')
@bot.hybrid_command(name='reload', description='Reloads the bot and syncs slash commands (Owner only)')
@is_owner()
async def reload_bot(ctx):
"""Reloads the bot and syncs slash commands (Owner only)"""