From e8ecacb9bec68bad58288bd85eb3055fa01d2c3c Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 11 Feb 2018 03:34:53 +0000 Subject: [PATCH] Better way to handle string to int during global ratelimit --- webapp/titanembeds/discordrest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/titanembeds/discordrest.py b/webapp/titanembeds/discordrest.py index 6695271..0ecb4c4 100644 --- a/webapp/titanembeds/discordrest.py +++ b/webapp/titanembeds/discordrest.py @@ -54,10 +54,10 @@ class DiscordREST: for tries in range(5): curepoch = time.time() 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() - 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) url_formatted = _DISCORD_API_BASE + url