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

feat: Add reply functionality to chatroom and update HTTP client for …

Open iamoverit opened this issue 1 year ago • 4 comments

Refactor message handling and add ReplyMetaData extraction

  • Added reply_metadata function to extract ReplyMetaData from a Message.
  • Updated type definitions in kick/types/message.py to ensure consistency.
  • Fixed import issues by correctly importing the MessagePayload type.
  • Fixed ws app client id now it looks like wss://ws-us2.pusher.com/app/32cbd69e4b950bf97679?protocol=7&client=js&version=8.4.0-rc2&flash=false …V2 API
  • Also send message now using v2 api and added reply functionality to chat
  • Fix for "App\Events\ChatMessageEvent" probably currently it is not using "livestream" key any more

This commit ensures that reply messages can be properly handled and their metadata extracted for further processing.

iamoverit avatar Feb 20 '25 12:02 iamoverit

Hello, and thank you for this!

Is there a specific reason you opted for Chatroom.reply, with Message.reply_metadata instead of just implementing Message.reply?

If not, I'd like you to move to using Message.reply instead of Chatroom.reply, with Message.reply_metadata.

cibere avatar Feb 20 '25 13:02 cibere

Hello, and thank you for this!

Is there a specific reason you opted for Chatroom.reply, with Message.reply_metadata instead of just implementing Message.reply?

If not, I'd like you to move to using Message.reply instead of Chatroom.reply, with Message.reply_metadata.

in my opinion Message was just a representation class of the message from ws and Chatroom otherwise was a class who handle api communication, thats why i choose Chatroom but if you disagree i could move it to Message

iamoverit avatar Feb 20 '25 14:02 iamoverit

in my opinion Message was just a representation class of the message from ws and Chatroom otherwise was a class who handle api communication, thats why i choose Chatroom but if you disagree i could move it to Message

Message is a model from kick's API, however it inherits from HTTPDataclass, so you can access the http client via Message.http. Message.http exists because of Message.author.to_user

cibere avatar Feb 20 '25 15:02 cibere

in my opinion Message was just a representation class of the message from ws and Chatroom otherwise was a class who handle api communication, thats why i choose Chatroom but if you disagree i could move it to Message

Message is a model from kick's API, however it inherits from HTTPDataclass, so you can access the http client via Message.http. *Message.http exists because of Message.author.to_user

agree i'll come later with fixes

iamoverit avatar Feb 20 '25 15:02 iamoverit