I'm following the devdungeon tutorial for making a discord bot. (they use version 11 in the video, i'm using version 12, and yes i have resolved all the version difference issues before this current issue). I'm on the part where, when you send a message, the bot will echo your message with extra stuff like mentioning the author. i've followed the code exactly, but when i run my code and test the bot, it only responds with the other stuff and not the message it's supposed to echo.
snippet:
receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() +
": " + receivedMessage.content)
everything except for receivedMessage.content
works as intended.
I thought it might be some discord policy update for preventing bots acquiring private messages, but from what i read that only applies to official verified bots.
anybody know why this is happening?
here's the full function:
client.on('message', (receivedMessage) => {
if (receivedMessage.author == client.user) {
return
}
receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() +
": " + receivedMessage.content)
})
i've tried changing some properties that may have been changed from v11 to v12, but to no avail.