0

I've been looking for it for a while on old posts couldn't find anything new. Is this code outdated or is there like a work around for this?

client.on('message', message => {
    
    if (message.content === 'test') {
        message.author.send('tested1');
    }
});

My conclusion is that the bot can't see the message but I do not know how else I could make a command reply

temp
  • 1
  • 3
  • Messages are now a privileged intent. You will have to enable it in the developer portal and include the intent in your client's array of intents. – Elitezen Sep 07 '22 at 23:06
  • Depending on the discord version you are using, you will want to not only check for what was mentioned above, but also `client.on('message',)` is deprecated and should be `messageCreate` – Kaspr Sep 08 '22 at 12:52
  • @Gh0st I tried messageCreate and it also didn't respond at all. – temp Sep 08 '22 at 19:26
  • @Elitezen I enabled "MESSAGE CONTENT INTENT Required for your bot to receive message content in most messages." but it and have "GatewayIntentBits.GuildMessages" added in my client but it still doesn't seem to work – temp Sep 08 '22 at 19:27
  • nvm https://stackoverflow.com/questions/73036854/message-content-doesnt-have-any-value-in-discord-js-v14 helped me out thanks for help anyways never new discord had a privileged intent – temp Sep 08 '22 at 19:40

0 Answers0