Common Causes:
- Bot needs to be restarted after adding new commands
- Discord's global sync can take up to 1 hour
- Command sync might have failed silently
Solutions:
# Stop the bot (Ctrl+C) and restart it
python -m src.cli.main bot- Global slash commands can take up to 1 hour to appear
- The bot now automatically syncs to each guild for faster availability
- Check bot logs for
bot_commands_syncedandbot_commands_synced_to_guild
Look for these log messages when the bot starts:
bot_commands_synced synced_count=5 command_names=['query', 'topics', 'people', 'list', 'relationships']
If you see bot_command_sync_failed, check the error message.
If you need the command immediately, you can add a temporary sync command:
# Add this to your bot's on_ready method temporarily
@bot.event
async def on_ready():
# Force sync to your test guild
guild = discord.utils.get(bot.guilds, name="Your Test Guild Name")
if guild:
bot.tree.copy_global_to(guild=guild)
await bot.tree.sync(guild=guild)
print(f"Commands synced to {guild.name}")Check that the command is registered in the setup hook:
# In src/bot/bot.py, setup_hook should call:
register_relationships_command(...)- Ensure the bot has "Use Slash Commands" permission
- Ensure the bot is in the server and has proper permissions
- Check that the bot appears online in Discord
Sometimes Discord's client cache can cause issues:
- Discord Desktop: Try restarting Discord
- Discord Web: Hard refresh (Ctrl+Shift+R or Cmd+Shift+R)
- Discord Mobile: Force close and reopen the app
If the command appears in autocomplete but doesn't work:
- Try typing the full command:
/archive relationships person:"Test" - Check if it appears when typing
/archiveand thenrelationships
You can verify which commands are registered by checking the bot logs:
bot_commands_synced synced_count=5 command_names=['query', 'topics', 'people', 'list', 'relationships']
If relationships is not in the list, the command wasn't registered properly.
If commands still don't appear after 1 hour:
- Go to Discord Developer Portal: https://discord.com/developers/applications
- Select your bot application
- Go to "OAuth2" → "URL Generator"
- Re-generate the bot invite URL
- Re-invite the bot (this can sometimes force refresh commands)
- Check bot is running: The bot should be online in Discord
- Check logs for errors: Look for
bot_command_sync_failedor other errors - Verify command registration: Check that
register_relationships_commandis called - Check guild sync: Look for
bot_commands_synced_to_guildin logs - Wait for global sync: Can take up to 1 hour for global commands
After restarting the bot:
- Commands sync to each guild immediately (for testing)
- Global sync happens in background (can take up to 1 hour)
- Command should appear in Discord within a few minutes (guild sync) or up to 1 hour (global sync)
- Check the bot console output for any errors
- Verify the command code is correct (no syntax errors)
- Ensure the bot has the latest code changes
- Try removing and re-adding the bot to your server
- Check Discord's status page for API issues