mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 13:56:43 +02:00
This is going to error so bad
This commit is contained in:
@@ -27,7 +27,9 @@ module.exports = class DiscriminatorCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, { discrim }) {
|
||||
const users = this.client.users.filter(user => user.discriminator === discrim).map(user => user.username);
|
||||
const users = this.client.users.cache
|
||||
.filter(user => user.discriminator === discrim)
|
||||
.map(user => user.username);
|
||||
return msg.say(stripIndents`
|
||||
**Found ${users.length} users with the discriminator #${discrim}:**
|
||||
${trimArray(users, 50).join(', ')}
|
||||
|
||||
@@ -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.cache.filter(emoji => type === 'animated' ? emoji.animated : !emoji.animated);
|
||||
if (!emojis.size) return msg.say(`This server has no ${type} custom emoji.`);
|
||||
return msg.say(emojis.map(emoji => emoji.toString()).sort().join(' '), { split: { char: ' ' } });
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ module.exports = class ServerCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
if (!msg.guild.members.has(msg.guild.ownerID)) await msg.guild.members.fetch(msg.guild.ownerID);
|
||||
if (!msg.guild.members.cache.has(msg.guild.ownerID)) await msg.guild.members.fetch(msg.guild.ownerID);
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x00AE86)
|
||||
.setThumbnail(msg.guild.iconURL({ format: 'png' }))
|
||||
@@ -35,8 +35,8 @@ module.exports = class ServerCommand extends Command {
|
||||
|
||||
**Server Stats:**
|
||||
• Members: ${msg.guild.memberCount}
|
||||
• Roles: ${msg.guild.roles.size}
|
||||
• Channels: ${msg.guild.channels.filter(channel => channel.type !== 'category').size}
|
||||
• Roles: ${msg.guild.roles.cache.size}
|
||||
• Channels: ${msg.guild.channels.cache.filter(channel => channel.type !== 'category').size}
|
||||
`);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ module.exports = class UserCommand extends Command {
|
||||
if (msg.channel.type === 'text') {
|
||||
try {
|
||||
const member = await msg.guild.members.fetch(user.id);
|
||||
const defaultRole = msg.guild.roles.get(msg.guild.id);
|
||||
const defaultRole = msg.guild.roles.cache.get(msg.guild.id);
|
||||
const roles = member.roles
|
||||
.filter(role => role.id !== defaultRole.id)
|
||||
.sort((a, b) => b.position - a.position)
|
||||
|
||||
Reference in New Issue
Block a user