Skip to content

Commit 29f0ce9

Browse files
committed
docs: clarify migration instructions
1 parent e74f5ae commit 29f0ce9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/getting-started/migrating.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _Migrating Guide:
22

3-
Migrating
4-
#########
3+
Migrating from Twitchio 2.x to 3.x
4+
##################################
55

66
.. warning::
77

@@ -81,8 +81,10 @@ Running a :class:`~twitchio.Client` or :class:`~twitchio.ext.commands.Bot` hasn'
8181
some major differences that should be taken into consideration:
8282

8383
- IRC was removed from the core of TwitchIO. This means subscribing to chat and other chat related events is now done via ``EventSub``. This results in the removal of constructor parameters ``initial_channels``, ``heartbeat`` and ``retain_cache``.
84-
- TwitchIO 3 uses a much more modern asyncio design which results in the removal of any ``loop`` semantics including the constructor parameter ``loop``. Internally the start and close of the bot has also been changed, resulting in a more user-friendly interface.
84+
- Instead of listing the usernames of the channels you want the bot to join, you let the web adapter listen for when a user wants to give you ``channel:bot`` permissions; then you subscribe to messages for that channel with ``subscribe_webhook()`` or ``subscribe_websockes()``. For example: ``subscribe_websocket(payload=eventsub.ChatMessageSubscription(broadcaster_user_id=..., user_id=...)``.
85+
- If you *really* need to send messages to a channel that hasn't explicitly granted you the ``channel:bot`` scope, you can use the ``token_for`` option to override the token twitchio would normally choose. But note that you'll only be able to connect up to 100 channels simuntaniously; a limit that wouldn't apply when using ``channel:bot`` instead. More info on Twitch-imposed rate limits here: https://dev.twitch.tv/docs/chat/#rate-limits
8586
- ``App Tokens`` are generated automatically on start-up and there is rarely a need to provide one. However the option still exists via :meth:`~twitchio.Client.start` and :meth:`~twitchio.Client.login`.
87+
- TwitchIO 3 uses a much more modern asyncio design which results in the removal of any ``loop`` semantics including the constructor parameter ``loop``. Internally the start and close of the bot has also been changed, resulting in a more user-friendly interface.
8688
- Implemented ``__aenter__`` and ``__aexit__`` which allows them to be used in a Async Context Manager for easier management of close down and cleanup. These changes along with some async internals have also been reflected in :meth:`~twitchio.Client.run`.
8789

8890
You can also :meth:`~twitchio.Client.login` the :class:`~twitchio.Client` without running a continuous asyncio event loop, E.g.

0 commit comments

Comments
 (0)