Firebot icon indicating copy to clipboard operation
Firebot copied to clipboard

[Bug] Twurple error when receiving whispers

Open ebiggz opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

We are getting a twurple error when receiving a whisper. This prevents whispers from triggering commands right now

Expected Behavior

No response

Steps To Reproduce

No response

Version

Current

What operating system are you using Firebot on?

Windows 11

Relevant log output

error: Unhandled promise rejection 
{
  message: "Cannot read property 'login' of undefined",
  stack: "TypeError: Cannot read property 'login' of undefined\n" +
    '    at PubSubWhisperMessage.get senderName [as senderName] (/Users/ebiggz/repos/personal/Firebot/node_modules/@twurple/pubsub/lib/messages/PubSubWhisperMessage.js:26:62)\n' +
    '    at PubSubListener._callback (/Users/ebiggz/repos/personal/Firebot/backend/twitch-api/pubsub/pubsub-client.js:94:64)\n' +
    '    at PubSubListener.call (/Users/ebiggz/repos/personal/Firebot/node_modules/@twurple/pubsub/lib/PubSubListener.js:38:14)\n' +
    '    at /Users/ebiggz/repos/personal/Firebot/node_modules/@twurple/pubsub/lib/SingleUserPubSubClient.js:40:30\n' +
    '    at processTicksAndRejections (internal/process/task_queues.js:93:5)'
}

Contact Details (Optional)

No response

ebiggz avatar May 12 '22 08:05 ebiggz

This is a bug in Twurple itself. When whispers are received, PubSub will sometimes send two separate event types: one for the whisper itself and one for Twitch's spam rating stuff. Right now, when Twurple's PubSub implementation receives a whisper event, it doesn't differentiate between the two message types before attempting to fire the event.

zunderscore avatar May 18 '22 14:05 zunderscore

So just to add onto this since I'm not sure if twurple is aware of the bug or a temp fix can be done with the information I have. It seems like if you create a "whisper event" with just a "chat effect" of hi, the 1st whisper you do triggers the event fine, but after that 1st whisper, it no longer triggers the "whisper event" unless you delete the command and make a new one.

Badhabits avatar Jul 05 '22 03:07 Badhabits