Improved bot startup logic
This commit is contained in:
		| @@ -3,7 +3,7 @@ from datetime import datetime | ||||
| from cpl_core.configuration import ConfigurationABC | ||||
| from cpl_core.console import Console | ||||
| from cpl_core.logging import LoggerABC, LoggingLevelEnum, LoggingSettings | ||||
|  | ||||
| from discord import guild | ||||
| from gismo_core.abc.bot_service_abc import BotServiceABC | ||||
| from modules_core.abc.module_abc import ModuleABC | ||||
|  | ||||
| @@ -40,4 +40,13 @@ class BootLog(ModuleABC): | ||||
|         if self._logging_st.console.value >= LoggingLevelEnum.INFO.value: | ||||
|             Console.banner(self._bot.user.name) | ||||
|          | ||||
|         self._logger.trace(__name__, f'Module {type(self)} stopped') | ||||
|         for g in self._bot.guilds: | ||||
|             g: guild = g | ||||
|             self._logger.debug(__name__, f'Server detected: {g.id}') | ||||
|              | ||||
|             server_config = self._config.get_configuration(f'DSERVER_{g.id}') | ||||
|             if server_config is None: | ||||
|                 self._logger.error(__name__, f'Config for server {g.id} not found!') | ||||
|                 await self._bot.close() | ||||
|          | ||||
|         self._logger.trace(__name__, f'Module {type(self)} stopped') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user