Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DM_MESSAGES instead of PRIVATE_MESSAGES in documentation #1874

Merged
merged 5 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
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
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
Loading