Skip to content

Commit

Permalink
Simplify the markup statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Flagro committed Nov 5, 2024
1 parent 3860d55 commit de4b75f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bot/telegram/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,15 @@ async def send_message(
parse_mode: ParseMode = ParseMode.HTML,
keyboard: Optional[KeyboardResponse] = None,
) -> None:
markup = None
if keyboard:
markup = get_paginated_list_keyboard(
markup = (
None
if not keyboard
else get_paginated_list_keyboard(
value_id_to_name=keyboard.modes_dict,
callback=keyboard.callback,
button_action=keyboard.button_action,
)
)
return await context.bot.send_message(
chat_id=chat_id,
text=text,
Expand Down

0 comments on commit de4b75f

Please sign in to comment.