mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
Better way to handle string to int during global ratelimit
This commit is contained in:
parent
05cbd63e6f
commit
e8ecacb9be
@ -54,10 +54,10 @@ class DiscordREST:
|
|||||||
for tries in range(5):
|
for tries in range(5):
|
||||||
curepoch = time.time()
|
curepoch = time.time()
|
||||||
if self._get_bucket("global_limited") == "True":
|
if self._get_bucket("global_limited") == "True":
|
||||||
time.sleep(int(self._get_bucket("global_limit_expire")) - curepoch)
|
time.sleep(int(float(self._get_bucket("global_limit_expire"))) - curepoch)
|
||||||
curepoch = time.time()
|
curepoch = time.time()
|
||||||
|
|
||||||
if self._bucket_contains(url) and int(self._get_bucket(url)) > curepoch:
|
if self._bucket_contains(url) and float(int(self._get_bucket(url))) > curepoch:
|
||||||
time.sleep(int(self._get_bucket(url)) - curepoch)
|
time.sleep(int(self._get_bucket(url)) - curepoch)
|
||||||
|
|
||||||
url_formatted = _DISCORD_API_BASE + url
|
url_formatted = _DISCORD_API_BASE + url
|
||||||
|
Loading…
Reference in New Issue
Block a user