Skip to content

Commit

Permalink
fead(node): add on_node_stats (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
ooliver1 committed May 31, 2023
1 parent 7fca1dc commit af9fba5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/api/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,12 @@ Callbacks

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

.. function:: on_node_stats()

Called when Lavalink sends node statistics.

.. versionadded:: 2.5

:param node: The node that sent the statistics.
:type node: :class:`Node`
1 change: 1 addition & 0 deletions mafic/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ async def _handle_msg(self, data: IncomingMessage) -> None:
player.update_state(data["state"])
elif data["op"] == "stats":
self._stats = NodeStats(data)
self.client.dispatch("node_stats", self)
elif data["op"] == "event":
await self._handle_event(data)
elif data["op"] == "ready":
Expand Down

0 comments on commit af9fba5

Please sign in to comment.