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

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

  •  
  •   ding212 · Mar 4, 2024 · 1077 views
    This topic created in 785 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   ·   1139 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 23:06 · PVG 07:06 · LAX 16:06 · JFK 19:06
    ♥ Do have faith in what you're doing.