kick.py
kick.py copied to clipboard
This type of message causes exception on Message.p
{"event":"App\\Events\\ChatMessageEvent","data":"{\"id\":\"d8d3ce21-7bf1-4d09-ac47-577264e9dc78\",\"chatroom_id\":17502579,\"content\":\"https:\\/\\/kick.com\\/pokerok_streams?clip=clip_uniqueID\",\"type\":\"message\",\"created_at\":\"2025-03-04T20:34:51+00:00\",\"sender\":{\"id\":0,\"username\":\"---\",\"slug\":\"---\",\"identity\":{\"color\":\"#BC66FF\",\"badges\":[{\"type\":\"moderator\",\"text\":\"Moderator\"}]}},\"metadata\":{\"clip\":{\"id\":\"clip_uniqueID\",\"title\":\"---",\"thumbnail_url\":\"https:\\/\\/clips.kick.com\\/clips\\/54\\/clip_uniqueID\\/thumbnail.webp\",\"duration\":50,\"creator\":{\"id\":0,\"username\":\"---\",\"slug\":\"---\",\"profile_picture\":null}}}}","channel":"chatrooms.000.v2"}
this message is impersonaled
when i called something like message.references.author.username even i check if message.references is not None: before i got a crush
I'm confused. Is that the item you get from message.references.author.username?
No that is just example of event we’v got from websocket
That happens when someone sends kick clip link into chat
File "chat.py", line 272, in on_message
self.message_print(message)
~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "chat.py", line 263, in message_print
message_references = f"{Style.DIM}↩ {message.references.author.username}: {message.references.content}"
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/kick.py/kick/utils.py", line 13, in getter
cache[func.__name__] = func(parent)
~~~~^^^^^^^^
File "/kick.py/kick/message.py", line 140, in author
id=int(self._data["original_sender"]["id"]),
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'original_sender'```
this type of crash happens