Reputation: 11
I'm trying to make a discord bot with the command !!flip
. I tried this but got this error :
So, I then tried bot.channel.sendmessage
and got this message :
Here is my code :
if (message.content === "!!flip") {
var result = Math.floor((Math.random() * 2) + 1);
if (result == 1) {
bot.reply(message, "The coin landed on heads");
} else if (result == 2) {
bot.reply(message, "The coin landed on tails");
}
}
Upvotes: 1
Views: 91