'nextcord slash command does not register

When moving to nextcord from discord.py the slash command is not registered.

I have enabled the applications.command on oauth2 URI.

from nextcord import Intents
import nextcord
from nextcord.ext import commands
from nextcord import Interaction

token = "token"
Intent = Intents.all()
bot = commands.Bot(command_prefix='!', Intents=Intent)

@bot.slash_command(name="test", description="test", guild_ids=[myserverid])
async def test(interaction: Interaction):
    await interaction.response.send_message("test")

bot.run(token)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source