diff options
| author | Rapptz <[email protected]> | 2019-08-27 03:33:44 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-08-27 18:41:32 -0400 |
| commit | ea3d119ca61e269f3d5bfdfe42178a82d2dba5e6 (patch) | |
| tree | 760e1882acc76f326b7a0efe0f25cea174463191 /discord/client.py | |
| parent | Fix bucket key to not have the method in there. (diff) | |
| download | discord.py-ea3d119ca61e269f3d5bfdfe42178a82d2dba5e6.tar.xz discord.py-ea3d119ca61e269f3d5bfdfe42178a82d2dba5e6.zip | |
Use X-Ratelimit-Reset-After header by default.
There is now an option to turn it off, of course.
Diffstat (limited to 'discord/client.py')
| -rw-r--r-- | discord/client.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/discord/client.py b/discord/client.py index 43733f3e..643bc606 100644 --- a/discord/client.py +++ b/discord/client.py @@ -185,6 +185,14 @@ class Client: 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` + 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 + a rate limit bucket given by Discord. If this is ``False`` then your system clock is + used to calculate how long to sleep for. If this is set to ``False`` it is recommended to + sync your system clock to Google's NTP server. + + .. versionadded:: 1.3 Attributes ----------- @@ -203,7 +211,8 @@ class Client: connector = options.pop('connector', None) proxy = options.pop('proxy', None) proxy_auth = options.pop('proxy_auth', None) - self.http = HTTPClient(connector, proxy=proxy, proxy_auth=proxy_auth, loop=self.loop) + unsync_clock = options.pop('assume_unsync_clock', True) + self.http = HTTPClient(connector, proxy=proxy, proxy_auth=proxy_auth, unsync_clock=unsync_clock, loop=self.loop) self._handlers = { 'ready': self._handle_ready |