From 4813504ec18047504efd9500525b33a1a5047a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Sun, 7 Apr 2024 17:59:10 +0200 Subject: [PATCH] Use DM_MESSAGES instead of PRIVATE_MESSAGES in documentation (#1874) Co-authored-by: beagold <86345081+beagold@users.noreply.github.com> --- changes/1874.documentation.md | 1 + hikari/intents.py | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 changes/1874.documentation.md diff --git a/changes/1874.documentation.md b/changes/1874.documentation.md new file mode 100644 index 0000000000..57867cc68c --- /dev/null +++ b/changes/1874.documentation.md @@ -0,0 +1 @@ +Replace mentions of `PRIVATE_MESSAGES` with `DM_MESSAGES` diff --git a/hikari/intents.py b/hikari/intents.py index 54e6372730..4cf5aefcde 100644 --- a/hikari/intents.py +++ b/hikari/intents.py @@ -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. @@ -82,7 +82,7 @@ class Intents(enums.Flag): Intents.GUILD_INTEGRATIONS | Intents.GUILD_MESSAGES | Intents.GUILD_MODERATION | - Intents.PRIVATE_MESSAGES + Intents.DM_MESSAGES ) ``` @@ -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.") ``` @@ -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? @@ -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 @@ -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."""