From cf36a423282ef14c839a4a4cf44b5dc48e7782a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=8F=AA=E7=93=9C?= <52106595+a-fruity-melon@users.noreply.github.com> Date: Wed, 21 Apr 2021 18:44:42 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20rate.py=20variable=20scop?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dafuq --- rate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rate.py b/rate.py index 478eba9..926dcce 100644 --- a/rate.py +++ b/rate.py @@ -41,10 +41,10 @@ last_init = time.time() @listener(incoming=True, ignore_edited=True) async def refresher(context): + global last_init if time.time() - last_init > 24 * 60 * 60: # we'd better do this to prevent ruining the log file with massive fail logs # as this `refresher` would be called frequently - global last_init last_init = time.time() try: init()