use black to format the code

This commit is contained in:
Y1.Zhao 2024-03-29 11:57:33 -04:00
parent 4a40cf7695
commit 14b075491e

View File

@ -20,13 +20,14 @@ T = TypeVar("T", bound=Callable)
BOT_MESSAGE_LENGTH = 4000 BOT_MESSAGE_LENGTH = 4000
def bot_reply_first(message: Message, who: str, bot: TeleBot) -> Message: def bot_reply_first(message: Message, who: str, bot: TeleBot) -> Message:
"""Create the first reply message which make user feel the bot is working.""" """Create the first reply message which make user feel the bot is working."""
return bot.reply_to(message, return bot.reply_to(
f"*{who}* is _thinking_ \.\.\.", message, f"*{who}* is _thinking_ \.\.\.", parse_mode="MarkdownV2"
parse_mode="MarkdownV2"
) )
def bot_reply_markdown(reply_id: Message, who: str, text: str, bot: TeleBot) -> None: def bot_reply_markdown(reply_id: Message, who: str, text: str, bot: TeleBot) -> None:
""" """
reply the Markdown by take care of the message length. reply the Markdown by take care of the message length.
@ -38,7 +39,7 @@ def bot_reply_markdown(reply_id: Message, who: str, text: str, bot: TeleBot) ->
f"*{who}*:\n{telegramify_markdown.convert(text)}", f"*{who}*:\n{telegramify_markdown.convert(text)}",
chat_id=reply_id.chat.id, chat_id=reply_id.chat.id,
message_id=reply_id.message_id, message_id=reply_id.message_id,
parse_mode="MarkdownV2" parse_mode="MarkdownV2",
) )
return return
@ -48,7 +49,7 @@ def bot_reply_markdown(reply_id: Message, who: str, text: str, bot: TeleBot) ->
f"*{who}* \[1/{len(msgs)}\]:\n{telegramify_markdown.convert(msgs[0])}", f"*{who}* \[1/{len(msgs)}\]:\n{telegramify_markdown.convert(msgs[0])}",
chat_id=reply_id.chat.id, chat_id=reply_id.chat.id,
message_id=reply_id.message_id, message_id=reply_id.message_id,
parse_mode="MarkdownV2" parse_mode="MarkdownV2",
) )
for i in range(1, len(msgs)): for i in range(1, len(msgs)):
bot.reply_to( bot.reply_to(