Do not load settings which are not active (module not loaded)

Restart the bot, on heavy DB errors, with an 30 seconds delay (like: all connections terminated by DB, table_definition_cache exhausted)
Fix for channel prefixing (org <-> priv)
This commit is contained in:
2021-11-30 16:57:31 +01:00
parent c100b0ea76
commit bf6c1842d2
17 changed files with 57 additions and 29 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ class Text:
def inject(self, registry):
self.setting_service: SettingService = registry.get_instance("setting_service")
self.ban = registry.get_instance("ban_service")
self.ban = registry.get_instance("ban_service", is_optional=True)
self.bot = registry.get_instance("bot")
self.public_channel_service = registry.get_instance("public_channel_service")
@@ -153,7 +153,7 @@ class Text:
msg = f"<highlight>{char_info.name}</highlight>"
else:
msg = f"<highlight>CharId({char_info.char_id:d})</highlight>"
if check_ban:
if check_ban and self.ban:
banned = f" :: <red>Banned!</red>" if self.ban.get_ban(char_info.char_id) else ""
msg += banned
if online_status is not None: