Skip to content

Commit 6008275

Browse files
authored
Merge pull request #332 from BobDotCom/BobDotCom-patch-1
2 parents cf07dae + 9d6791e commit 6008275

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

discord/flags.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,12 @@ def none(cls: Type[Intents]) -> Intents:
551551
@classmethod
552552
def default(cls: Type[Intents]) -> Intents:
553553
"""A factory method that creates a :class:`Intents` with everything enabled
554-
except :attr:`presences` and :attr:`members`.
554+
except :attr:`presences`, :attr:`members`, and :attr:`guild_messages`.
555555
"""
556556
self = cls.all()
557557
self.presences = False
558558
self.members = False
559+
self.guild_messages = False
559560
return self
560561

561562
@flag_value
@@ -772,6 +773,13 @@ def messages(self):
772773
- :func:`on_reaction_add` (both guilds and DMs)
773774
- :func:`on_reaction_remove` (both guilds and DMs)
774775
- :func:`on_reaction_clear` (both guilds and DMs)
776+
777+
Since this includes :attr:`guild_messages`, this intent is privileged. For more information go to the :ref:`message content intent documentation <need_message_content_intent>`.
778+
779+
.. note::
780+
781+
Currently, this requires opting in explicitly via the developer portal as well.
782+
Bots in over 100 guilds will need to apply to Discord for verification.
775783
"""
776784
return (1 << 9) | (1 << 12)
777785

@@ -799,6 +807,13 @@ def guild_messages(self):
799807
- :func:`on_reaction_add` (only for guilds)
800808
- :func:`on_reaction_remove` (only for guilds)
801809
- :func:`on_reaction_clear` (only for guilds)
810+
811+
For more information go to the :ref:`message content intent documentation <need_message_content_intent>`.
812+
813+
.. note::
814+
815+
Currently, this requires opting in explicitly via the developer portal as well.
816+
Bots in over 100 guilds will need to apply to Discord for verification.
802817
"""
803818
return 1 << 9
804819

docs/intents.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ In version 1.5 comes the introduction of :class:`Intents`. This is a radical cha
1111

1212
These intents are passed to the constructor of :class:`Client` or its subclasses (:class:`AutoShardedClient`, :class:`~.AutoShardedBot`, :class:`~.Bot`) with the ``intents`` argument.
1313

14-
If intents are not passed, then the library defaults to every intent being enabled except the privileged intents, currently :attr:`Intents.members` and :attr:`Intents.presences`.
14+
If intents are not passed, then the library defaults to every intent being enabled except the privileged intents, currently :attr:`Intents.members`, :attr:`Intents.presences`, and :attr:`Intents.guild_messages`.
1515

1616
What intents are needed?
1717
--------------------------
@@ -34,7 +34,7 @@ For example, if you want a bot that functions without spammy events like presenc
3434
# from discord.ext import commands
3535
# bot = commands.Bot(command_prefix='!', intents=intents)
3636
37-
Note that this doesn't enable :attr:`Intents.members` since it's a privileged intent.
37+
Note that this doesn't enable :attr:`Intents.members` or :attr:`Intents.guild_messages` since they are privileged intents.
3838

3939
Another example showing a bot that only deals with messages and guild information:
4040

@@ -76,7 +76,7 @@ A privileged intent is one that requires you to go to the developer portal and m
7676

7777
.. warning::
7878

79-
Enabling privileged intents when your bot is in over 100 guilds requires going through `bot verification <https://support.discord.com/hc/en-us/articles/360040720412>`_. If your bot is already verified and you would like to enable a privileged intent you must go through `Discord support <https://dis.gd/contact>`_ and talk to them about it.
79+
Enabling privileged intents when your bot is in over 100 guilds requires going through `bot verification <https://support.discord.com/hc/en-us/articles/360040720412>`_.
8080

8181
.. note::
8282

@@ -107,6 +107,19 @@ Member Intent
107107
- Whether you want to request the guild member list through :meth:`Guild.chunk` or :meth:`Guild.fetch_members`.
108108
- Whether you want high accuracy member cache under :attr:`Guild.members`.
109109

110+
.. _need_message_content_intent:
111+
112+
Message Content Intent
113+
++++++++++++++++
114+
115+
- Whether you have a message based command system using ext.commands
116+
- Whether you use the :func:`on_message` event for anything, such as auto-moderation.
117+
- Whether you track message edits or deletions using :func:`on_message_edit`, :func:`on_message_delete`, :func:`on_raw_message_edit`, :func:`on_raw_message_delete`.
118+
- Whether you use any reaction related events, such as :func:`on_reaction_add`, :func:`on_reaction_remove`, and :func:`on_reaction_clear`
119+
120+
.. note::
121+
This only applies to :attr:`Intents.guild_messages`, not :attr:`Intents.dm_messages`. The bot can still receive message contents in DMs, when mentioned in guild messages, and for its own guild messages.
122+
110123
.. _intents_member_cache:
111124

112125
Member Cache

0 commit comments

Comments
 (0)