This is going to error so bad

This commit is contained in:
Dragon Fire
2020-02-11 15:40:49 -05:00
parent 085284821c
commit db7bb7f49f
9 changed files with 16 additions and 12 deletions
+3 -1
View File
@@ -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(', ')}
+1 -1
View File
@@ -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: ' ' } });
}
+3 -3
View File
@@ -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);
}
+1 -1
View File
@@ -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)