Skip to content

Commit 76218e3

Browse files
committed
2 parents 7cdd8d7 + c4846af commit 76218e3

File tree

7 files changed

+163
-47
lines changed

7 files changed

+163
-47
lines changed

interactions/api/gateway.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
class Heartbeat(Thread):
2727
"""
2828
A class representing a consistent heartbeat connection with the gateway.
29+
2930
:ivar WebSocket ws: The WebSocket class to infer on.
3031
:ivar Union[int, float] interval: The heartbeat interval determined by the gateway.
3132
:ivar Event event: The multi-threading event.
@@ -72,6 +73,7 @@ def stop(self) -> None:
7273
class WebSocket:
7374
"""
7475
A class representing a websocket connection with the gateway.
76+
7577
:ivar Intents intents: An instance of :class:`interactions.api.models.Intents`.
7678
:ivar AbstractEventLoop loop: The coroutine event loop established on.
7779
:ivar Request req: An instance of :class:`interactions.api.http.Request`.
@@ -143,6 +145,7 @@ async def connect(
143145
) -> None:
144146
"""
145147
Establishes a connection to the gateway.
148+
146149
:param token: The token to use for identifying.
147150
:type token: str
148151
:param shard?: The shard ID to identify under.
@@ -172,6 +175,7 @@ async def handle_connection(
172175
) -> None:
173176
"""
174177
Handles the connection to the gateway.
178+
175179
:param stream: The data stream from the gateway.
176180
:type stream: dict
177181
:param shard?: The shard ID to identify under.
@@ -230,6 +234,7 @@ async def handle_connection(
230234
def handle_dispatch(self, event: str, data: dict) -> None:
231235
"""
232236
Handles the dispatched event data from a gateway event.
237+
233238
:param event: The name of the event.
234239
:type event: str
235240
:param data: The data of the event.
@@ -344,6 +349,7 @@ def contextualize(self, data: dict) -> object:
344349
"""
345350
Takes raw data given back from the gateway
346351
and gives "context" based off of what it is.
352+
347353
:param data: The data from the gateway.
348354
:type data: dict
349355
:return: The context object.
@@ -375,6 +381,7 @@ async def identify(
375381
) -> None:
376382
"""
377383
Sends an ``IDENTIFY`` packet to the gateway.
384+
378385
:param shard?: The shard ID to identify under.
379386
:type shard: Optional[int]
380387
:param presence?: The presence to change the bot to on identify.

0 commit comments

Comments
 (0)