英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论