【发布时间】:2021-02-14 20:46:29
【问题描述】:
【问题讨论】:
标签: node.js discord discord.js
【问题讨论】:
标签: node.js discord discord.js
您要查找的内容称为hoist。您可以通过在角色上使用.setHoist() 方法来更改是否提升角色。假设您在消息事件中,您可以在其中执行以下操作来提升特定角色:
bot.on('message', message => {
const yourRole = message.guild.roles.cache.find(r => r.name === 'role-name'); // get the role using it's name, you can also find it using the id if you want to.
yourRole.setHoist(true); // setting hoist to true for this role
}
就是这样。这将使拥有此特定yourRole 的成员出现在不同的类别下。
您还可以在使用<RoleManager>.create() 方法创建角色时指定是否提升角色。
【讨论】: