diff --git a/handlers/_utils.py b/handlers/_utils.py index 23c6ef4..1de9db8 100644 --- a/handlers/_utils.py +++ b/handlers/_utils.py @@ -59,7 +59,7 @@ def bot_reply_markdown( REPLY_MESSAGE_CACHE[cache_key] = text if len(text.encode("utf-8")) <= BOT_MESSAGE_LENGTH or not split_text: bot.edit_message_text( - f"*{who}*:\n{telegramify_markdown.convert(text)}", + f"*{who}*:\n{telegramify_markdown.markdownify(text)}", chat_id=reply_id.chat.id, message_id=reply_id.message_id, parse_mode="MarkdownV2", @@ -70,7 +70,7 @@ def bot_reply_markdown( # Need a split of message msgs = smart_split(text, BOT_MESSAGE_LENGTH) bot.edit_message_text( - f"*{who}* \[1/{len(msgs)}\]:\n{telegramify_markdown.convert(msgs[0])}", + f"*{who}* \[1/{len(msgs)}\]:\n{telegramify_markdown.markdownify(msgs[0])}", chat_id=reply_id.chat.id, message_id=reply_id.message_id, parse_mode="MarkdownV2", @@ -79,7 +79,7 @@ def bot_reply_markdown( for i in range(1, len(msgs)): bot.reply_to( reply_id.reply_to_message, - f"*{who}* \[{i + 1}/{len(msgs)}\\]:\n{telegramify_markdown.convert(msgs[i])}", + f"*{who}* \[{i + 1}/{len(msgs)}\\]:\n{telegramify_markdown.markdownify(msgs[i])}", parse_mode="MarkdownV2", ) diff --git a/handlers/summary/__init__.py b/handlers/summary/__init__.py index d3271b4..1f573ef 100644 --- a/handlers/summary/__init__.py +++ b/handlers/summary/__init__.py @@ -65,7 +65,7 @@ def summary_command(message: Message, bot: TeleBot): ) reply_text = f"""*πŸ‘‡ 前情提要 πŸ‘‡ \\({since.strftime("%Y/%m/%d %H:%M")} \\- {now.strftime("%Y/%m/%d %H:%M")}\\)* -{telegramify_markdown.convert(response.choices[0].message.content)} +{telegramify_markdown.markdownify(response.choices[0].message.content)} """ logger.debug("Generated summary:\n%s", reply_text) bot.edit_message_text( @@ -116,7 +116,7 @@ def search_command(message: Message, bot: TeleBot): for msg in messages: link = f"https://t.me/c/{chat_id}/{msg.message_id}" items.append(f"{link}\n```\n{msg.content}\n```") - message_text = telegramify_markdown.convert("\n".join(items)) + message_text = telegramify_markdown.markdownify("\n".join(items)) bot.reply_to( message, f"πŸ” *ζœη΄’η»“ζžœ(εͺζ˜Ύη€Ίε‰ {limit} δΈͺ):*\n{message_text}",