Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

iamoverit
Copy link

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.

@cibere
Copy link
Owner

cibere commented Feb 20, 2025

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.

@iamoverit
Copy link
Author

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

@cibere
Copy link
Owner

cibere commented Feb 20, 2025

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

@iamoverit
Copy link
Author

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

Copy link
Owner

@cibere cibere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for all of the work that you've put into this PR.

This will have to stay in limbo for a couple of days until I get a chance to test the code and properly review it from a code editor. When that happens, I'm perfectly fine with fixing the rest of the nitpicky things myself, as there have been a lot of requested changes with this PR so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants