0

The "message.reply('You Said: ${message.content}');" isn't working, for some reason the ${message.content} gets included in the '' marks therefore the bot replies with: You Said: ${message.content} instead of You Said: the users sent msg.

// Check for when a message on discord is sent
client.on('messageCreate', async function(message){
    try {
        console.log(message.content);
        message.reply('You Said: ${message.content}');
    } catch (err) {
        console.log(err)
    }
});

1 Answers1

0

Like people said in the comments, to use template strings you need to use the backtick symbol (`) instead of a single quote or double quotes.

Therefore, this results in the reply statement being replaced with this:

message.reply(`You Said: ${message.content}`);
Dan
  • 315
  • 3
  • 9