Skip to content

Commit 210573d

Browse files
committed
docs: add migration docs for 4.1
1 parent 7d379f4 commit 210573d

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

docs/migration.rst

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,32 @@ will need it appended as a key-word argument. The example below shows this chang
2020
2121
# 4.0.2
2222
...
23-
channel = interactions.Channel(**data, _state=bot.http)
23+
channel = interactions.Channel(**data, _client=bot.http)
2424
2525
This change was added in favor for being able to use endpoints in an abstracted state.
26+
27+
4.0.2 → 4.1.0
28+
~~~~~~~~~~~~~~~
29+
30+
``4.1.0`` introduces numerous breaking changes that affect the bot developers' ability to work with mainly modifying
31+
the way our Gateway processes information, as well as supplying a ``reason`` argument to ``HTTPClient``-based methods.
32+
33+
In this version, you are no longer required to give a ``reason`` for every HTTP request. You can instead send it as an optional,
34+
which will work to keep any existing modifications of our codebase from breaking.
35+
36+
Additionally, modifying the way information is dispatched from the Gateway must be done like this now:
37+
38+
.. code-block:: python
39+
40+
class ExtendedWebSocketClient(WebSocketClient):
41+
def _dispatch_event(self, event: str, data: dict):
42+
super()._dispatch_event(event, data)
43+
44+
if event != "TYPING_START" and event == "INTERACTION_CREATE":
45+
... # run your special interaction dispatch rules here.
46+
47+
We recommend that working in correspondance with this, you should be making use of our ``interactions.ext`` SDK framework.
48+
49+
A slight, yet another breaking change we made was dundering numerous attributes in our internal models.
50+
You will now need to refer to the client's HTTP object as ``_http`` instead of ``http``. In order to view
51+
the full list of these, we highly encourage you to view the documentation readily available.

0 commit comments

Comments
 (0)