From a1f329a5c3dfe31ea376c5e4f069575365d4ffc8 Mon Sep 17 00:00:00 2001 From: Mortifia Date: Tue, 14 Jul 2026 07:24:09 +0200 Subject: [PATCH 1/3] =?UTF-8?q?Emp=C3=AAche=20un=20cog=20en=20erreur=20de?= =?UTF-8?q?=20faire=20planter=20$version/$credit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le try/except par-cog dans send_info_msg() protège l'affichage des autres services quand un cog échoue (template manquant, get_version() cassé...) — auparavant toute la commande plantait. Closes #90 --- src/bot/cog_about.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/bot/cog_about.py b/src/bot/cog_about.py index c5194f0..68d7dc9 100644 --- a/src/bot/cog_about.py +++ b/src/bot/cog_about.py @@ -30,15 +30,22 @@ async def credit(self, ctx: commands.Context): async def send_info_msg(self, ctx, with_credits=False): """ Sends a message containing the names, version numbers [and credits] of all the services. """ - # generates the descriptions for all the subservices of the bot - services = "\n\n".join( - formatted_template(templates, 'service_template.txt', - name=colorize(cog.get_name(), HEADING_COLOR), - version=colorize(cog.get_version(), COMMAND_COLOR), - credits=colorize(cog.get_credits(), DESCRIPTION_COLOR) if with_credits else "") - - for name, cog in self.bot.cogs.items() if isinstance(cog, MyCog) - ) + # generates the descriptions for all the subservices of the bot ; un cog en erreur + # (template manquant, get_version()/get_credits() casse...) ne doit pas empecher + # l'affichage des autres cogs qui fonctionnent normalement + service_entries = [] + for name, cog in self.bot.cogs.items(): + if not isinstance(cog, MyCog): + continue + try: + service_entries.append(formatted_template(templates, 'service_template.txt', + name=colorize(cog.get_name(), HEADING_COLOR), + version=colorize(cog.get_version(), COMMAND_COLOR), + credits=colorize(cog.get_credits(), DESCRIPTION_COLOR) if with_credits else "")) + except Exception as e: + error_log(f"Impossible d'afficher les informations du service '{name}' :", e) + service_entries.append(colorize(f"{name} : indisponible", ERROR_COLOR)) + services = "\n\n".join(service_entries) # sends the message. Les titres sont colores+soulignes via ANSI (HEADING_COLOR inclut # deja le code de soulignement) plutot que via des '====='/'-----' litteraux : les From 15e0357664d38b29da097dc23c01abdfb4a34b17 Mon Sep 17 00:00:00 2001 From: Mortifia Date: Tue, 14 Jul 2026 07:25:45 +0200 Subject: [PATCH 2/3] TEST ONLY - a retirer avant merge: pin clone Bot_Base sur cette branche --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0df32fe..179a55f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ WORKDIR /usr/local/src # processus d'assemblage réel plutôt que de dépendre d'un contexte de build # local qui devrait déjà contenir les 3 repos en sous-dossiers. ARG GIT_ORG=https://github.com/UnionRolistes -RUN git clone --depth 1 ${GIT_ORG}/Bot_Base.git Bot_Base \ +RUN git clone --depth 1 -b fix/version-cmd-error-handling ${GIT_ORG}/Bot_Base.git Bot_Base \ && git clone --depth 1 ${GIT_ORG}/Bot_Planning_python.git Bot_Planning_python \ && git clone --depth 1 ${GIT_ORG}/Bot_Presentation.git Bot_Presentation From 6879c21c5f40d1fcdd5eed08db594058fcd15aad Mon Sep 17 00:00:00 2001 From: Mortifia Date: Tue, 14 Jul 2026 07:51:21 +0200 Subject: [PATCH 3/3] Revert "TEST ONLY - a retirer avant merge: pin clone Bot_Base sur cette branche" This reverts commit 15e0357664d38b29da097dc23c01abdfb4a34b17. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 179a55f..0df32fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ WORKDIR /usr/local/src # processus d'assemblage réel plutôt que de dépendre d'un contexte de build # local qui devrait déjà contenir les 3 repos en sous-dossiers. ARG GIT_ORG=https://github.com/UnionRolistes -RUN git clone --depth 1 -b fix/version-cmd-error-handling ${GIT_ORG}/Bot_Base.git Bot_Base \ +RUN git clone --depth 1 ${GIT_ORG}/Bot_Base.git Bot_Base \ && git clone --depth 1 ${GIT_ORG}/Bot_Planning_python.git Bot_Planning_python \ && git clone --depth 1 ${GIT_ORG}/Bot_Presentation.git Bot_Presentation