Events

class pomice.events.PomiceEvent[source]

Bases: ABC

The 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): `

dispatch(bot: Client) None[source]
handler_args: Tuple
name = 'event'
class pomice.events.TrackEndEvent(data: dict, player: Player)[source]

Bases: PomiceEvent

Fired 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'
player: Player
reason: str
track: Track | None
class pomice.events.TrackExceptionEvent(data: dict, player: Player)[source]

Bases: PomiceEvent

Fired 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'
player: Player
track: Track | None
class pomice.events.TrackStartEvent(data: dict, player: Player)[source]

Bases: PomiceEvent

Fired when a track has successfully started. Returns the player associated with the event and the pomice.Track object.

handler_args: Tuple
name = 'track_start'
player: Player
track: Track | None
class pomice.events.TrackStuckEvent(data: dict, player: Player)[source]

Bases: PomiceEvent

Fired 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'
player: Player
threshold: float
track: Track | None
class pomice.events.WebSocketClosedEvent(data: dict, _: Any)[source]

Bases: PomiceEvent

Fired 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
class pomice.events.WebSocketClosedPayload(data: dict)[source]

Bases: object

by_remote: bool
code: int
guild: Guild | None
reason: str
class pomice.events.WebSocketOpenEvent(data: dict, _: Any)[source]

Bases: PomiceEvent

Fired when a websocket connection to a node has been initiated. Returns the target and the session SSRC.

handler_args: Tuple
name = 'websocket_open'
ssrc: int
target: str