修复一点逻辑小问题

This commit is contained in:
McElaga 2022-06-18 09:15:19 +08:00
parent a84cab7afd
commit 9db69fa05b

View File

@ -149,12 +149,12 @@ async def _remind(user_id: int, uid: str):
if current_resin < max_resin:
user_manager.remove(uid)
user_manager.remove_overflow(uid)
if current_resin <= max_resin - 40:
next_time = now + timedelta(minutes=(max_resin - 40 - current_resin + 1) * 8, seconds=10)
elif max_resin - 40 < current_resin <= max_resin - 20:
next_time = now + timedelta(minutes=(max_resin - 20 - current_resin + 1) * 8, seconds=10)
elif max_resin - 20 < current_resin < max_resin:
next_time = now + timedelta(minutes=(max_resin - current_resin) * 8, seconds=10)
if current_resin < max_resin - 40:
next_time = now + timedelta(minutes=(max_resin - 40 - current_resin) * 8)
elif max_resin - 40 <= current_resin < max_resin - 20:
next_time = now + timedelta(minutes=(max_resin - 20 - current_resin) * 8)
elif max_resin - 20 <= current_resin < max_resin:
next_time = now + timedelta(minutes=(max_resin - current_resin) * 8)
elif current_resin == max_resin:
custom_overflow_resin = Config.get_config("resin_remind", "CUSTOM_RESIN_OVERFLOW_REMIND")
if user_manager.is_overflow(uid) and custom_overflow_resin: