mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Sort roles and emoji
This commit is contained in:
@@ -25,7 +25,7 @@ module.exports = class EmojiListCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, { type }) {
|
||||
const emojis = msg.guild.emojis.filter(emoji => type === 'animated' ? emoji.animated : !emoji.animated);
|
||||
const emojis = msg.guild.emojis.filter(emoji => type === 'animated' ? emoji.animated : !emoji.animated).sort();
|
||||
if (!emojis.size) return msg.say(`This server has no ${type} custom emoji.`);
|
||||
return msg.say(emojis.map(emoji => emoji.toString()).join(' '), { split: { char: ' ' } });
|
||||
}
|
||||
|
||||
@@ -38,7 +38,10 @@ module.exports = class UserInfoCommand extends Command {
|
||||
if (msg.channel.type === 'text') {
|
||||
try {
|
||||
const member = await msg.guild.members.fetch(user.id);
|
||||
const roles = member.roles.filter(role => role.id !== msg.guild.defaultRole.id);
|
||||
const roles = member.roles
|
||||
.filter(role => role.id !== msg.guild.defaultRole.id)
|
||||
.sort((a, b) => b.position - a.position)
|
||||
.map(role => role.name);
|
||||
embed
|
||||
.setColor(member.displayHexColor)
|
||||
.setDescription(member.presence.activity
|
||||
@@ -49,8 +52,7 @@ module.exports = class UserInfoCommand extends Command {
|
||||
.addField('❯ Highest Role',
|
||||
member.roles.highest.id === msg.guild.defaultRole.id ? 'None' : member.roles.highest.name, true)
|
||||
.addField('❯ Hoist Role', member.roles.hoist ? member.roles.hoist.name : 'None', true)
|
||||
.addField(`❯ Roles (${roles.size})`,
|
||||
roles.size ? trimArray(roles.map(role => role.name), 10).join(', ') : 'None');
|
||||
.addField(`❯ Roles (${roles.length})`, roles.length ? trimArray(roles, 10).join(', ') : 'None');
|
||||
} catch (err) {
|
||||
embed.setFooter('Failed to resolve member, showing basic user information instead.');
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "90.3.2",
|
||||
"version": "90.3.3",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user