Slash commands don't disappearing (nextcord)
Question:
I’m developing a discord bot using nextcord.
When i’m registering slash command and deleting it later, it’s also staying at discord command list.
What can I do to delete non-existent slash commands or sync actual bot’s command list with discord?
P.S. All of my commands are in different cogs
I was waiting about 4 hours for registering and sync slash commands by discord but to no avail.
Answers:
You should try kicking your bot and then inviting it back to your server. If this doesn’t work, regenerate your bot’s token. This should sync it back with Discord, and the command should be gone.
The solution is adding all servers in default_guild_ids variable
Use methods on_ready
and on_guild_join
Example code:
class Bot(nextcord.ext.commands.Bot):
async def on_ready(self):
for guild in self.guilds:
self.default_guild_ids.append(guild.id)
async def on_guild_join(self, guild: nextcord.Guild):
self.default_guild_ids.append(guild.id)
I’m developing a discord bot using nextcord.
When i’m registering slash command and deleting it later, it’s also staying at discord command list.
What can I do to delete non-existent slash commands or sync actual bot’s command list with discord?
P.S. All of my commands are in different cogs
I was waiting about 4 hours for registering and sync slash commands by discord but to no avail.
You should try kicking your bot and then inviting it back to your server. If this doesn’t work, regenerate your bot’s token. This should sync it back with Discord, and the command should be gone.
The solution is adding all servers in default_guild_ids variable
Use methods on_ready
and on_guild_join
Example code:
class Bot(nextcord.ext.commands.Bot):
async def on_ready(self):
for guild in self.guilds:
self.default_guild_ids.append(guild.id)
async def on_guild_join(self, guild: nextcord.Guild):
self.default_guild_ids.append(guild.id)