Gwubby
Gwubby
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Gwubby on 1/15/2024 in #djs-questions
word filtering
Trying to get this word filter to work. Its logging "Checking message" and its running the for loop, but its not running the if statement nor am I getting the catch. I originally had the deprecated "message" instead of "messageCreate" and it was just deleting every message sent, but now its not deleting anything. It has the guild messages intent.
const badword = ['test'];

client.on('messageCreate', message => {
const content = message.content;
const stringToCheck = content.replace(/\s+/g, '').toLowerCase();

console.log('Checking message:', content);

for (let i = 0; i < badword.length; i++) {
console.log('test');
if (stringToCheck.includes(badword[i])) {
console.log('Bad word found. Deleting message:', content);
message.delete()
.then(deletedMessage => console.log('Message deleted:', deletedMessage.content))
.catch(error => console.error('Error deleting message:', error));
break;
}
}
});
const badword = ['test'];

client.on('messageCreate', message => {
const content = message.content;
const stringToCheck = content.replace(/\s+/g, '').toLowerCase();

console.log('Checking message:', content);

for (let i = 0; i < badword.length; i++) {
console.log('test');
if (stringToCheck.includes(badword[i])) {
console.log('Bad word found. Deleting message:', content);
message.delete()
.then(deletedMessage => console.log('Message deleted:', deletedMessage.content))
.catch(error => console.error('Error deleting message:', error));
break;
}
}
});
8 replies
AAdmincraft
Created by Gwubby on 7/8/2023 in #questions
Horrible fps drop from Spigot to Paper
I switched from Spigot to Paper and my fps went from a stable 600+ to no more than 65. Not sure why because all I did was change out the .jar files. No plugins were added and the built in Paper anti-xray is disabled. Can anyone give me insight into this problem?
3 replies