diff options
author | Lint Action <[email protected]> | 2021-05-04 06:29:07 +0000 |
---|---|---|
committer | Lint Action <[email protected]> | 2021-05-04 06:29:07 +0000 |
commit | 8804f1e10d507ba293fafc77a7e93d3a84a5814b (patch) | |
tree | e107da61f76dfe64dfb96feb5e961bbc4bbd8d52 /ATRI/utils/limit.py | |
parent | ea7f48011c34fdaec7e91af7eb373c8174e439e6 (diff) | |
download | ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.tar.gz ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.tar.bz2 ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.zip |
:rotating_light: 自动进行代码格式化
Diffstat (limited to 'ATRI/utils/limit.py')
-rw-r--r-- | ATRI/utils/limit.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/ATRI/utils/limit.py b/ATRI/utils/limit.py index 7442dfb..bdd1d84 100644 --- a/ATRI/utils/limit.py +++ b/ATRI/utils/limit.py @@ -15,22 +15,18 @@ def del_list(user: str) -> None: exciting_user = del_list_aim(exciting_user, user) -def is_too_exciting(user: int, - times: int, - seconds: float = 0, - hours: float = 0, - days: float = 0) -> bool: +def is_too_exciting( + user: int, times: int, seconds: float = 0, hours: float = 0, days: float = 0 +) -> bool: global exciting_user - + if user in exciting_user: return False else: if count_list(exciting_user_temp, user) == times: - delta = datetime.timedelta( - seconds=seconds, hours=hours, days=days) - trigger = DateTrigger( - run_date=datetime.datetime.now() + delta) - + delta = datetime.timedelta(seconds=seconds, hours=hours, days=days) + trigger = DateTrigger(run_date=datetime.datetime.now() + delta) + scheduler.add_job( func=del_list, trigger=trigger, |