From 3be0b2ceeedcce25c72c0052ee0d324d52f90da9 Mon Sep 17 00:00:00 2001 From: JustaSqu1d Date: Sat, 20 Aug 2022 09:30:11 -0700 Subject: [PATCH 1/5] feat(docs): Intents in Migration Guide --- docs/migrating_to_v2.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/migrating_to_v2.rst b/docs/migrating_to_v2.rst index 0b2d446101..be435d9a7b 100644 --- a/docs/migrating_to_v2.rst +++ b/docs/migrating_to_v2.rst @@ -121,6 +121,19 @@ Webhook Changes .. _migrating_2_0_thread_introduced: +Intents Required +---------------- + +:class:`Client` and its subclasses default the ``intents`` argument to be :meth:`Intents.none()`, instead of :meth:`Intents.default()`. +Therefore, you should pass :class:`Intents` to the constructor if you want to use intents. +See :doc:`intents`. + + +.. code-block:: python + + client = discord.Client(intents=discord.Intents.all()) + client.run(token) + Threads Introduced ------------------ From 7976b99097eb70b4cec628a933971e9cc8eff143 Mon Sep 17 00:00:00 2001 From: JustaSqu1d Date: Sat, 20 Aug 2022 09:38:06 -0700 Subject: [PATCH 2/5] fix: misplaced section --- docs/migrating_to_v2.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/migrating_to_v2.rst b/docs/migrating_to_v2.rst index be435d9a7b..812b8a68fc 100644 --- a/docs/migrating_to_v2.rst +++ b/docs/migrating_to_v2.rst @@ -119,7 +119,7 @@ Webhook Changes await webhook.send("Hello from Pycord 2.0") -.. _migrating_2_0_thread_introduced: +.. _migrating_2_0_intents_required: Intents Required ---------------- @@ -134,6 +134,9 @@ See :doc:`intents`. client = discord.Client(intents=discord.Intents.all()) client.run(token) + +.. _migrating_2_0_thread_introduced: + Threads Introduced ------------------ From 0368aae1d84f173efc8fdb19929dd4dc354e2989 Mon Sep 17 00:00:00 2001 From: JustaSqu1d Date: Sun, 21 Aug 2022 09:13:57 -0700 Subject: [PATCH 3/5] fix: typos and spelling errors --- docs/migrating_to_v2.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/migrating_to_v2.rst b/docs/migrating_to_v2.rst index 812b8a68fc..0a44d3dfdc 100644 --- a/docs/migrating_to_v2.rst +++ b/docs/migrating_to_v2.rst @@ -5,7 +5,7 @@ Migrating to v2.0 ================= -v2.0 introduced new Discord features and depcreated some old ones. +v2.0 introduced new Discord features and deprecated some old ones. Part of the redesign involves making application commands and components. These changes include a new :class:`Bot` class, :class:`ui.View`, and a new :class:`ApplicationContext` class. If you're interested in creating them, please check out our :resource:`guide `. @@ -95,7 +95,7 @@ Asset-related attributes that previously returned hash strings (e.g. :attr:`User Webhook Changes ~~~~~~~~~~~~~~~ -- :class:`Webhook` and :class:`WebhookMessage` are now always asynchronouns. For synchronouns use (``requests``), use :class:`SyncWebhook` and :class:`SyncWebhookMessage`. +- :class:`Webhook` and :class:`WebhookMessage` are now always asynchronous. For synchronous use (``requests``), use :class:`SyncWebhook` and :class:`SyncWebhookMessage`. - ``WebhookAdapter``, ``AsyncWebhookAdapter``, and ``RequestsWebhookAdapter`` are removed, since they are unnecessary. - ``adapter`` arguments of :meth:`Webhook.partial` and :meth:`Webhook.from_url` are removed. Sessions are now passed directly to ``partial`` / ``from_url``. @@ -237,7 +237,7 @@ Many method arguments now reject ``None`` or return ``None``. - The following :class:`.ext.commands.Context` attributes can now be ``None``: ``prefix``, ``command``, ``invoked_with``, ``invoked_subcommand``. - :attr:`ext.commands.Command.help` can now be ``None``. -.. _migrating_2_0_miscelaneous_changes: +.. _migrating_2_0_miscellaneous_changes: Miscellaneous Changes --------------------- From 800d48d079e44b309e45c76f3fb8332ab9a70a52 Mon Sep 17 00:00:00 2001 From: JustaSqu1d Date: Sun, 21 Aug 2022 09:25:33 -0700 Subject: [PATCH 4/5] Update migrating_to_v2.rst --- docs/migrating_to_v2.rst | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/docs/migrating_to_v2.rst b/docs/migrating_to_v2.rst index 0a44d3dfdc..3ef7e5d69f 100644 --- a/docs/migrating_to_v2.rst +++ b/docs/migrating_to_v2.rst @@ -119,20 +119,15 @@ Webhook Changes await webhook.send("Hello from Pycord 2.0") -.. _migrating_2_0_intents_required: +.. _migrating_2_0_intents_changes: -Intents Required ----------------- - -:class:`Client` and its subclasses default the ``intents`` argument to be :meth:`Intents.none()`, instead of :meth:`Intents.default()`. -Therefore, you should pass :class:`Intents` to the constructor if you want to use intents. -See :doc:`intents`. - - -.. code-block:: python +Intents Changes +--------------- - client = discord.Client(intents=discord.Intents.all()) - client.run(token) +:attr:`Intents.message_content` is now a privileged intent. Disabling it causes :attr:`Message.content`, +:attr:`Message.embeds`, :attr:`Message.components`, and :attr:`Message.attachments` to be ``None``, directly causing +:class:`ext.commands.Commands` to not run. +See `here `_ for more information. .. _migrating_2_0_thread_introduced: From de1a3d81b7f514cffe2217d4e4398c04c3297540 Mon Sep 17 00:00:00 2001 From: JustaSqu1d Date: Sun, 21 Aug 2022 13:01:37 -0700 Subject: [PATCH 5/5] Update docs/migrating_to_v2.rst Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> --- docs/migrating_to_v2.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/migrating_to_v2.rst b/docs/migrating_to_v2.rst index 3ef7e5d69f..05ab18ace6 100644 --- a/docs/migrating_to_v2.rst +++ b/docs/migrating_to_v2.rst @@ -125,8 +125,8 @@ Intents Changes --------------- :attr:`Intents.message_content` is now a privileged intent. Disabling it causes :attr:`Message.content`, -:attr:`Message.embeds`, :attr:`Message.components`, and :attr:`Message.attachments` to be ``None``, directly causing -:class:`ext.commands.Commands` to not run. +:attr:`Message.embeds`, :attr:`Message.components`, and :attr:`Message.attachments` to be empty (an empty string +or an empty array), directly causing :class:`ext.commands.Command`s to not run. See `here `_ for more information.