From 6f27ce7bbc4d002c50eea762b71bf28dc63e1ccc Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 14 Jun 2023 09:34:31 +0200 Subject: [PATCH] Improved open voice state check #292_shutdown_procedure --- kdb-bot/src/bot_core/service/data_integrity_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kdb-bot/src/bot_core/service/data_integrity_service.py b/kdb-bot/src/bot_core/service/data_integrity_service.py index e00028c8..c3f76912 100644 --- a/kdb-bot/src/bot_core/service/data_integrity_service.py +++ b/kdb-bot/src/bot_core/service/data_integrity_service.py @@ -259,6 +259,7 @@ class DataIntegrityService: self._logger.fatal(__name__, f"Server not found in database: {guild.id}") try: + # close open voice states for member in guild.members: if member.bot: self._logger.trace(__name__, f"User {member.id} is ignored, because its a bot") @@ -291,7 +292,10 @@ class DataIntegrityService: self._users.update_user(user) self._db_context.save_changes() + if self._is_for_shutdown: + return + # add open voice states for member in guild.members: if member.bot: self._logger.trace(__name__, f"User {member.id} is ignored, because its a bot")