首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >nextcord命令不注册。

nextcord命令不注册。
EN

Stack Overflow用户
提问于 2022-05-06 14:48:12
回答 1查看 363关注 0票数 1

当从discord.py移动到nextcord时,没有注册斜杠命令。

我在applications.command URI上启用了oauth2。

代码语言:javascript
复制
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)
EN

回答 1

Stack Overflow用户

发布于 2022-09-30 19:29:30

您需要添加myserverid =,并在这里添加测试服务器ID,将其置于bot =.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72143393

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档