mirror of
https://github.com/GaMeNu/HFCNotificator.git
synced 2024-11-16 15:24:51 +02:00
v2.2.3
Quick fix for skipping conditions
This commit is contained in:
parent
46d31c146d
commit
79dd81504d
@ -320,10 +320,19 @@ class Notificator(commands.Cog):
|
||||
dc_ch = self.bot.get_user(channel.id)
|
||||
|
||||
for emb in embed_ls:
|
||||
# Skipping conditions
|
||||
if dc_ch is None:
|
||||
# Channel could not be found
|
||||
continue
|
||||
if len(channel.locations) != 0 and isinstance(emb.district, AreaDistrict) and (emb.district.district_id not in channel.locations):
|
||||
continue
|
||||
if len(channel.locations) != 0:
|
||||
# Channel has specific locations registered
|
||||
if isinstance(emb.district, AreaDistrict) and (emb.district.district_id not in channel.locations):
|
||||
# District is registered but isn't in channel's registered location list
|
||||
continue
|
||||
if isinstance(emb.district, str):
|
||||
# District is not registered.
|
||||
continue
|
||||
|
||||
try:
|
||||
await dc_ch.send(embed=emb.embed, view=self.hfc_button_view())
|
||||
await asyncio.sleep(0.01)
|
||||
|
Loading…
Reference in New Issue
Block a user