简体   繁体   中英

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.

According to official telegram bot api docs, in chat.pinned_message there is only the the last pinned message.

The most recent pinned message (by sending date). Returned only in getChat.

Source: 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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