Answers for "cannot read property startswith of undefined"

0

cannot read property startswith of undefined

Your issue is, that you mix discord.js with discord.io

discord.js is object oriented where discord.io is not, so in discord.io your message is already a string!

Example discord.io message event.

bot.on('message', function(user, userID, channelID, message, event) {
    if (message === "ping") {
        bot.sendMessage({
            to: channelID,
            message: "pong"
        });
    }
});
Posted by: Guest on March-22-2021

Code answers related to "cannot read property startswith of undefined"

Browse Popular Code Answers by Language