使用带有HTML模式的Telegram Messenger API发送在线照片

问题描述 投票:0回答:1

我正在使用Python创建Telegram Messenger的机器人。

我正在使用以下功能:

def telegram_bot_sendtexHTML(bot_message):

    bot_token = 'token'
    bot_chatID = 'id'
    send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse_mode=HTML&text=' + bot_message
    response = requests.get(send_text)

    return response.json()

我有一个要使用此功能发送的在线图像列表(带有URL链接。)>

例如:https://media.wordpress.com/picture1.jpg

如何在我的函数中插入此lik,以便能够直接发送图片(而不是图片的链接?)>

我正在使用Python为Telegram Messenger创建机器人。我正在使用以下功能:def telegram_bot_sendtexHTML(bot_message):bot_token ='token'bot_chatID ='id'send_text ='...

python python-3.x telegram telegram-bot python-telegram-bot
1个回答
1
投票
我已经将您的telegram_bot_sendtexHTML功能更改为telegram_bot_sendImage;
© www.soinside.com 2019 - 2024. All rights reserved.