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
29 changes: 28 additions & 1 deletion docs/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,34 @@ portal and add the intent to your current intents when connecting:
4.1.0 → 4.3.0
~~~~~~~~~~~~~~~

A new big change in this release is the implementation of the ``get`` utility method.
A new feature was added; an event called ``on_start``.
Unlike ``on_ready``, this event is only dispatched when the bot is first started.

Instead of using the ``on_ready`` event and a check to only run code once:

.. code-block:: python

_ready: bool = False
bot = interactions.Client(...)

@bot.event
async def on_ready():
global _ready
if not _ready:
... # do stuff
_ready = True

You can now utilize the ``on_start`` event to achieve the same goal:

.. code-block:: python

bot = interactions.Client(...)

@bot.event
async def on_start():
... # do stuff

Another big change in this release is the implementation of the ``get`` utility method.
It allows you to no longer use ``**await bot._http...``.

You can get more information by reading the `get-documentation`_.
Expand Down
1 change: 1 addition & 0 deletions interactions/api/gateway/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class WebSocketClient:
:ivar Optional[ClientPresence] __presence: The presence used in connection.
:ivar Event ready: The ready state of the client as an ``asyncio.Event``.
:ivar Task __task: The closing task for ending connections.
:ivar bool __started: Whether the client has started.
:ivar Optional[str] session_id: The ID of the ongoing session.
:ivar Optional[int] sequence: The sequence identifier of the ongoing session.
:ivar float _last_send: The latest time of the last send_packet function call since connection creation, in seconds.
Expand Down