From c3e10342b2c2888b3c3267593ada17f83fc145c8 Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Sat, 30 Apr 2022 14:43:49 +0800 Subject: [PATCH] =?UTF-8?q?nonebot2=20beta=202=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Paimon_Gacha/gacha_res.py | 2 -- utils/util.py | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Paimon_Gacha/gacha_res.py b/Paimon_Gacha/gacha_res.py index 52603fb..29ebaf1 100644 --- a/Paimon_Gacha/gacha_res.py +++ b/Paimon_Gacha/gacha_res.py @@ -1,7 +1,5 @@ -import copy import json import os -from pathlib import Path import datetime import numpy diff --git a/utils/util.py b/utils/util.py index a0d07b5..15e2210 100644 --- a/utils/util.py +++ b/utils/util.py @@ -94,13 +94,13 @@ class FreqLimiter: self.default_cd = default_cd_seconds def check(self, key) -> bool: - return bool(time.time() >= self.next_time[key]) + return bool(time() >= self.next_time[key]) def start_cd(self, key, cd_time=0): - self.next_time[key] = time.time() + (cd_time if cd_time > 0 else self.default_cd) + self.next_time[key] = time() + (cd_time if cd_time > 0 else self.default_cd) def left_time(self, key) -> int: - return int(self.next_time[key] - time.time()) + 1 + return int(self.next_time[key] - time()) + 1 # 获取可用的cookie