英文:
Why Does Discord Say All of My Bot's Commands Require Admin Privileges to be Used?
问题
Discord显示我的机器人(使用Discord.NET编写)要求用户具有管理员权限,尽管我从未要求过这一点,无论是在Discord开发者门户中添加的权限,还是在我的代码中。
以下是没有管理员权限的用户在输入"/"时看到的内容:
这是我创建命令的示例(请注意,没有提及权限):
[EnabledInDm(false)]
[SlashCommand("ping", "查找客户端延迟")]
public async Task Ping()
{
await RespondAsync(text: "🏓 Pong!客户端延迟为 **" + Bot.Client.Latency + "** 毫秒。");
}
在服务器设置的集成选项卡中,我的Discord机器人的每个命令都显示如下:
当点击"查看"时:
为什么只有我的机器人会出现这种情况?当我邀请其他机器人时,它们都没有要求管理员权限的提及。请注意,对于具有管理员权限的用户,所有命令都能正常工作。
- 我已经邀请了其他机器人,它们都没有这个问题。
- 我尝试过添加权限要求,但没有任何效果。
- 我可以手动将角色添加给用户,但我不应该这样做(它应该像我邀请的所有其他机器人一样运行,不会对所有命令强制使用管理员权限,如下图所示:
)。
英文:
Discord shows that my bot (written with Discord.NET) REQUIRES users to have admin even though I never require it, both in my permissions added in the Discord Developer Portal, and in my code.
Here is what users without admin see when they type "/":
An example of how I create a command (notice that there is zero mention of permissions):
[EnabledInDm(false)]
[SlashCommand("ping", "find out client latency")]
public async Task Ping()
{
await RespondAsync(text: $"🏓 Pong! The client latency is **{Bot.Client.Latency}** ms.");
}
Here is what is shown on EVERY command on my Discord bot in the integrations tab found in server settings.
When "View" is clicked:
Why does only my bot do this? When I invite other bots they have no mention of requiring admin. For the record ALL commands work with a user who has admin privileges.
- I have invited other bots and zero of them had this issue.
- I have tried adding permissions requirements, and this did nothing
- I can manually add roles to users, but I should NOT have to do so (it should act like how all other bots I have invited work and not force Admin permissions on to all commands i.e. the following image:
).
答案1
得分: 0
我不确定究竟是什么导致了问题,但将 Discord.NET 版本从 3.6.1
更改为 3.10.0
起效。
此外,这与 https://github.com/discord-net/Discord.Net/issues/2515 相似。
英文:
I am unsure of what exactly caused the issue, but changing the Discord.NET version from 3.6.1
to 3.10.0
worked.
Also, this is similar to https://github.com/discord-net/Discord.Net/issues/2515
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论