mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-22 08:44:10 +00:00
Always overwrite Emoji references in the state.
There is potential that when recreating the Emoji list in the GUILD_EMOJIS_UPDATE event would just fetch from cache and the element in cache having an out of date Guild reference. This Guild reference will be kept alive for longer than it should be. By always overwriting the Emoji reference, this problem goes away.
This commit is contained in:
parent
e749b19131
commit
cac84e517b
@ -141,11 +141,8 @@ class ConnectionState:
|
||||
|
||||
def store_emoji(self, guild, data):
|
||||
emoji_id = int(data['id'])
|
||||
try:
|
||||
return self._emojis[emoji_id]
|
||||
except KeyError:
|
||||
self._emojis[emoji_id] = emoji = Emoji(guild=guild, state=self, data=data)
|
||||
return emoji
|
||||
self._emojis[emoji_id] = emoji = Emoji(guild=guild, state=self, data=data)
|
||||
return emoji
|
||||
|
||||
@property
|
||||
def guilds(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user