diff --git a/mostr.py b/mostr.py index 9409bc94..d6f4c8bd 100644 --- a/mostr.py +++ b/mostr.py @@ -120,7 +120,8 @@ class MostrHandler: bot_handler.react(message, 'check') def __del__(self): - self.relays.close_connections() - print('Terminated Mostr Bot') + if hasattr(self, 'relays'): + self.relays.close_connections() + print('Terminated Mostr Bot') handler_class = MostrHandler