thelabcat / rumble-api-wrapper-py

An unofficial Python wrapper for the Rumble Live Stream API
GNU General Public License v3.0
2 stars 1 forks source link

Add SSEChat message raid_notification property #7

Closed thelabcat closed 5 months ago

thelabcat commented 5 months ago

A raid notification in chat comes through as a message JSON block, like so: {'id': '1559183617357416211', 'time': '2024-05-28T23:31:40+00:00', 'user_id': '41678305', 'text': 'has raided this stream!', 'blocks': [{'type': 'text.1', 'data': {'text': 'has raided this stream!'}}], 'channel_id': 1335482, 'raid_notification': {'start_ts': 1716939100}} That key raid_notification does not exist in normal message JSON blocks, so that can be used to tell if the message is actually a raid notification. I am not sure what the start_ts data is for, but we can have the property return that sub-JSON or False.