From 58742a8176f32bb33cd096d9058a1689311f2845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Thu, 4 Apr 2024 18:02:28 +0200 Subject: [PATCH 1/5] Use DM_MESSAGES instead of PRIVATE_MESSAGES in documentation Got renamed in #227 --- hikari/intents.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hikari/intents.py b/hikari/intents.py index 54e6372730..2952f6b05e 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? From 6d17fe60add21325b5f97807578b04064ee0d24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Thu, 4 Apr 2024 18:25:32 +0200 Subject: [PATCH 2/5] Change private message to direct message --- hikari/intents.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hikari/intents.py b/hikari/intents.py index 2952f6b05e..4cf5aefcde 100644 --- a/hikari/intents.py +++ b/hikari/intents.py @@ -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.""" From 0a22be112a255f3f2fe74f118898b78038c3038f Mon Sep 17 00:00:00 2001 From: beagold <86345081+beagold@users.noreply.github.com> Date: Sun, 7 Apr 2024 17:41:52 +0200 Subject: [PATCH 3/5] Add changelog fragment --- changes/1874.doc.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/1874.doc.md diff --git a/changes/1874.doc.md b/changes/1874.doc.md new file mode 100644 index 0000000000..5699b980a5 --- /dev/null +++ b/changes/1874.doc.md @@ -0,0 +1 @@ +Replace mentions of `PRIVATE_MESSAGES` with `DM_MESSAGES` From f2fdc2d1efb0ac1038b0f546423d48324ec64a84 Mon Sep 17 00:00:00 2001 From: beagold <86345081+beagold@users.noreply.github.com> Date: Sun, 7 Apr 2024 17:43:40 +0200 Subject: [PATCH 4/5] doc -> documentation --- changes/{1874.doc.md => 1874.documentation.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changes/{1874.doc.md => 1874.documentation.md} (100%) diff --git a/changes/1874.doc.md b/changes/1874.documentation.md similarity index 100% rename from changes/1874.doc.md rename to changes/1874.documentation.md From 226d902d4ce67f3e2c3cc6a583f8c0f4be13ddfa Mon Sep 17 00:00:00 2001 From: beagold <86345081+beagold@users.noreply.github.com> Date: Sun, 7 Apr 2024 17:51:54 +0200 Subject: [PATCH 5/5] Fix line ending of changelog file Thank you VSCode --- changes/1874.documentation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes/1874.documentation.md b/changes/1874.documentation.md index 5699b980a5..57867cc68c 100644 --- a/changes/1874.documentation.md +++ b/changes/1874.documentation.md @@ -1 +1 @@ -Replace mentions of `PRIVATE_MESSAGES` with `DM_MESSAGES` +Replace mentions of `PRIVATE_MESSAGES` with `DM_MESSAGES`