如何在 Telegram Bot 上禁用网页预览

Iru*_*uPC 4 python python-3.x telegram telegram-bot

这是我用来向用户发送回复的示例代码(Python Telegram Bot)

        conf_mes = await e.reply(
            f"<a href='https://URL'>My Text</a>/n/n ..Description..",
            parse_mode="html",
            buttons=buts,
        )
Run Code Online (Sandbox Code Playgroud)

当机器人向用户发送消息时,如何禁用网页预览!

小智 9

在sendMessage方法中添加该参数

disable_web_page_preview=True
Run Code Online (Sandbox Code Playgroud)