leavic
V2EX  ›  Telegram

自动删除自己在 Telegram 群组内的全部发言

  •  
  •   leavic · Nov 30, 2022 · 6757 views
    This topic created in 1434 days ago, the information mentioned may be changed or developed.

    家人们,不废话,上链接:

    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())
    
    12 replies  •  2024-08-10 01:21:12 +08:00
    Cagliostro
    Cagliostro
    Nov 30, 2022 via iPhone
    1
    好东西,正好缺。
    nah
    nah
    Nov 30, 2022
    2
    好评。现在点赞也危险了,点赞之类的可以删吗?
    233373
    233373
    Nov 30, 2022
    3
    有没有 for nodejs 版本
    CatCode
    CatCode
    Nov 30, 2022
    4
    有没有批量删除的 API ,一个请求一条还是太慢了
    Pichai
    Pichai
    Nov 30, 2022
    5
    telegram 的中文搜索那么辣鸡,感觉没必要担心吧!
    flexbug
    flexbug
    Nov 30, 2022 via iPhone
    6
    安卓上的 nekogram 这个第三方客户端自带删除群组自己的发言
    Rookie01
    Rookie01
    Apr 18, 2023
    7
    请问这个方法还可以用吗?为什么我的运行提示
    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
    darkzack
    darkzack
    Apr 25, 2023❤️1
    8
    @Rookie01
    把
    app = Client("AnyString")
    改成
    app = Client("my_account", api_id=api_id, api_hash=api_hash)
    Rookie01
    Rookie01
    Apr 28, 2023
    9
    @darkzack 老哥再请教一下,我按照你说的那样修改之后运行这样提示:
    The api_id/api_hash combination is invalid
    Enter phone number or bot token:
    输入什么都不对,不知道是不是我当时创建 API 的时候选错选项了,好像这个 API 还不能修改和删除。
    darkzack
    darkzack
    Apr 30, 2023 via iPhone
    10
    @Rookie01 这里没问题,这是要登录你的账号,要带国家号码的,跟你登录 tg 一样,例如你号码要输入+8613912345678
    Mickeyy
    Mickeyy
    Sep 2, 2023
    11
    好用,感谢。
    Remember
    Remember
    Aug 10, 2024
    12
    这个还能用吗?你的 github 仓库不见了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1752 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 17:27 · PVG 01:27 · LAX 09:27 · JFK 12:27
    ♥ Do have faith in what you're doing.