Don't store a user cache if there's no member intent or cache is off
Without a cache or member intent the user cache can get out of date with no events to update the underlying user in the member object. Ref: #6034
This commit is contained in:
@ -186,6 +186,9 @@ class ConnectionState:
|
||||
self._status = status
|
||||
self._intents = intents
|
||||
|
||||
if not intents.members or cache_flags._empty:
|
||||
self.store_user = self.store_user_no_intents
|
||||
|
||||
self.parsers = parsers = {}
|
||||
for attr, func in inspect.getmembers(self):
|
||||
if attr.startswith('parse_'):
|
||||
@ -279,6 +282,9 @@ class ConnectionState:
|
||||
self._users[user_id] = user
|
||||
return user
|
||||
|
||||
def store_user_no_intents(self, data):
|
||||
return User(state=self, data=data)
|
||||
|
||||
def get_user(self, id):
|
||||
return self._users.get(id)
|
||||
|
||||
|
Reference in New Issue
Block a user