Replace deprecated substr with substring

This commit is contained in:
Supositware 2022-09-10 09:37:06 +02:00
parent 7c39b62d2c
commit f4772274ac

View file

@ -59,7 +59,7 @@ export default {
if (tweet) {
// Detect banned word (Blacklist the user directly)
if (wordToCensor.includes(tweet) || wordToCensor.includes(tweet.substr(0, tweet.length - 1)) || wordToCensor.includes(tweet.substr(1, tweet.length))) {
if (wordToCensor.includes(tweet) || wordToCensor.includes(tweet.substring(0, tweet.length - 1)) || wordToCensor.includes(tweet.substring(1, tweet.length))) {
const body = { type:'tweet', uid: interaction.user.id, reason: 'Automatic ban from banned word.' };
Blacklists.create(body);