Conditional teardown only if correctly initialised

This commit is contained in:
xeruf 2024-12-07 00:18:06 +01:00
parent 8dff69813e
commit 059d350e9e
1 changed files with 3 additions and 2 deletions

View File

@ -120,6 +120,7 @@ class MostrHandler:
bot_handler.react(message, 'check')
def __del__(self):
if hasattr(self, 'relays'):
self.relays.close_connections()
print('Terminated Mostr Bot')