-
Notifications
You must be signed in to change notification settings - Fork 11
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
| 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
| 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
| 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
| 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