kick.py icon indicating copy to clipboard operation
kick.py copied to clipboard

This type of message causes exception on Message.p

Open iamoverit opened this issue 8 months ago • 4 comments

{"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

iamoverit avatar Mar 04 '25 20:03 iamoverit

I'm confused. Is that the item you get from message.references.author.username?

cibere avatar Mar 04 '25 23:03 cibere

No that is just example of event we’v got from websocket

iamoverit avatar Mar 05 '25 06:03 iamoverit

That happens when someone sends kick clip link into chat

iamoverit avatar Mar 05 '25 06:03 iamoverit

  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

iamoverit avatar Mar 05 '25 07:03 iamoverit