Require passing intents to Client and its subclasses

This commit is contained in:
Rapptz
2022-04-05 22:12:55 -04:00
parent 7770972041
commit 76cc2c2272
4 changed files with 34 additions and 6 deletions

View File

@ -115,6 +115,29 @@ With this change, constructor of :class:`Client` no longer accepts ``connector``
In parallel with this change, changes were made to loading and unloading of commands extension extensions and cogs,
see :ref:`migrating_2_0_commands_extension_cog_async` for more information.
Intents Are Now Required
--------------------------
In earlier versions, the ``intents`` keyword argument was optional and defaulted to :meth:`Intents.default`. In order to better educate users on their intents and to also make it more explicit, this parameter is now required to pass in.
For example:
.. code-block:: python3
# before
client = discord.Client()
# after
intents = discord.Intents.default()
client = discord.Client(intents=intents)
This change applies to **all** subclasses of :class:`Client`.
- :class:`AutoShardedClient`
- :class:`~discord.ext.commands.Bot`
- :class:`~discord.ext.commands.AutoShardedBot`
Abstract Base Classes Changes
-------------------------------