ding212
V2EX  ›  Telegram

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

  •  
  •   ding212 · Mar 4, 2024 · 1179 views
    This topic created in 818 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   ·   1028 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 18:11 · PVG 02:11 · LAX 11:11 · JFK 14:11
    ♥ Do have faith in what you're doing.