问题
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