Skip to content

Commit

Permalink
docs: add events
Browse files Browse the repository at this point in the history
  • Loading branch information
ooliver1 committed Feb 4, 2023
1 parent d4a837f commit 3bc39f4
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
65 changes: 65 additions & 0 deletions docs/api/events.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.. currentmodule:: mafic

Events
======

Classes
-------

.. attributetable:: WebSocketClosedEvent

.. autoclass:: WebSocketClosedEvent

.. attributetable:: TrackStartEvent

.. autoclass:: TrackStartEvent

.. attributetable:: TrackEndEvent

.. autoclass:: TrackEndEvent

.. attributetable:: TrackExceptionEvent

.. autoclass:: TrackExceptionEvent

.. attributetable:: TrackStuckEvent

.. autoclass:: TrackStuckEvent

Callbacks
---------

.. function:: on_websocket_closed()

Called when the websocket connection from Lavalink is closed to Discord.

:param event: The event that was dispatched.
:type event: :class:`WebSocketClosedEvent`

.. function:: on_track_start()

Called when a track starts playing.

:param event: The event that was dispatched.
:type event: :class:`TrackStartEvent`

.. function:: on_track_end()

Called when a track ends.

:param event: The event that was dispatched.
:type event: :class:`TrackEndEvent`

.. function:: on_track_exception()

Called when a track throws an exception.

:param event: The event that was dispatched.
:type event: :class:`TrackExceptionEvent`

.. function:: on_track_stuck()

Called when a track gets stuck.

:param event: The event that was dispatched.
:type event: :class:`TrackStuckEvent`
1 change: 1 addition & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The full API reference for Mafic:
stats
ip
player
events
track-and-playlist
filters
errors-and-warnings
Expand Down

0 comments on commit 3bc39f4

Please sign in to comment.