Browse Source

feature - track GuildEmojisUpdate in state

pull/11/head
Andrei 8 years ago
parent
commit
ca36412c2e
  1. 8
      disco/state.py

8
disco/state.py

@ -88,7 +88,7 @@ class State(object):
EVENTS = [ EVENTS = [
'Ready', 'GuildCreate', 'GuildUpdate', 'GuildDelete', 'GuildMemberAdd', 'GuildMemberRemove', 'Ready', 'GuildCreate', 'GuildUpdate', 'GuildDelete', 'GuildMemberAdd', 'GuildMemberRemove',
'GuildMemberUpdate', 'GuildMembersChunk', 'GuildRoleCreate', 'GuildRoleUpdate', 'GuildRoleDelete', 'GuildMemberUpdate', 'GuildMembersChunk', 'GuildRoleCreate', 'GuildRoleUpdate', 'GuildRoleDelete',
'ChannelCreate', 'ChannelUpdate', 'ChannelDelete', 'VoiceStateUpdate', 'MessageCreate', 'GuildEmojisUpdate', 'ChannelCreate', 'ChannelUpdate', 'ChannelDelete', 'VoiceStateUpdate', 'MessageCreate',
'PresenceUpdate' 'PresenceUpdate'
] ]
@ -296,6 +296,12 @@ class State(object):
del self.guilds[event.guild_id].roles[event.role_id] del self.guilds[event.guild_id].roles[event.role_id]
def on_guild_emojis_update(self, event):
if event.guild_id not in self.guilds:
return
self.guilds[event.guild_id].emojis = HashMap({i.id: i for i in event.emojis})
def on_presence_update(self, event): def on_presence_update(self, event):
if event.user.id in self.users: if event.user.id in self.users:
self.users[event.user.id].update(event.presence.user) self.users[event.user.id].update(event.presence.user)

Loading…
Cancel
Save