Discord.js Problem I should point out I am not experienced at discord.js. I have the following code which is supposed to change the users requested sum or expression into the actual answer and message back. My other command is working but not the other here is the code for that:
client.once("message", msg => {
if(msg.content.includes("!simple")){
math = Number(msg.content.slice(msg.content.search("e")))
msg.reply(guild.username + "The answer is " + math )
}
})
I basically remove the command part via slice method then compute the value of it using the Number function and subsequently return it but I get no response from the bot. Any help appreciated
oncewill only listen for the first event, maybe useoninsteadmsg.contentis an array somsg.content.splicewill throw an error.message.contentisif (message.content == "!simple") {