Ask coding questions

← Back to all posts
Help with code
Bottian (1)

When I try to run the code it says that msg is undefined. I'm new to this and don't know how to fix this. please advise. also side note this code is for a discord bot (in case that's important)

Answered by cuber1515 (57) [earned 5 cycles]
View Answer
cuber1515 (57)

@Bottian To fix this all you have to do is add client.on('message', message => { right above all of the if statements. Hope this helps.