Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions discord/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,12 @@ def none(cls: Type[Intents]) -> Intents:
@classmethod
def default(cls: Type[Intents]) -> Intents:
"""A factory method that creates a :class:`Intents` with everything enabled
except :attr:`presences` and :attr:`members`.
except :attr:`presences`, :attr:`members`, and :attr:`message_content`.
"""
self = cls.all()
self.presences = False
self.members = False
self.message_content = False
return self

@flag_value
Expand Down Expand Up @@ -749,9 +750,7 @@ def messages(self):

.. note::

As of April 2022 requires opting in explicitly via the developer portal to receive the actual content of the guild messages.
Bots in over 100 guilds will need to apply to Discord for verification.
See https://support-dev.discord.com/hc/en-us/articles/4404772028055-Message-Content-Access-Deprecation-for-Verified-Bots for more information.
:attr:`message_content` is required to receive the actual content of guild messages.
"""
return (1 << 9) | (1 << 12)

Expand Down Expand Up @@ -780,20 +779,14 @@ def guild_messages(self):
- :func:`on_reaction_remove` (only for guilds)
- :func:`on_reaction_clear` (only for guilds)

Without the :attr:`ApplicationFlags.gateway_message_content` intent enabled, the following fields are either an empty string or empty array:
Without the :attr:`message_content` intent enabled, the following fields are either an empty string or empty array:

- :attr:`Message.content`
- :attr:`Message.embeds`
- :attr:`Message.attachments`
- :attr:`Message.components`

For more information go to the :ref:`message content intent documentation <need_message_content_intent>`.

.. note::

As of April 2022 requires opting in explicitly via the developer portal to receive the actual content of the messages.
Bots in over 100 guilds will need to apply to Discord for verification.
See https://support-dev.discord.com/hc/en-us/articles/4404772028055-Message-Content-Access-Deprecation-for-Verified-Bots for more information.
"""
return 1 << 9

Expand Down Expand Up @@ -929,6 +922,31 @@ def dm_typing(self):
"""
return 1 << 14

@flag_value
def message_content(self):
""":class:`bool`: Whether the bot will receive message content in guild messages.

This corresponds to the following attributes:

- :attr:`Message.content`
- :attr:`Message.embeds`
- :attr:`Message.attachments`
- :attr:`Message.components`

These attributes will still be available for messages received from interactions,
the bot's own messages, messages the bot was mentioned in, and DMs.

.. versionadded:: 2.0

.. note::

As of April 2022 requires opting in explicitly via the developer portal to receive the actual content of the guild messages.
Bots in over 100 guilds will need to apply to Discord for verification.
See https://support-dev.discord.com/hc/en-us/articles/4404772028055 for more information.

"""
return 1 << 15

@flag_value
def scheduled_events(self):
""":class:`bool`: Whether "scheduled event" related events are enabled.
Expand Down