tmijs / tmi.js

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

(intermediate value)(intermediate value)(intermediate value).toLowerCase is not a function #335

Closed theeSpark closed 5 years ago

theeSpark commented 5 years ago

A bot that has a command for disconnecting from a channel, checks if sender is the channel its in (basically if the command is sent by the streamer.)

Actual behaviour: Basically just throws an error crashing the bot.

Expected behaviour: Should part from the selected channel.

Error log:

node_modules\tmi.js\lib\utils.js:75
        var channel = (str ? str : "").toLowerCase();
                                       ^

TypeError: (intermediate value)(intermediate value)(intermediate value).toLowerCase is not a function

Server configuration

AlcaDesign commented 5 years ago

How are you using .part?

theeSpark commented 5 years ago

client.part(channel); (channel is the first value in the chat event.)

AlcaDesign commented 5 years ago

You need to verify that channel is a string and/or at least a falsy value.