Browse Source

Support for new member message types.

pull/546/head
Rapptz 8 years ago
parent
commit
83649d7f0a
  1. 1
      discord/enums.py
  2. 28
      discord/message.py

1
discord/enums.py

@ -46,6 +46,7 @@ class MessageType(Enum):
channel_name_change = 4
channel_icon_change = 5
pins_add = 6
new_member = 7
class GuildRegion(Enum):
us_west = 'us-west'

28
discord/message.py

@ -365,6 +365,34 @@ class Message:
if self.type is MessageType.channel_icon_change:
return '{0.author.name} changed the channel icon.'.format(self)
if self.type is MessageType.new_member:
formats = [
"%s just joined the server - glhf!",
"%s just joined. Everyone, look busy!",
"%s just joined. Can I get a heal?",
"%s joined your party.",
"%s joined. You must construct additional pylons.",
"Ermagherd. %s is here.",
"Welcome, %s. Stay awhile and listen.",
"Welcome, %s. We were expecting you ( ͡° ͜ʖ ͡°)",
"Welcome, %s. We hope you brought pizza.",
"Welcome %s. Leave your weapons by the door.",
"A wild %s appeared.",
"Swoooosh. %s just landed.",
"Brace yourselves. %s just joined the server.",
"%s just joined. Hide your bananas.",
"%s just arrived. Seems OP - please nerf.",
"%s just slid into the server.",
"A %s has spawned in the server.",
"Big %s showed up!",
"Where’s %s? In the server!",
"%s hopped into the server. Kangaroo!!",
"%s just showed up. Hold my beer.",
]
index = int(self.created_at.timestamp()) % len(formats)
return formats[index] % self.author.name
if self.type is MessageType.call:
# we're at the call message type now, which is a bit more complicated.
# we can make the assumption that Message.channel is a PrivateChannel

Loading…
Cancel
Save