Merge pull request #828 from McElaga/main

修复原神树脂重复提醒的bug
This commit is contained in:
HibiKier
2022-06-19 16:54:25 +08:00
committed by GitHub
@@ -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: