From 210573d5f880bd06d640c71d352202a7b07db5c9 Mon Sep 17 00:00:00 2001 From: James Walston Date: Thu, 24 Feb 2022 20:54:04 -0500 Subject: [PATCH] docs: add migration docs for 4.1 --- docs/migration.rst | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/migration.rst b/docs/migration.rst index 8408a578a..fd5a7a458 100644 --- a/docs/migration.rst +++ b/docs/migration.rst @@ -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.