简体   繁体   English

电报机器人自动固定消息

[英]Telegram bot pin a message automatically

send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage? chat_id=' + group_name + '&parse_mode=Markdown&text=' + text_to_send_in_the_group

response = requests.get(send_text)

This code works well and I am able to forward a message into my chat.此代码运行良好,我可以将消息转发到我的聊天中。 But how can I pin this latter message?但是我怎样才能固定后一条消息呢? I would like to pin it to make it even more visible.我想固定它以使其更加明显。

Best regards此致

When you send a message on success a message object is returned, save the message_id and the chat.id and use those values to pin the message with pinChatMessage当您发送成功message object,保存message_idchat.id并使用这些值通过pinChatMessage固定消息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM