fix for deleted servers
This commit is contained in:
parent
f140fd4c91
commit
81a9599997
@ -45,8 +45,11 @@ class PollControls:
|
|||||||
if not p.server:
|
if not p.server:
|
||||||
continue
|
continue
|
||||||
if p.active:
|
if p.active:
|
||||||
await self.bot.send_message(p.channel, 'This poll has been scheduled and is active now!')
|
try:
|
||||||
await p.post_embed(destination=p.channel)
|
await self.bot.send_message(p.channel, 'This poll has been scheduled and is active now!')
|
||||||
|
await p.post_embed(destination=p.channel)
|
||||||
|
except:
|
||||||
|
continue
|
||||||
|
|
||||||
query = self.bot.db.polls.find({'open': True, 'duration': {"$not": re.compile("0")}})
|
query = self.bot.db.polls.find({'open': True, 'duration': {"$not": re.compile("0")}})
|
||||||
if query:
|
if query:
|
||||||
@ -56,8 +59,11 @@ class PollControls:
|
|||||||
if not p.server:
|
if not p.server:
|
||||||
continue
|
continue
|
||||||
if not p.open:
|
if not p.open:
|
||||||
await self.bot.send_message(p.channel, 'This poll has reached the deadline and is closed!')
|
try:
|
||||||
await p.post_embed(destination=p.channel)
|
await self.bot.send_message(p.channel, 'This poll has reached the deadline and is closed!')
|
||||||
|
await p.post_embed(destination=p.channel)
|
||||||
|
except:
|
||||||
|
continue
|
||||||
except AttributeError as ae:
|
except AttributeError as ae:
|
||||||
#Database not loaded yet
|
#Database not loaded yet
|
||||||
logger.warning("Attribute Error in close_polls loop")
|
logger.warning("Attribute Error in close_polls loop")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user