家人们,不废话,上链接:
https://github.com/lifetyper/TelegramRunAway
不骗 Star 版本:
from pyrogram import Client
from pyrogram.enums import ChatType
api_id = YOUR_APP_ID
api_hash = "YOUR_APP_HASH)"
app = Client("AnyString")
async def main():
    async with app:
        async for dialog in app.get_dialogs():
            if dialog.chat.type in [ChatType.SUPERGROUP, ChatType.GROUP]:
                print("Cleaning Messages in Group:{}...".format(dialog.chat.title))
                async for msg in app.search_messages(chat_id=dialog.chat.id, from_user="me"):
                    if msg.text:
                        print("Deleting Message Contents:{}...".format(msg.text))
                    await app.delete_messages(chat_id=dialog.chat.id, message_ids=msg.id)
app.run(main())
|  |      1Cagliostro      2022-11-30 19:34:20 +08:00 via iPhone 好东西,正好缺。 | 
|  |      2nah      2022-11-30 19:39:07 +08:00 好评。现在点赞也危险了,点赞之类的可以删吗? | 
|      3233373      2022-11-30 20:24:00 +08:00 有没有 for nodejs 版本 | 
|      4CatCode      2022-11-30 22:58:08 +08:00 有没有批量删除的 API ,一个请求一条还是太慢了 | 
|  |      5Pichai      2022-11-30 23:04:39 +08:00 telegram 的中文搜索那么辣鸡,感觉没必要担心吧! | 
|  |      6flexbug      2022-11-30 23:30:49 +08:00 via iPhone 安卓上的 nekogram 这个第三方客户端自带删除群组自己的发言 | 
|      7Rookie01      2023-04-18 16:07:34 +08:00 请问这个方法还可以用吗?为什么我的运行提示 raise AttributeError("The API key is required for new authorizations. " AttributeError: The API key is required for new authorizations. More info: https://docs.pyrogram.org/start/auth | 
|  |      8darkzack      2023-04-25 18:54:37 +08:00  1 | 
|      9Rookie01      2023-04-28 22:32:43 +08:00 @darkzack 老哥再请教一下,我按照你说的那样修改之后运行这样提示: The api_id/api_hash combination is invalid Enter phone number or bot token: 输入什么都不对,不知道是不是我当时创建 API 的时候选错选项了,好像这个 API 还不能修改和删除。 | 
|  |      10darkzack      2023-04-30 09:21:12 +08:00 via iPhone @Rookie01 这里没问题,这是要登录你的账号,要带国家号码的,跟你登录 tg 一样,例如你号码要输入+8613912345678 | 
|      11Mickeyy      2023-09-02 15:10:24 +08:00 好用,感谢。 | 
|      12Remember      2024-08-10 01:21:12 +08:00 这个还能用吗?你的 github 仓库不见了。 |