Skip to content

Commit

Permalink
Use DM_MESSAGES instead of PRIVATE_MESSAGES in documentation (#1874)
Browse files Browse the repository at this point in the history
Co-authored-by: beagold <86345081+beagold@users.noreply.github.com>
  • Loading branch information
TheLovinator1 and beagold authored Apr 7, 2024
1 parent 0711409 commit 4813504
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions changes/1874.documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace mentions of `PRIVATE_MESSAGES` with `DM_MESSAGES`
30 changes: 15 additions & 15 deletions hikari/intents.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Intents(enums.Flag):
```py
# One or two values that fit on one line.
my_intents = Intents.GUILD_MESSAGES | Intents.PRIVATE_MESSAGES
my_intents = Intents.GUILD_MESSAGES | Intents.DM_MESSAGES
# Several intents together. You may find it useful to format these like
# so to keep your code readable.
Expand All @@ -82,7 +82,7 @@ class Intents(enums.Flag):
Intents.GUILD_INTEGRATIONS |
Intents.GUILD_MESSAGES |
Intents.GUILD_MODERATION |
Intents.PRIVATE_MESSAGES
Intents.DM_MESSAGES
)
```
Expand All @@ -98,12 +98,12 @@ class Intents(enums.Flag):
print("Guild messages are enabled")
# Checking if ALL in a combination are set:
expected_intents = (Intents.GUILD_MESSAGES | Intents.PRIVATE_MESSAGES)
expected_intents = (Intents.GUILD_MESSAGES | Intents.DM_MESSAGES)
if (my_intents & expected_intents) == expected_intents:
print("Messages are enabled in guilds and private messages.")
# Checking if AT LEAST ONE in a combination is set:
expected_intents = (Intents.GUILD_MESSAGES | Intents.PRIVATE_MESSAGES)
expected_intents = (Intents.GUILD_MESSAGES | Intents.DM_MESSAGES)
if my_intents & expected_intents:
print("Messages are enabled in guilds or private messages.")
```
Expand All @@ -118,9 +118,9 @@ class Intents(enums.Flag):
my_intents ^= Intents.GUILD_MESSAGES
# Remove all messages events.
my_intents = my_intents ^ (Intents.GUILD_MESSAGES | Intents.PRIVATE_MESSAGES)
my_intents = my_intents ^ (Intents.GUILD_MESSAGES | Intents.DM_MESSAGES)
# or, simplifying
my_intents ^= (Intents.GUILD_MESSAGES | Intents.PRIVATE_MESSAGES)
my_intents ^= (Intents.GUILD_MESSAGES | Intents.DM_MESSAGES)
```
What is and is not covered by intents?
Expand Down Expand Up @@ -296,24 +296,24 @@ class Intents(enums.Flag):
DM_MESSAGES = 1 << 12
"""Subscribes to the events listed below.
* `MESSAGE_CREATE` (in private message channels (non-guild bound) only)
* `MESSAGE_UPDATE` (in private message channels (non-guild bound) only)
* `MESSAGE_DELETE` (in private message channels (non-guild bound) only)
* `MESSAGE_CREATE` (in direct message channels (non-guild bound) only)
* `MESSAGE_UPDATE` (in direct message channels (non-guild bound) only)
* `MESSAGE_DELETE` (in direct message channels (non-guild bound) only)
"""

DM_MESSAGE_REACTIONS = 1 << 13
"""Subscribes to the events listed below.
* `MESSAGE_REACTION_ADD` (in private message channels (non-guild bound) only)
* `MESSAGE_REACTION_REMOVE` (in private message channels (non-guild bound) only)
* `MESSAGE_REACTION_REMOVE_ALL` (in private message channels (non-guild bound) only)
* `MESSAGE_REACTION_REMOVE_EMOJI` (in private message channels (non-guild bound) only)
* `MESSAGE_REACTION_ADD` (in direct message channels (non-guild bound) only)
* `MESSAGE_REACTION_REMOVE` (in direct message channels (non-guild bound) only)
* `MESSAGE_REACTION_REMOVE_ALL` (in direct message channels (non-guild bound) only)
* `MESSAGE_REACTION_REMOVE_EMOJI` (in direct message channels (non-guild bound) only)
"""

DM_MESSAGE_TYPING = 1 << 14
"""Subscribes to the events listed below.
* `TYPING_START` (in private message channels (non-guild bound) only)
* `TYPING_START` (in direct message channels (non-guild bound) only)
"""

MESSAGE_CONTENT = 1 << 15
Expand Down Expand Up @@ -375,7 +375,7 @@ class Intents(enums.Flag):
"""

ALL_DMS = DM_MESSAGES | DM_MESSAGE_TYPING | DM_MESSAGE_REACTIONS
"""All private message channel (non-guild bound) intents."""
"""All direct message channel (non-guild bound) intents."""

ALL_MESSAGES = DM_MESSAGES | GUILD_MESSAGES
"""All message intents."""
Expand Down

0 comments on commit 4813504

Please sign in to comment.