Guilds Highest Role Command?

南笙酒味 提交于 2021-02-19 23:47:22

问题


I want to get the highest role in the guild with discord.js

message.guild.roles.highestRole

This doesn't work. Any help would be appreciated. Thanks from now :)


回答1:


  • For discord.js v12 / master use message.guild.roles.highest.name

  • For discord.js v11.4.x / stable use message.guild.roles.sort((b, a) => a.position - b.position || a.id - b.id).first().name, this will sort the roles Collection by their position and then get the highest one, and return the name of it.



来源:https://stackoverflow.com/questions/55888823/guilds-highest-role-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!