From f140fd4c919c8a27b06b5a83a6e51c2f3b6685ba Mon Sep 17 00:00:00 2001 From: Matthias Nadler Date: Sat, 23 Mar 2019 12:20:56 +0100 Subject: [PATCH] fix for deleted servers --- cogs/poll_controls.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cogs/poll_controls.py b/cogs/poll_controls.py index 7d8bb4a..15f602f 100644 --- a/cogs/poll_controls.py +++ b/cogs/poll_controls.py @@ -42,6 +42,8 @@ class PollControls: for pd in [poll async for poll in query]: p = Poll(self.bot, load=True) await p.from_dict(pd) + if not p.server: + continue if p.active: await self.bot.send_message(p.channel, 'This poll has been scheduled and is active now!') await p.post_embed(destination=p.channel) @@ -51,6 +53,8 @@ class PollControls: for pd in [poll async for poll in query]: p = Poll(self.bot, load=True) await p.from_dict(pd) + if not p.server: + continue if not p.open: await self.bot.send_message(p.channel, 'This poll has reached the deadline and is closed!') await p.post_embed(destination=p.channel)