Discord为什么说我的机器人的所有命令都需要管理员权限才能使用?

huangapple go评论62阅读模式
英文:

Why Does Discord Say All of My Bot's Commands Require Admin Privileges to be Used?

问题

Discord显示我的机器人(使用Discord.NET编写)要求用户具有管理员权限,尽管我从未要求过这一点,无论是在Discord开发者门户中添加的权限,还是在我的代码中。

以下是没有管理员权限的用户在输入"/"时看到的内容:

Discord为什么说我的机器人的所有命令都需要管理员权限才能使用?

这是我创建命令的示例(请注意,没有提及权限):

[EnabledInDm(false)]
[SlashCommand("ping", "查找客户端延迟")]
public async Task Ping()
{
    await RespondAsync(text: "🏓 Pong!客户端延迟为 **" + Bot.Client.Latency + "** 毫秒。");
}

在服务器设置的集成选项卡中,我的Discord机器人的每个命令都显示如下:

Discord为什么说我的机器人的所有命令都需要管理员权限才能使用?

当点击"查看"时:

Discord为什么说我的机器人的所有命令都需要管理员权限才能使用?

为什么只有我的机器人会出现这种情况?当我邀请其他机器人时,它们都没有要求管理员权限的提及。请注意,对于具有管理员权限的用户,所有命令都能正常工作。

  • 我已经邀请了其他机器人,它们都没有这个问题。
  • 我尝试过添加权限要求,但没有任何效果。
  • 我可以手动将角色添加给用户,但我不应该这样做(它应该像我邀请的所有其他机器人一样运行,不会对所有命令强制使用管理员权限,如下图所示:

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 "/":

Discord为什么说我的机器人的所有命令都需要管理员权限才能使用?

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.

Discord为什么说我的机器人的所有命令都需要管理员权限才能使用?

When "View" is clicked:

Discord为什么说我的机器人的所有命令都需要管理员权限才能使用?

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:

Discord为什么说我的机器人的所有命令都需要管理员权限才能使用?).

答案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

huangapple
  • 本文由 发表于 2023年5月22日 11:32:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76302883.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定