mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 15:57:43 +02:00
This is going to error so bad
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user