V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
ding212
V2EX  ›  Telegram

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

  •  
  •   ding212 · Mar 4, 2024 · 1113 views
    This topic created in 798 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   ·   5188 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 05:39 · PVG 13:39 · LAX 22:39 · JFK 01:39
    ♥ Do have faith in what you're doing.