Fixed some errors

Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
loicbersier 2020-09-04 18:47:39 +02:00
parent 200ad3b47a
commit 4f1f672d32
2 changed files with 8 additions and 3 deletions

View file

@ -51,10 +51,11 @@ class commandStartedListener extends Listener {
if (dailyStats) { if (dailyStats) {
if (command.category.id === 'owner') return; // Don't count owner command if (command.category.id === 'owner') return; // Don't count owner command
let obj = { let obj = {
guild: message.guild.id,
command: command.id command: command.id
}; };
if (message.guild) obj.guild = message.guild.id;
report.push(obj); report.push(obj);
let uniqueGuild = []; let uniqueGuild = [];

View file

@ -41,8 +41,12 @@ class messageListener extends Listener {
*/ */
// Banned words // Banned words
const bannedWords = await BannedWords.findAll({where: {word: Sequelize.where(Sequelize.fn('LOCATE', Sequelize.col('word'), message.content.replace(/\u200B/g, '').replace(/[\u0250-\ue007]/g, '')), Sequelize.Op.ne, 0), serverID: message.guild.id}}); let bannedWords;
const whitelistWord = await WhitelistWord.findAll({where: {word: Sequelize.where(Sequelize.fn('LOCATE', Sequelize.col('word'), message.content.replace(/\u200B/g, '').replace(/[\u0250-\ue007]/g, '')), Sequelize.Op.ne, 0), serverID: message.guild.id}}); let whitelistWord;
if (message.guild) {
bannedWords = await BannedWords.findAll({where: {word: Sequelize.where(Sequelize.fn('LOCATE', Sequelize.col('word'), message.content.replace(/\u200B/g, '').replace(/[\u0250-\ue007]/g, '')), Sequelize.Op.ne, 0), serverID: message.guild.id}});
whitelistWord = await WhitelistWord.findAll({where: {word: Sequelize.where(Sequelize.fn('LOCATE', Sequelize.col('word'), message.content.replace(/\u200B/g, '').replace(/[\u0250-\ue007]/g, '')), Sequelize.Op.ne, 0), serverID: message.guild.id}});
}
if (whitelistWord[0]) { if (whitelistWord[0]) {
return; // If word is whitelisted just return return; // If word is whitelisted just return