Browse Source

Remove support for guild subscriptions

pull/6720/head
apple502j 4 years ago
committed by GitHub
parent
commit
dea92a69dc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 31
      discord/client.py
  2. 1
      discord/gateway.py
  3. 1
      discord/state.py

31
discord/client.py

@ -159,37 +159,6 @@ class Client:
preparing the member cache and firing READY. The default timeout is 2 seconds. preparing the member cache and firing READY. The default timeout is 2 seconds.
.. versionadded:: 1.4 .. versionadded:: 1.4
guild_subscriptions: :class:`bool`
Whether to dispatch presence or typing events. Defaults to ``True``.
.. versionadded:: 1.3
.. warning::
If this is set to ``False`` then the following features will be disabled:
- No user related updates (:func:`on_user_update` will not dispatch)
- All member related events will be disabled.
- :func:`on_member_update`
- :func:`on_member_join`
- :func:`on_member_remove`
- Typing events will be disabled (:func:`on_typing`).
- If ``fetch_offline_members`` is set to ``False`` then the user cache will not exist.
This makes it difficult or impossible to do many things, for example:
- Computing permissions
- Querying members in a voice channel via :attr:`VoiceChannel.members` will be empty.
- Most forms of receiving :class:`Member` will be
receiving :class:`User` instead, except for message events.
- :attr:`Guild.owner` will usually resolve to ``None``.
- :meth:`Guild.get_member` will usually be unavailable.
- Anything that involves using :class:`Member`.
- :attr:`users` will not be as populated.
- etc.
In short, this makes it so the only member you can reliably query is the
message author. Useful for bots that do not require any state.
assume_unsync_clock: :class:`bool` assume_unsync_clock: :class:`bool`
Whether to assume the system clock is unsynced. This applies to the ratelimit handling Whether to assume the system clock is unsynced. This applies to the ratelimit handling
code. If this is set to ``True``, the default, then the library uses the time to reset code. If this is set to ``True``, the default, then the library uses the time to reset

1
discord/gateway.py

@ -373,7 +373,6 @@ class DiscordWebSocket:
}, },
'compress': True, 'compress': True,
'large_threshold': 250, 'large_threshold': 250,
'guild_subscriptions': self._connection.guild_subscriptions,
'v': 3 'v': 3
} }
} }

1
discord/state.py

@ -120,7 +120,6 @@ class ConnectionState:
if self.guild_ready_timeout < 0: if self.guild_ready_timeout < 0:
raise ValueError('guild_ready_timeout cannot be negative') raise ValueError('guild_ready_timeout cannot be negative')
self.guild_subscriptions = options.get('guild_subscriptions', True)
allowed_mentions = options.get('allowed_mentions') allowed_mentions = options.get('allowed_mentions')
if allowed_mentions is not None and not isinstance(allowed_mentions, AllowedMentions): if allowed_mentions is not None and not isinstance(allowed_mentions, AllowedMentions):

Loading…
Cancel
Save