javascript - 斜线命令 echo DiscordAPIError:heroku 中缺少访问权限
问题描述
//slash command to echo
bot.on("ready", async () => {
bot.user.setPresence({ activities: [{ name: "Tedi", type: "WATCHING"}] });
console.log("bye");
const data = {
name: "echo",
description: "Echo your text",
options: [{
name: "text",
type: "STRING",
description: "The user input",
required: true,
}],
};
const command = await bot.guilds.cache.get('server id number')?.commands.create(data);
})
这是我在 heroku 中收到的错误消息,我不确定缺少访问权限是什么意思。提前致谢!
解决方案
这是一个很常见的问题 你可以去开发者部门
https://discord.com/developers/applications 遵循以下模式
然后复制下面的 URL 并粘贴到网页上,然后选择要创建斜杠命令的位置,就是这样!
推荐阅读
- spring-security - Vaadin + Spring Security 可以仅充当 oauth2 用户代理而不是客户端吗?
- api - 对于 GSuite,新添加的用户未显示
- powershell - 我需要在卸载 symantec 之前重新启动远程计算机
- c++ - C++ 字符串赋值错误。如何为结构指针的字符串成员赋值?
- ios - iOS 14 (Swift) 中奇怪的 MFMailComposeViewController 行为
- postgresql - 默认情况下,postgres 中的主键字段不是 NULL 吗?
- kubernetes - 无法使用 Minikube 在 Windows Home 上的浏览器中访问 Kubernetes Ingress?
- javascript - 为什么钩子的代码(功能)不断渲染?(与类相比)
- visual-studio - Azure DevOps 中的 Docker Compose 构建失败
- scala - Scala 中的局部效果和可变状态与 Cats