Merge branch 'master' of https://gitlab.com/loicbersier/discordbot
This commit is contained in:
commit
26288f88f4
2 changed files with 137 additions and 137 deletions
|
@ -8,7 +8,7 @@ class BlacklistInhibitor extends Inhibitor {
|
|||
}
|
||||
|
||||
async exec(message) {
|
||||
const blacklist = ['501856229123948545', '497730155691638784', '29476879240658944', '294768792406589440', '530399670728392737', '595102888796356628', '342039250302140418'];
|
||||
const blacklist = ['501856229123948545', '497730155691638784', '29476879240658944', '294768792406589440', '530399670728392737', '595102888796356628', '342039250302140418', '319180626928336896'];
|
||||
return blacklist.includes(message.author.id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,9 +20,8 @@ class messageListener extends Listener {
|
|||
|
||||
|
||||
// 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}});
|
||||
if (bannedWords[0].get('word')) {
|
||||
if (bannedWords[0]) {
|
||||
// Remove accent
|
||||
let censoredMessage = message.content.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
||||
// Remove zero width space character
|
||||
|
@ -41,8 +40,7 @@ class messageListener extends Listener {
|
|||
|
||||
message.channel.send(Embed);
|
||||
return message.delete({reason: `Deleted message: ${message.content}`});
|
||||
}
|
||||
|
||||
} else {
|
||||
// auto responses
|
||||
const autoresponseStat = await autoResponseStat.findOne({where: {serverID: message.guild.id}});
|
||||
if (autoresponseStat) {
|
||||
|
@ -208,6 +206,8 @@ class messageListener extends Listener {
|
|||
} else {
|
||||
return message.channel.send(text);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue