公会最高角色指挥部? [英] Guilds Highest Role Command?

查看:15
本文介绍了公会最高角色指挥部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用discord.js获得公会最高角色

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 :)

推荐答案

  • 对于 discord.js v12/master 使用 message.guild.roles.highest.name

    对于 discord.js v11.4.x/稳定版使用 message.guild.roles.sort((b, a) => a.position - b.position || a.id - b.id).first().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.

    这篇关于公会最高角色指挥部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆