Strip Invites in portal send, strip bot invites

This commit is contained in:
Dragon Fire
2020-05-08 09:59:40 -04:00
parent dd8b8f82bf
commit adbdff5369
4 changed files with 14 additions and 6 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
const Command = require('../../structures/Command');
const { stripInvites } = require('../../util/Util');
const { PORTAL_EMOJI_ID, PORTAL_EMOJI_NAME } = process.env;
module.exports = class PortalSendCommand extends Command {
@@ -18,14 +19,14 @@ module.exports = class PortalSendCommand extends Command {
key: 'message',
prompt: 'What message would you like to send?',
type: 'string',
max: 1000
max: 1000,
parse: message => stripInvites(message)
}
]
});
}
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.cache.filter(
channel => channel.guild && channel.topic && channel.topic.includes('<xiao:portal>')
);