mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
Allow complete disabling of the member cache.
This commit is contained in:
parent
edcd9459e3
commit
bc352f0e50
@ -71,6 +71,8 @@ class ConnectionState:
|
||||
self._fetch_offline = options.get('fetch_offline_members', True)
|
||||
self.heartbeat_timeout = options.get('heartbeat_timeout', 60.0)
|
||||
self.guild_subscriptions = options.get('guild_subscriptions', True)
|
||||
# Only disable cache if both fetch_offline and guild_subscriptions are off.
|
||||
self._cache_members = not (self._fetch_offline or self.guild_subscriptions)
|
||||
self._listeners = []
|
||||
|
||||
activity = options.get('activity', None)
|
||||
@ -584,7 +586,8 @@ class ConnectionState:
|
||||
return
|
||||
|
||||
member = Member(guild=guild, data=data, state=self)
|
||||
guild._add_member(member)
|
||||
if self._cache_members:
|
||||
guild._add_member(member)
|
||||
guild._member_count += 1
|
||||
self.dispatch('member_join', member)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user