From e48f74e59213c43b9da94424332e811e5ef61f32 Mon Sep 17 00:00:00 2001 From: Louis Chauvet Date: Fri, 24 Apr 2020 22:02:32 +0200 Subject: [PATCH] =?UTF-8?q?[bot-base]=20Ajout=20de=20la=20gestion=20des=20?= =?UTF-8?q?erreurs=20et=20des=20warns=20[config]=20Modification=20de=20Cha?= =?UTF-8?q?nnel=20pour=20=C3=A9viter=20les=20Nones=20inutiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bot_base/bot_base.py | 6 +++--- src/config/config_types/discord_types/channel.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bot_base/bot_base.py b/src/bot_base/bot_base.py index 0cb14e7..41ff1db 100644 --- a/src/bot_base/bot_base.py +++ b/src/bot_base/bot_base.py @@ -207,10 +207,10 @@ class BotBase(discord.Client): self.error(f"Error in {event_method}: \n{exc}") # Logging - def info(self, *args, **kwargs): + def info(self, info, *args, **kwargs): if self.log: - self.log.info(*args, **kwargs) - self.dispatch("log_info", *args, **kwargs) + self.log.info(info, *args, **kwargs) + self.dispatch("log_info", info, *args, **kwargs) def error(self, e, *args, **kwargs): if self.log: diff --git a/src/config/config_types/discord_types/channel.py b/src/config/config_types/discord_types/channel.py index f7cd831..238457d 100644 --- a/src/config/config_types/discord_types/channel.py +++ b/src/config/config_types/discord_types/channel.py @@ -36,7 +36,8 @@ class Channel(BaseType): self._update() def get(self): - self._update() + if self.channel_instance is None: + self._update() return self.channel_instance or self.value def to_save(self):