twitch-js / twitch-js

A community-centric, community-supported version of tmi.js
https://twitch-js.netlify.com
MIT License
344 stars 41 forks source link

"Whisper" keyword is now "WHISPER" instead of "PRIVMSG #jtv" #241

Closed joezeng closed 3 years ago

joezeng commented 4 years ago

Expected behaviour

When I was testing for the ability for my chatbot to receive whispers, I expected that I could use Chat.Events.WHISPER to define the event callback for whispers. (e.g. chat.on(Chat.Events.WHISPER, callback))

Actual behaviour

The callback doesn't fire, but using chat.on('WHISPER', callback) makes it work.

Steps to reproduce

Whisper to any chatbot that has an on(Chat.Events.WHISPER) callback. The callback will not trigger because Chat.Events.WHISPER is not the literal WHISPER string.

Your environment

marcandrews commented 4 years ago

Honestly, I did not know there was a WHISPER event as it seems to be undocumented. Can you post an example raw message so that support can be added?

joezeng commented 4 years ago
_raw: '@badges=premium/1;color=#FF7F50;display-name=joezeng;emotes=;message-id=4;thread-id=12345678_987654321;turbo=0;user-id=12345678;user-type= :joezeng!joezeng@joezeng.tmi.twitch.tv WHISPER test_chatbot :whisper whisper whisper',

I assume this is the relevant raw line (usernames etc. obfuscated somewhat, but the format has been unchanged).