aboutsummaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-05-29 21:35:48 -0400
committerRapptz <[email protected]>2019-06-04 18:30:47 -0400
commit5dce3410e6b6e2dfa3a7a305bde00a00ea013cf2 (patch)
tree24f542fa103e8436ddb3248bdc3d72d424372ef0 /discord
parentAdd Member.premium_since to denote member boost date. (diff)
downloaddiscord.py-5dce3410e6b6e2dfa3a7a305bde00a00ea013cf2.tar.xz
discord.py-5dce3410e6b6e2dfa3a7a305bde00a00ea013cf2.zip
Add support for new message types related to premium guilds.
Diffstat (limited to 'discord')
-rw-r--r--discord/enums.py20
-rw-r--r--discord/message.py12
2 files changed, 24 insertions, 8 deletions
diff --git a/discord/enums.py b/discord/enums.py
index d077f7ee..5e47f8a9 100644
--- a/discord/enums.py
+++ b/discord/enums.py
@@ -76,14 +76,18 @@ class ChannelType(Enum):
@fast_lookup
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
+ 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
@fast_lookup
class VoiceRegion(Enum):
diff --git a/discord/message.py b/discord/message.py
index 5ed97d59..75ee52b5 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -603,6 +603,18 @@ class Message:
else:
return '{0.author.name} started a call \N{EM DASH} Join the call.'.format(self)
+ if self.type is MessageType.premium_guild_subscription:
+ return '{0.author.name} just boosted the server!'.format(self)
+
+ if self.type is MessageType.premium_guild_tier_1:
+ return '{0.author.name} just boosted the server! {0.guild} has achieved **Level 1!**'.format(self)
+
+ if self.type is MessageType.premium_guild_tier_2:
+ return '{0.author.name} just boosted the server! {0.guild} has achieved **Level 2!**'.format(self)
+
+ 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)
+
async def delete(self, *, delay=None):
"""|coro|