Skip to content

Commit

Permalink
docs: add migration docs for 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
i0bs committed Feb 25, 2022
1 parent 7d379f4 commit 210573d
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,32 @@ will need it appended as a key-word argument. The example below shows this chang
# 4.0.2
...
channel = interactions.Channel(**data, _state=bot.http)
channel = interactions.Channel(**data, _client=bot.http)
This change was added in favor for being able to use endpoints in an abstracted state.

4.0.2 → 4.1.0
~~~~~~~~~~~~~~~

``4.1.0`` introduces numerous breaking changes that affect the bot developers' ability to work with mainly modifying
the way our Gateway processes information, as well as supplying a ``reason`` argument to ``HTTPClient``-based methods.

In this version, you are no longer required to give a ``reason`` for every HTTP request. You can instead send it as an optional,
which will work to keep any existing modifications of our codebase from breaking.

Additionally, modifying the way information is dispatched from the Gateway must be done like this now:

.. code-block:: python
class ExtendedWebSocketClient(WebSocketClient):
def _dispatch_event(self, event: str, data: dict):
super()._dispatch_event(event, data)
if event != "TYPING_START" and event == "INTERACTION_CREATE":
... # run your special interaction dispatch rules here.
We recommend that working in correspondance with this, you should be making use of our ``interactions.ext`` SDK framework.

A slight, yet another breaking change we made was dundering numerous attributes in our internal models.
You will now need to refer to the client's HTTP object as ``_http`` instead of ``http``. In order to view
the full list of these, we highly encourage you to view the documentation readily available.

0 comments on commit 210573d

Please sign in to comment.