fix crash?

This commit is contained in:
loicbersier 2020-03-29 18:31:15 +02:00
parent 6c0f5cd540
commit 7d934bb6f8

View file

@ -35,6 +35,9 @@ class BannedWordsCommand extends Command {
}
async exec(message, args) {
// eslint-disable-next-line no-useless-escape
if (message.content.includes('(?:\s|/\*.*\*/|//.*|#.*)*\(.*\)')) return; // This make bot crash
if (!args.word) args.word = '';
args.word = args.word.replace(/[\u0250-\ue007]/g, '');
const bannedWords = await BannedWords.findOne({where: {word: args.word.toLowerCase(), serverID: message.guild.id}});