Ascensor Rural
DIAdiscord.js - Imagine an app
•Created by Ascensor Rural on 9/11/2024 in #djs-questions
Error in Ticket System MongoDB database log
29 replies
DIAdiscord.js - Imagine an app
•Created by Ascensor Rural on 5/23/2023 in #djs-questions
Idk why this happens
8 replies
DIAdiscord.js - Imagine an app
•Created by Ascensor Rural on 5/22/2023 in #djs-questions
I was doing a badword "detector" and don't works when It is to send the console.log
the code:
const fs = require("fs");
// Función para detectar la palabra prohibida.
function detectForbiddenWord(content) {
const forbiddenWords = require("../../../forbidden-words.json");
for (const word of forbiddenWords) {
if (content.includes(word)) {
console.log(
Forbidden word detected: ${word}
);
// Realiza aquí la acción correspondiente para la palabra prohibida
// Por ejemplo, puedes aplicar una sanción al usuario o enviar un mensaje de advertencia
return true;
}
}
return false;
}
module.exports = {
name: "interactionCreate",
async execute(interaction, client) {
if (!interaction.isCommand()) return;
const { commandName } = interaction;
const command = client.commands.get(commandName);
if (!command) return;
try {
await command.execute(interaction);
// Verificar si la interacción es un mensaje
if (interaction.type === "MESSAGE") {
const content = interaction.content;
if (content && detectForbiddenWord(content.toLowerCase())) {
console.log("Message with forbidden word detected");
}
}
} catch (error) {
console.error(error);
if (!interaction.replied) {
await interaction.reply({
content: "Something went wrong while executing this command.",
ephemeral: true,
});
}
}
},
};8 replies
DIAdiscord.js - Imagine an app
•Created by Ascensor Rural on 5/15/2023 in #djs-questions
I don't now why it don't works
9 replies
DIAdiscord.js - Imagine an app
•Created by Ascensor Rural on 5/10/2023 in #djs-questions
sapphire shapeshift don't works
my code don't works and i don't know how I can solve it
16 replies
DIAdiscord.js - Imagine an app
•Created by Ascensor Rural on 1/15/2023 in #djs-questions
Error: SyntaxError: Indentifier "options" has already been declared, how can i fix it?
9 replies
DIAdiscord.js - Imagine an app
•Created by Ascensor Rural on 1/14/2023 in #djs-questions
There's someone know how can I make my boy restrict a command per roles?
v14.7.1
4 replies
DIAdiscord.js - Imagine an app
•Created by Ascensor Rural on 12/26/2022 in #djs-questions
I have a problem with the refreshing application commands v14.7.1
5 replies
DIAdiscord.js - Imagine an app
•Created by Ascensor Rural on 11/16/2022 in #djs-questions
I had a problem with the 'body' of handleCommands (v14.6.0)
4 replies