I'm working in a discord bot, specifically in a rate command, which is supposed to return:
"I would rate (thing to be rated) (random number)/10."
But it returns:
"I would rate (thing to be rated) [object Undefined]/10."
client.on('message', message => {
if(message.content.startsWith (prefix + "rate")) {
if(message.content.slice(prefix.length + 4) === ""){
message.channel.send("Give me something to rate");
}
else
message.channel.send("I would rate" + "**" +
message.content.slice(prefix.length + 4) + "**" + " " +
toString(Math.floor(Math.pow(Math.random, 10))) + "/10");
}
What can possibly be wrong?