简体   繁体   English

如何使用 pytelegrambotapi 在电报聊天中获取所有固定消息?

[英]How to get all the pinned messages in a telegram chat using pytelegrambotapi?

I'm trying to retrieve all the pinned messages in telegram chat for my bot.我正在尝试为我的机器人检索电报聊天中的所有固定消息。 From the following code从以下代码

prev_message = bot.get_chat(chat_id).pinned_message.text

I am able to retrieve the recent pinned messages.我能够检索最近固定的消息。 Is there a way to obtain all of the pinned messages as an array?.有没有办法将所有固定消息作为数组获取? I'm using pytelegrambotapi for writing my bot.我正在使用pytelegrambotapi编写我的机器人。

According to official telegram bot api docs, in chat.pinned_message there is only the the last pinned message.根据官方电报机器人 api 文档,在 chat.pinned_message 中只有最后一条固定消息。

The most recent pinned message (by sending date).最近固定的消息(按发送日期)。 Returned only in getChat.仅在 getChat 中返回。

Source: https://core.telegram.org/bots/api#chat资料来源: https://core.telegram.org/bots/api#chat

So, since pyTelegramBotApi uses these http apis, I don't think you can get all the pinned messages.因此,由于 pyTelegramBotApi 使用这些 http api,我认为您无法获取所有固定消息。

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

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