forked from Supositware/Haha-Yes
remove accent
This commit is contained in:
parent
50b32072d0
commit
95aaa6dc17
1 changed files with 1 additions and 2 deletions
|
@ -23,10 +23,9 @@ class messageListener extends Listener {
|
||||||
|
|
||||||
const bannedWords = await BannedWords.findAll({where: {word: Sequelize.where(Sequelize.fn('LOCATE', Sequelize.col('word'), message.content), Sequelize.Op.ne, 0), serverID: message.guild.id}});
|
const bannedWords = await BannedWords.findAll({where: {word: Sequelize.where(Sequelize.fn('LOCATE', Sequelize.col('word'), message.content), Sequelize.Op.ne, 0), serverID: message.guild.id}});
|
||||||
if (bannedWords[0].get('word')) {
|
if (bannedWords[0].get('word')) {
|
||||||
let censoredMessage = message.content.toLowerCase();
|
let censoredMessage = message.content.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
||||||
for (let i = 0; i < bannedWords.length; i++) {
|
for (let i = 0; i < bannedWords.length; i++) {
|
||||||
censoredMessage = censoredMessage.replace(bannedWords[i].get('word'), '█'.repeat(bannedWords[i].get('word').length));
|
censoredMessage = censoredMessage.replace(bannedWords[i].get('word'), '█'.repeat(bannedWords[i].get('word').length));
|
||||||
console.log(censoredMessage);
|
|
||||||
}
|
}
|
||||||
let Embed = new MessageEmbed()
|
let Embed = new MessageEmbed()
|
||||||
.setColor('#FF0000')
|
.setColor('#FF0000')
|
||||||
|
|
Loading…
Reference in a new issue