aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadir Chowdhury <[email protected]>2021-02-23 08:57:11 +0000
committerGitHub <[email protected]>2021-02-23 03:57:11 -0500
commit6f748e5da59e5c98504c14d52fcc00a8cce7041a (patch)
tree5db6641c5eac038735746b36165824d97add5027
parentAdd converter example (diff)
downloaddiscord.py-6f748e5da59e5c98504c14d52fcc00a8cce7041a.tar.xz
discord.py-6f748e5da59e5c98504c14d52fcc00a8cce7041a.zip
Add remaining v6 message types
-rw-r--r--discord/enums.py31
-rw-r--r--discord/message.py15
-rw-r--r--docs/api.rst29
3 files changed, 62 insertions, 13 deletions
diff --git a/discord/enums.py b/discord/enums.py
index 721dbe47..93194788 100644
--- a/discord/enums.py
+++ b/discord/enums.py
@@ -163,19 +163,24 @@ class ChannelType(Enum):
return self.name
class MessageType(Enum):
- default = 0
- recipient_add = 1
- recipient_remove = 2
- call = 3
- channel_name_change = 4
- channel_icon_change = 5
- pins_add = 6
- new_member = 7
- premium_guild_subscription = 8
- premium_guild_tier_1 = 9
- premium_guild_tier_2 = 10
- premium_guild_tier_3 = 11
- channel_follow_add = 12
+ default = 0
+ recipient_add = 1
+ recipient_remove = 2
+ call = 3
+ channel_name_change = 4
+ channel_icon_change = 5
+ pins_add = 6
+ new_member = 7
+ premium_guild_subscription = 8
+ premium_guild_tier_1 = 9
+ premium_guild_tier_2 = 10
+ premium_guild_tier_3 = 11
+ channel_follow_add = 12
+ guild_stream = 13
+ guild_discovery_disqualified = 14
+ guild_discovery_requalified = 15
+ guild_discovery_grace_period_initial_warning = 16
+ guild_discovery_grace_period_final_warning = 17
class VoiceRegion(Enum):
us_west = 'us-west'
diff --git a/discord/message.py b/discord/message.py
index 535a401f..d9f9bccb 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -923,6 +923,21 @@ class Message(Hashable):
if self.type is MessageType.channel_follow_add:
return '{0.author.name} has added {0.content} to this channel'.format(self)
+
+ if self.type is MessageType.guild_stream:
+ return '{0.author.name} is live! Now streaming {0.author.activity.name}'.format(self)
+
+ if self.type is MessageType.guild_discovery_disqualified:
+ return 'This server has been removed from Server Discovery because it no longer passes all the requirements. Check Server Settings for more details.'
+
+ if self.type is MessageType.guild_discovery_requalified:
+ return 'This server is eligible for Server Discovery again and has been automatically relisted!'
+
+ if self.type is MessageType.guild_discovery_grace_period_initial_warning:
+ return 'This server has failed Discovery activity requirements for 1 week. If this server fails for 4 weeks in a row, it will be automatically removed from Discovery.'
+
+ if self.type is MessageType.guild_discovery_grave_period_final_warning:
+ return 'This server has failed Discovery activity requirements for 3 weeks in a row. If this server fails for 1 more week, it will be removed from Discovery.'
async def delete(self, *, delay=None):
"""|coro|
diff --git a/docs/api.rst b/docs/api.rst
index 05b08909..7c1c5f3c 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -1125,6 +1125,35 @@ of :class:`enum.Enum`.
The system message denoting that an announcement channel has been followed.
.. versionadded:: 1.3
+ .. attribute:: guild_stream
+
+ The system message denoting that a member is streaming in the guild.
+
+ .. versionadded:: 1.7
+ .. attribute:: guild_discovery_disqualified
+
+ The system message denoting that the guild is no longer eligible for Server
+ Discovery.
+
+ .. versionadded:: 1.7
+ .. attribute:: guild_discovery_requalified
+
+ The system message denoting that the guild has become eligible again for Server
+ Discovery.
+
+ .. versionadded:: 1.7
+ .. attribute:: guild_discovery_grace_period_initial_warning
+
+ The system message denoting that the guild has failed to meet the Server
+ Discovery requirements for one week.
+
+ .. versionadded:: 1.7
+ .. attribute:: guild_discovery_grace_period_final_warning
+
+ The system message denoting that the guild has failed to meet the Server
+ Discovery requirements for 3 weeks in a row.
+
+ .. versionadded:: 1.7
.. class:: ActivityType