Skip to content
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

no idea how but it worked added event on_livestream_end #15

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

Conversation

Zenith727
Copy link
Contributor

lmao

kick/client.py Outdated
@@ -329,7 +329,18 @@ async def on_livestream_start(self, livestream: PartialLivestream) -> None:
livestream: `PartialLivestream`
The livestream
"""
async def on_livestream_end(self, StreamEnd: Endstream) -> None:
Copy link
Owner

Choose a reason for hiding this comment

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

Parameters/variables should be in snake_case

kick/client.py Outdated
"""
|coro|

on_livestream_start is an event that can be overriden with the `Client.event` decorator or with a subclass.
Copy link
Owner

Choose a reason for hiding this comment

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

you forgot to change the description when copy pasting the docstring

kick/client.py Outdated

Parameters
-----------
livestream: `PartialLivestream`
Copy link
Owner

Choose a reason for hiding this comment

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

These are the wrong parameters, appears you forgot to change those too when copy pasting the docstring

self._data = data
self.http = http

self.id: int = data["id"]
Copy link
Owner

Choose a reason for hiding this comment

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

this should be a property

self.http = http

self.id: int = data["id"]
self.channel_id: int = data["channel"]["id"]
Copy link
Owner

Choose a reason for hiding this comment

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

this should be a property

@@ -229,3 +229,30 @@ def __eq__(self, other: object) -> bool:

def __repr__(self) -> str:
return f"<Livestream id={self.id} title={self.title} streamer={self.slug}>"

class Endstream:
Copy link
Owner

Choose a reason for hiding this comment

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

  1. This should be in PastalCase
  2. Throughout the rest of the library, a livestream is referred to as a "livestream" and not a "stream", this class should conform to the same standard. Ex: "LivestreamEnd"

kick/types/ws.py Outdated

class StreamEndPayload(TypedDict):
id: int
channel_id: int
Copy link
Owner

Choose a reason for hiding this comment

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

This is different from how your "Endstream" class uses it

kick/ws.py Outdated
@@ -46,7 +46,9 @@ async def poll_event(self) -> None:
user._data["followers_count"] -= 1

self.http.client.dispatch(event, user)

case "App\\Events\\StopStreamBroadcast":
Endstreams = Endstream(data=data["livestream"], http=self.http)
Copy link
Owner

Choose a reason for hiding this comment

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

variables should be in camel_case

@@ -31,10 +31,10 @@ async def poll_event(self) -> None:

match raw_data["event"]:
case "App\\Events\\ChatMessageEvent":
msg = Message(data=data["livestream"], http=self.http)
msg = Message(data=data, http=self.http)
Copy link
Owner

Choose a reason for hiding this comment

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

This reverts changes from your lasts PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that chatmsg not livestream hmm

@cibere
Copy link
Owner

cibere commented Jan 23, 2024

Also, please run black on this

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