From d21d2a60dbdd85f89ac33444e9f33fa128e2550c Mon Sep 17 00:00:00 2001 From: Mortifia Date: Mon, 13 Jul 2026 02:56:18 +0200 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20colore=20les=20messages=20s=C3=BBrs?= =?UTF-8?q?=20de=20$prez=20(#77)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Réutilise colored_message/SUCCESS_COLOR/ERROR_COLOR de Bot_Base.src.urpy.utils (ajoutés dans UnionRolistes/Bot_Base#84) pour rester cohérent avec la coloration déjà en place sur $help/$version/$credit/$lang. on_prez_link (contient une URL) et on_prez_channel_not_found/ on_prez_webhook_not_found (markdown gras/italique existant) restent volontairement en texte brut : un code block ANSI casserait leur rendu. Nécessite que UnionRolistes/Bot_Base#84 soit mergée pour que les helpers existent dans l'image buildée. Closes #77 --- src/cog_presentation/cog.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cog_presentation/cog.py b/src/cog_presentation/cog.py index dc23ea3..e992cb8 100755 --- a/src/cog_presentation/cog.py +++ b/src/cog_presentation/cog.py @@ -8,7 +8,7 @@ import cog_presentation.info from cog_presentation import strings from cog_presentation import settings -from urpy.utils import error_log +from urpy.utils import error_log, colored_message, SUCCESS_COLOR, ERROR_COLOR import pickle import os from pathlib import Path @@ -45,7 +45,7 @@ async def prez(self, ctx): # TODO fix contexts shenanigans # checks that $cal is called in the right place if isinstance(ctx.channel, discord.DMChannel): - await base_ctx.send(_(strings.on_prez_dm_channel)) + await base_ctx.send(colored_message(_(strings.on_prez_dm_channel), ERROR_COLOR)) elif isinstance(ctx.channel, discord.TextChannel): anncmnt_channel = discord.utils.get(ctx.guild.channels, name=settings.announcement_channel) if not anncmnt_channel: @@ -78,11 +78,11 @@ async def prez(self, ctx): except discord.errors.Forbidden: error_log("Impossible d'obtenir les webhooks.", # TODO change to english "Le bot nécessite la permission de gérer les webhooks") - await ctx.author.send(strings.on_permission_error) + await ctx.author.send(colored_message(strings.on_permission_error, ERROR_COLOR)) except IndexError: await ctx.send(_(strings.on_prez_webhook_not_found.format(channel=settings.announcement_channel))) else: - await ctx.send(_(strings.on_prez)) + await ctx.send(colored_message(_(strings.on_prez), SUCCESS_COLOR)) await ctx.author.send( strings.on_prez_link.format(link=f"http://presentation.unionrolistes.fr")) #?webhook={webhook.url}")) From da6c31935cc879674ac98e7e4b0f56d5d1a88802 Mon Sep 17 00:00:00 2001 From: Mortifia Date: Mon, 13 Jul 2026 03:18:26 +0200 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20ajoute=20Mortifia=20aux=20cr=C3=A9d?= =?UTF-8?q?its=20(coloration=20ANSI)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cog_presentation/info/credits.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cog_presentation/info/credits.txt b/src/cog_presentation/info/credits.txt index 2746973..51e6758 100755 --- a/src/cog_presentation/info/credits.txt +++ b/src/cog_presentation/info/credits.txt @@ -1,2 +1,3 @@ Lyss -Maestro#8364 \ No newline at end of file +Maestro#8364 +Mortifia \ No newline at end of file