tmijs / tmi.js

💬 Javascript library for the Twitch Messaging Interface. (Twitch.tv)
https://tmijs.com
MIT License
1.54k stars 217 forks source link

TypeError Message #407

Closed entres999 closed 4 years ago

entres999 commented 4 years ago

"TypeError: message.startsWith is not a function" ... I get this message without even using the .startsWith

entres999 commented 4 years ago

My code works perfectly in jsfiddle when I try it on twitch chat it doesnt work (im making a command for a twitch bot)

FoseFx commented 4 years ago

Hey, can you provide more context for this issue?

Desirable:

Please make sure not to post any credentials here

entres999 commented 4 years ago

image

entres999 commented 4 years ago

image

entres999 commented 4 years ago

I hope I provided all the info needed

FoseFx commented 4 years ago

I believe this is because you pass z, a number into client.say(). This function requires you to pass a string as an argument though. Fix:

setTimeout(function () {
  client.say("channelname", "" + z) // here z ist casted into a string first
}, delayInMilliseconds)
entres999 commented 4 years ago

it worked. I will keep this in mind, that client.say requires two strings as arguments. Thank you so much for the help