0

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

  • 2
    Have you enabled the message content intent on your [developer portal](https://discord.com/developers/applications)? https://stackoverflow.com/a/73037243/6126373 – Zsolt Meszaros Oct 28 '22 at 12:01

1 Answers1

-1

Enable your Message Content Intent on the Discord Developer Portal

1ly4s0
  • 54
  • 2