当从discord.py移动到nextcord时,没有注册斜杠命令。
我在applications.command URI上启用了oauth2。
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)发布于 2022-09-30 19:29:30
您需要添加myserverid =,并在这里添加测试服务器ID,将其置于bot =.
https://stackoverflow.com/questions/72143393
复制相似问题