Events¶
- class pomice.events.PomiceEvent[source]¶
Bases:
ABCThe base class for all events dispatched by a node. Every event must be formatted within your bot’s code as a listener. i.e: If you want to listen for when a track starts, the event would be:
`py @bot.listen async def on_pomice_track_start(self, event): `- handler_args: Tuple¶
- name = 'event'¶
- class pomice.events.TrackEndEvent(data: dict, player: Player)[source]¶
Bases:
PomiceEventFired when a track has successfully ended. Returns the player associated with the event along with the pomice.Track object and reason.
- handler_args: Tuple¶
- name = 'track_end'¶
- reason: str¶
- class pomice.events.TrackExceptionEvent(data: dict, player: Player)[source]¶
Bases:
PomiceEventFired when a track error has occured. Returns the player associated with the event along with the error code and exception.
- exception: str¶
- handler_args: Tuple¶
- name = 'track_exception'¶
- class pomice.events.TrackStartEvent(data: dict, player: Player)[source]¶
Bases:
PomiceEventFired when a track has successfully started. Returns the player associated with the event and the pomice.Track object.
- handler_args: Tuple¶
- name = 'track_start'¶
- class pomice.events.TrackStuckEvent(data: dict, player: Player)[source]¶
Bases:
PomiceEventFired when a track is stuck and cannot be played. Returns the player associated with the event along with the pomice.Track object to be further parsed by the end user.
- handler_args: Tuple¶
- name = 'track_stuck'¶
- threshold: float¶
- class pomice.events.WebSocketClosedEvent(data: dict, _: Any)[source]¶
Bases:
PomiceEventFired when a websocket connection to a node has been closed. Returns the reason and the error code.
- handler_args: Tuple¶
- name = 'websocket_closed'¶
- payload: WebSocketClosedPayload¶