diff --git a/tau/core/utils.py b/tau/core/utils.py index cb82f4a..07ae260 100644 --- a/tau/core/utils.py +++ b/tau/core/utils.py @@ -169,7 +169,7 @@ def get_conditions(instance): ] else: return [{ - key: config.CHANNEL_ID for key in instance.condition_schema['properties'].keys() + key: config.CHANNEL_ID for key in instance.condition_schema['required'] }] def init_webhooks(base_url, worker_token): diff --git a/tau/core/worker_irc.py b/tau/core/worker_irc.py index f652d61..7c14686 100644 --- a/tau/core/worker_irc.py +++ b/tau/core/worker_irc.py @@ -98,7 +98,8 @@ async def connect(self): delay = max(delay*2, 120) async def send(self, channel, message): - await self.connection.send(f'PRIVMSG #{channel} :{message}') + if self.connection is not None and self.connection.open: + await self.connection.send(f'PRIVMSG #{channel} :{message}') async def receive(self): while True: