设置角色提及权限

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

Setting a role mentioning permission

问题

我想使用 JDA 创建一个角色,并设置权限,以便只有拥有此角色的用户可以提及此角色。我的当前代码如下,但每个人都可以提及此角色。

guild.createRole()
        .setColor(Color.GREEN)
        .setMentionable(true)
        .setName("MyRole")
        .setPermissions(/* 在这里设置权限 */)
        .submit();
英文:

I would like to create a role with JDA and set permissions so that only users with this role can mention this role. My current code is the following but everyone can mention this role.

    guild.createRole()
            .setColor(Color.GREEN)
            .setMentionable(true)
            .setName("MyRole")
            .setPermissions()
            .submit()

答案1

得分: 1

Discord的权限系统不允许这样做。您只能给予该角色MESSAGE_MENTION_EVERYONE权限,从而允许他们提及任何角色。您无法创建仅允许角色成员提及的角色。

英文:

Discord's permission system doesn't allow this. You can only give the role the MESSAGE_MENTION_EVERYONE permission which allows them to mention any role. You cannot make a role that only role members can mention.

huangapple
  • 本文由 发表于 2020年8月15日 17:40:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/63424630.html
匿名

发表评论

匿名网友

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

确定