so, recently i discovered that my bot just show the message.content when the message have mentioned him and im still in a kinda old version of discord.js (13.6.0) but updating it just break it, is a way to fix this? without remaking my whole code
here my code (its not all)
const Discord = require("Discord.js");
const valores = require("./valores.json");
const pre = "&"
const client = new Discord.Client({
intents: [
"GUILDS",
"GUILD_MESSAGES",
"GUILD_MESSAGE_REACTIONS",
"DIRECT_MESSAGE_REACTIONS",
]
})
client.on("ready", () => {
console.log("O bot foi activo com sucesso")
client.user.setPresence({ activities: [{ name: `meu prefixo é '${pre}'!` }], status: "dnd" });
})
client.on("messageCreate", async message => {
var args = message.content.slice(pre.length).split(/ +/g);
const comando = args.shift().toLowerCase();
const cmd = message.content.slice(pre.length + comando.length + 1); //just to get the message without the command
console.log(`\n ${guild.name}, chat ` + message.channel.name +`\n ${message.createdAt}\n ${message.author.username}: ${message.content}`)
if (!message.content.startsWith(pre)) return;
if (message.author.bot){
return;
}
i try search about this but i find just the reverse of this problem