Events#
Classes#
- class mafic.WebSocketClosedEvent(*, payload, player)#
Bases:
Generic
[PlayerT
]Represents an event when the connection to Discord is lost.
- class mafic.TrackStartEvent(*, track, player)#
Bases:
Generic
[PlayerT
]Represents an event when a track starts playing.
- class mafic.TrackEndEvent(*, track, payload, player)#
Bases:
Generic
[PlayerT
]Represents an event when a track ends.
- reason#
The reason why the track ended.
- Type:
EndReason
- class mafic.TrackExceptionEvent(*, track, payload, player)#
Bases:
Generic
[PlayerT
]Represents an event when an exception occurs while playing a track.
Callbacks#
- mafic.on_websocket_closed()#
Called when the websocket connection from Lavalink is closed to Discord.
- Parameters:
event (
WebSocketClosedEvent
) – The event that was dispatched.
- mafic.on_track_start()#
Called when a track starts playing.
- Parameters:
event (
TrackStartEvent
) – The event that was dispatched.
- mafic.on_track_end()#
Called when a track ends.
- Parameters:
event (
TrackEndEvent
) – The event that was dispatched.
- mafic.on_track_exception()#
Called when a track throws an exception.
- Parameters:
event (
TrackExceptionEvent
) – The event that was dispatched.
- mafic.on_track_stuck()#
Called when a track gets stuck.
- Parameters:
event (
TrackStuckEvent
) – The event that was dispatched.
- mafic.on_node_stats()#
Called when Lavalink sends node statistics.
New in version 2.5.
- Parameters:
node (
Node
) – The node that sent the statistics.
- mafic.on_node_ready()#
Called when Lavalink node is ready.
- Parameters:
node (
Node
) – The node that was ready.
Called when Lavalink node becomes unavailable.
- Parameters:
node (
Node
) – The node that became unavailable.