From da4bb0610c3aeef2533123b451497c9e3d19db19 Mon Sep 17 00:00:00 2001 From: Dice Date: Fri, 16 Aug 2019 22:10:49 -0400 Subject: [PATCH] Add CHANNEL_FOLLOW_ADD Message Type Add documentation for MessageType.channel_follow_add Add versionchanged to new MessageType attr Add system_content for new MessageType --- discord/enums.py | 1 + discord/message.py | 3 +++ docs/api.rst | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/discord/enums.py b/discord/enums.py index a7868bebc..b8a7fa7ec 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -171,6 +171,7 @@ class MessageType(Enum): premium_guild_tier_1 = 9 premium_guild_tier_2 = 10 premium_guild_tier_3 = 11 + channel_follow_add = 12 class VoiceRegion(Enum): us_west = 'us-west' diff --git a/discord/message.py b/discord/message.py index eb6ab5c78..8acd87cf0 100644 --- a/discord/message.py +++ b/discord/message.py @@ -669,6 +669,9 @@ class Message: if self.type is MessageType.premium_guild_tier_3: return '{0.author.name} just boosted the server! {0.guild} has achieved **Level 3!**'.format(self) + if self.type is MessageType.channel_follow_add: + return '{0.author.name} has added {0.content} to this channel'.format(self) + async def delete(self, *, delay=None): """|coro| diff --git a/docs/api.rst b/docs/api.rst index b86ef02c6..1c084c215 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -760,6 +760,9 @@ of :class:`enum.Enum`. Specifies the type of :class:`Message`. This is used to denote if a message is to be interpreted as a system message or a regular message. + .. versionchanged:: 1.3.0 + The ``channel_follow_add`` attribute was added. + .. attribute:: default The default message type. This is the same as regular messages. @@ -803,6 +806,9 @@ of :class:`enum.Enum`. The system message denoting that a member has "nitro boosted" a guild and it achieved level 3. + .. attribute:: channel_follow_add + + The system message denoting that an announcement channel has been followed. .. class:: ActivityType