TypeError: msg.channel.sendMessage is not a function

I managed to get my bot up and running, which is meant to start saying random stuff every 10-15 secs once I spell the command “!on” and to desactivate with “!off”
but neither of them work, the cmd prompt shows me this

TypeError: msg.channel.sendMessage is not a function

2 Likes

could you please clarify what script I should change?

Don’t use msg.channel.sendMessage, use message.channel.send('My Message')

1 Like

But just remember that’s for PMs.

What is for PMs?

message.author.send('My Message') is for DMing a user.

It depends on how the Message object is defined, unless the user has defined it as message but is using it as msg.

1 Like

@Halfeddi could you show us where you define msg or message?

1 Like