-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: main
Are you sure you want to change the base?
Conversation
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: |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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` |
There was a problem hiding this comment.
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
kick/livestream.py
Outdated
self._data = data | ||
self.http = http | ||
|
||
self.id: int = data["id"] |
There was a problem hiding this comment.
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
kick/livestream.py
Outdated
self.http = http | ||
|
||
self.id: int = data["id"] | ||
self.channel_id: int = data["channel"]["id"] |
There was a problem hiding this comment.
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
kick/livestream.py
Outdated
@@ -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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This should be in PastalCase
- 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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Also, please run black on this |
lmao