ding212
V2EX  ›  Telegram

用 telethon 监听群消息,能监听到自己发出的消息,无法收到别人发的消息

  •  
  •   ding212 · Mar 4, 2024 · 1200 views
    This topic created in 830 days ago, the information mentioned may be changed or developed.

    有大佬能帮我看一下吗,代码如下:

    from telethon import TelegramClient,events
    import socks
    
    api_id = 000000
    api_hash = 'aaaaaaaaaaaaaaaa'
    phone='+1111111111111'
    
    with TelegramClient('anon', api_id, api_hash, proxy=(socks.HTTP, "127.0.0.1", 8234)) as client:
        @client.on(events.NewMessage)
        async def handler(event):
            print(event.message.text)
    
        client.run_until_disconnected()
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   942 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 21:27 · PVG 05:27 · LAX 14:27 · JFK 17:27
    ♥ Do have faith in what you're doing.