Closed jrdn91 closed 9 years ago
Just as a suggestion, I would limit the command regex to the first character (perhaps after a trim) with the caret:
if(!message.trim().match(/^!\w+/g)){
You're right on that one, the commands will always be the beginning of the string, thanks for the pointer. Now if only I can get this timeout to work.
Your chat event looks fine, can you try console.log(chatBot);
to see if chatBot is defined ? It should return an object if it works.
Also, make sure you are using the latest version of tmi.js :smile:
Hi there. Happy user of this repo here! I'm watching the repo and tracking what's going on through email. I noticed that there was something up with a notice for attempting to timeout the broadcaster and that seems to be the issue here. I do not recall whether that was fixed yet, but you might want to try it out with somebody else to see if is indeed the issue.
https://github.com/Schmoopiie/tmi.js/issues/28#issuecomment-137814564 #28 Might be related, Twitch notice bad_timeout_broadcaster
.
^^ That may be the case here I didn't even think about that. I will test this out with another user and get back to this thread.
The notices are not causing an application to crash, it is only used to catch notices from Twitch (can be error messages or confirmation). For instance, if you use the timeout command on yourself, Twitch will respond with the msg-id bad_timeout_self which is You cannot timeout yourself. We will be using these notices and transform each and every command to support promises. We did it for .ban() already, see issue #44.
Edit: If a notice is not supported by the library, a message will tell you all the informations we need and you will be able to post it in issue #28
I ran npm update
for tmijs but I guess it didn't update, updating to 0.0.23
fixed the timeout not working.
Make sure the version of tmi.js in your package.json file has a caret (^), the caret will make npm update the module with the latest minor and latest patch version when you use ´´npm update´´
When trying to use the timeout function I'm getting this error
My code looks like this