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
+4 -2
View File
@@ -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 {