V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ding212
V2EX  ›  Telegram

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

  •  
  •   ding212 · 2024 年 3 月 4 日 · 1049 次点击
    这是一个创建于 776 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    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()
    
    目前尚无回复
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1235 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 17:23 · PVG 01:23 · LAX 10:23 · JFK 13:23
    ♥ Do have faith in what you're doing.