#Slash Command does not appear
1 messages · Page 1 of 1 (latest)
!!whynoslash
Most common issues
-
You didn't invite the bot to your guild with the application.commands oauth enabled. Go to the developer portal, make an invite with both bot and applications.commands enabled, and re-authorize your bot for your server.
-
You're using global commands and probably haven't waited (up to) an hour for them to appear.
-
You're adding the cogs with slash commands in them too late inside of your bot. You either need to add them before on_connect is called (preferably before the bot is even started), or run the global and/or guild sync methods manually.
Lesser common issues
-
Discord gets weird sometimes and doesn't refresh available commands. Try restarting your Discord client.
-
You're overriding on_connect, which adds the application commands to bot/client (including ones inside cogs) and rolls out global commands. Either stop overriding it, or add
bot.add_all_application_commands()andawait bot.sync_application_commands()to it. -
You're overriding on_guild_available, which rolls out commands to guilds. Either stop overriding it, or add the following codeblock to it:
try:
await bot.sync_application_commands(guild_id=guild.id)
except Forbidden:
pass
Thanks! I solved my problem