![](/img/trans.png)
[英]How can I delete 'new chat members' messages in telegram group with pytelegrambotapi?
[英]How to get all the pinned messages in a telegram chat using pytelegrambotapi?
我正在尝试为我的机器人检索电报聊天中的所有固定消息。 从以下代码
prev_message = bot.get_chat(chat_id).pinned_message.text
我能够检索最近固定的消息。 有没有办法将所有固定消息作为数组获取? 我正在使用pytelegrambotapi编写我的机器人。
根据官方电报机器人 api 文档,在 chat.pinned_message 中只有最后一条固定消息。
最近固定的消息(按发送日期)。 仅在 getChat 中返回。
资料来源: https://core.telegram.org/bots/api#chat
因此,由于 pyTelegramBotApi 使用这些 http api,我认为您无法获取所有固定消息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.