Keep track of Emoji instances myself.

WeakValueDictionary cleans up too late and brings too little benefit.
Also clean up the state when the first READY is encountered for
AutoShardedClient and when any READY is encountered in regular Client.
This commit is contained in:
Rapptz
2017-03-29 04:35:06 -04:00
parent e1c32626ba
commit 7f58853e3a
2 changed files with 9 additions and 3 deletions

View File

@ -73,7 +73,7 @@ class Emoji(Hashable):
A list of :class:`Role` that is allowed to use this emoji. If roles is empty,
the emoji is unrestricted.
"""
__slots__ = ('require_colons', 'managed', 'id', 'name', 'roles', 'guild', '_state', '__weakref__')
__slots__ = ('require_colons', 'managed', 'id', 'name', 'roles', 'guild', '_state')
def __init__(self, *, guild, state, data):
self.guild = guild