简体   繁体   English

Python Telegram Bot:显示新群组成员的消息历史记录

[英]Python Telegram Bot: show message history for new group members

With a python based telegram bot that should help to setup group settings I want to hide/unhide the message history for new group subscribers.使用基于 python 的电报机器人应该有助于设置组设置我想隐藏/取消隐藏新组订阅者的消息历史记录。 I am using the python-telegram-bot API wrapper (documented here ).我正在使用python-telegram-bot API 包装器(在此处记录)。

For setting other permissions there is a method Bot.set_chat_permissions() .要设置其他权限,有一种方法Bot.set_chat_permissions() But for hide/unhide message history I found no method.但是对于隐藏/取消隐藏消息历史我没有找到方法。

However, in the telegram API documentation there is an endpoint channels.togglePreHistoryHidden , that should do exactly what I want.但是,在电报 API 文档中有一个端点channels.togglePreHistoryHidden ,它应该完全符合我的要求。 But I could not figure out how to use that via python-telegram-bot .但我不知道如何通过python-telegram-bot使用它。

Another user has asked a similar question , but related to telethon .另一位用户提出了类似的问题,但与telethon有关。

Any hints are appreciated.任何提示表示赞赏。

python-telegram-bot is a wrapper for the Bot API . python-telegram-botBot API的包装器。 Only those methods listed in the API docs have a counterpart in python-telegram-bot .只有 API 文档中列出的那些方法在python-telegram-bot中有对应的方法。 The togglePreHistoryHidden method is an endpoint of the Telegram API.= Bot API. togglePreHistoryHidden方法是 Telegram API.= Bot API 的端点。


Disclaimer: I'm currently the maintainer of python-telegram-bot .免责声明:我目前是python-telegram-bot的维护者。

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

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