Skip to content

Commit e5513c4

Browse files
authored
Merge pull request #101 from andresdelfino/fallen_admin_markdown
Use markdown for fallen admin
2 parents 6020071 + 95c7f6d commit e5513c4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/pycamp_bot/commands/auth.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from telegram.ext import CommandHandler
33
from pycamp_bot.models import Pycampista
44
from pycamp_bot.logger import logger
5+
from pycamp_bot.utils import escape_markdown
56

67

78
def get_admins_username():
@@ -84,8 +85,11 @@ async def revoke_admin(update, context):
8485
user = Pycampista.select().where(Pycampista.username == fallen_admin)[0]
8586
user.admin = False
8687
user.save()
87-
await context.bot.send_message(chat_id=chat_id,
88-
text='Un admin ha caido --{}--.'.format(fallen_admin))
88+
await context.bot.send_message(
89+
chat_id=chat_id,
90+
text=f'Un admin ha caído ~{escape_markdown(fallen_admin)}~\\.',
91+
parse_mode='MarkdownV2',
92+
)
8993

9094

9195
async def list_admins(update, context):

0 commit comments

Comments
 (0)