Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use markdown for fallen admin #101

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/pycamp_bot/commands/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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):
Expand Down
Loading