mirror of
https://github.com/GaMeNu/HFCNotificator.git
synced 2024-11-16 15:24:51 +02:00
v2.1.1
Fixed alert not sendfing if twice in same area
This commit is contained in:
parent
4a810f7f5a
commit
8e2fd34353
@ -80,6 +80,7 @@ class Notificator(commands.Cog):
|
||||
self.db = DBAccess()
|
||||
|
||||
self.active_districts = []
|
||||
self.reset_district_checker = 0
|
||||
|
||||
if not self.check_for_updates.is_running():
|
||||
self.check_for_updates.start()
|
||||
@ -106,7 +107,14 @@ class Notificator(commands.Cog):
|
||||
self.log.error(f'Request timed out: {error}')
|
||||
return
|
||||
self.log.debug(f'Alert response: {current_alert}')
|
||||
|
||||
if current_alert is None:
|
||||
if len(self.active_districts) == 0:
|
||||
return
|
||||
self.reset_district_checker += 1
|
||||
if self.reset_district_checker == 3:
|
||||
self.active_districts = []
|
||||
self.reset_district_checker = 0
|
||||
return
|
||||
|
||||
data: list[str] = current_alert["data"]
|
||||
|
Loading…
Reference in New Issue
Block a user