mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36: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)
|
||||
|
||||
@@ -47,7 +47,7 @@ module.exports = class RenameAllCommand extends Command {
|
||||
await msg.guild.members.fetch();
|
||||
await msg.reply('Fetched members! Renaming...');
|
||||
let i = 0;
|
||||
for (const member of msg.guild.members.values()) {
|
||||
for (const member of msg.guild.members.cache.values()) {
|
||||
try {
|
||||
await member.setNickname(nickname);
|
||||
} catch (err) {
|
||||
|
||||
@@ -16,6 +16,6 @@ module.exports = class RandomUserCommand extends Command {
|
||||
const members = [this.client.user, msg.channel.recipient];
|
||||
return msg.say(`I choose ${members[Math.floor(Math.random() * members.length)].username}!`);
|
||||
}
|
||||
return msg.say(`I choose ${msg.guild.members.random().displayName}!`);
|
||||
return msg.say(`I choose ${msg.guild.members.cache.random().displayName}!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,10 +21,12 @@ module.exports = class PortalSendCommand extends Command {
|
||||
|
||||
async run(msg, { message }) {
|
||||
if (/discord(\.gg|app\.com\/invite|\.me)\//gi.test(message)) return msg.reply('Please do not send invites.');
|
||||
let channels = this.client.channels.filter(
|
||||
let channels = this.client.channels.cache.filter(
|
||||
channel => channel.type === 'text' && channel.topic && channel.topic.includes('<portal>')
|
||||
);
|
||||
if (msg.channel.type === 'text') channels = channels.filter(channel => !msg.guild.channels.has(channel.id));
|
||||
if (msg.channel.type === 'text') {
|
||||
channels = channels.filter(channel => !msg.guild.channels.cache.has(channel.id));
|
||||
}
|
||||
if (!channels.size) return msg.reply('No channels have an open portal...');
|
||||
const channel = channels.random();
|
||||
try {
|
||||
|
||||
@@ -24,7 +24,7 @@ module.exports = class InfoCommand extends Command {
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x00AE86)
|
||||
.setFooter('©2017-2020 dragonfire535#8081')
|
||||
.addField('❯ Servers', formatNumber(this.client.guilds.size), true)
|
||||
.addField('❯ Servers', formatNumber(this.client.guilds.cache.size), true)
|
||||
.addField('❯ Shards', formatNumber(this.client.options.shardCount), true)
|
||||
.addField('❯ Commands', formatNumber(this.client.registry.commands.size), true)
|
||||
.addField('❯ Home Server', this.client.options.invite ? `[Here](${this.client.options.invite})` : 'None', true)
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
"cheerio": "^1.0.0-rc.3",
|
||||
"common-tags": "^1.8.0",
|
||||
"custom-translate": "^2.2.8",
|
||||
"discord.js": "github:discordjs/discord.js#fe7df708e44e0280dfaf0f8e457b154781bb5140",
|
||||
"discord.js": "github:discordjs/discord.js",
|
||||
"discord.js-commando": "github:discordjs/Commando",
|
||||
"dotenv": "^8.2.0",
|
||||
"gifencoder": "^2.0.1",
|
||||
|
||||
Reference in New Issue
Block a user