From 95c7f6d30313c230ac8ce184edcb7307a3c2f49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Delfino?= Date: Thu, 27 Jun 2024 20:34:05 -0300 Subject: [PATCH] Use markdown for fallen admin --- src/pycamp_bot/commands/auth.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pycamp_bot/commands/auth.py b/src/pycamp_bot/commands/auth.py index f652321..445f946 100644 --- a/src/pycamp_bot/commands/auth.py +++ b/src/pycamp_bot/commands/auth.py @@ -2,6 +2,7 @@ from telegram.ext import CommandHandler from pycamp_bot.models import Pycampista from pycamp_bot.logger import logger +from pycamp_bot.utils import escape_markdown def get_admins_username(): @@ -84,8 +85,11 @@ async def revoke_admin(update, context): user = Pycampista.select().where(Pycampista.username == fallen_admin)[0] user.admin = False user.save() - await context.bot.send_message(chat_id=chat_id, - text='Un admin ha caido --{}--.'.format(fallen_admin)) + await context.bot.send_message( + chat_id=chat_id, + text=f'Un admin ha caĆ­do ~{escape_markdown(fallen_admin)}~\\.', + parse_mode='MarkdownV2', + ) async def list_admins(update, context):