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 committed 2017-03-29 04:36:06 -04:00
1 parent e1c32626ba
commit 7f58853e3a
2 files changed
+9 -3

No files matched your search

+1 -1
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