Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ Event: ``raw_socket_create``
This event fires on any event sent by Discord, including ``Typing Start`` and ``Voice State Update``.
``Hello``, ``Resumed``, ``Reconnect`` and ``Invalid Session`` still will not be dispatched.

The function handling the event should take in one argument, the type of this argument is a ``dict``.
A function handling an event should take two arguments,
the first argument is the name of the event, the second is the data of that event with type ``dict``.

The value of the argument will be the *raw* data sent from Discord, so it is not recommended to use that event
The value of the second argument will be the *raw* data sent from Discord, so it is not recommended to use that event
as long as you don't absolutely need it.


Expand Down
2 changes: 1 addition & 1 deletion interactions/api/gateway/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def _dispatch_event(self, event: str, data: dict) -> None:
:param data: The data for the event.
:type data: dict
"""
self._dispatch.dispatch("raw_socket_create", data)
self._dispatch.dispatch("raw_socket_create", event, data)
path: str = "interactions"
path += ".models" if event == "INTERACTION_CREATE" else ".api.models"
if event == "INTERACTION_CREATE":
Expand Down