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

大佬们,有对 TG 很熟吗, TG(telegram)最新群消息有自动通知接口吗,还是自己去定时去 pull 呢

  •  
  •   Alex76 · 69 天前 · 562 次点击
    这是一个创建于 69 天前的主题,其中的信息可能已经有所发展或是发生改变。
    大佬们,有对 TG 很熟吗,TG(telegram)最新群消息有自动通知接口吗,还是自己去定时去 pull 消息呢,哪个实现好,并且稳定
    7 条回复    2023-03-22 19:40:19 +08:00
    ospider
        1
    ospider  
       69 天前   ❤️ 1
    不要滥用爬虫这个词,“拉”(pull) 不更好么?
    Alex76
        2
    Alex76  
    OP
       69 天前
    @ospider 感谢,改了
    xycool
        3
    xycool  
       69 天前
    创建一个 bot ,把 bot 拉到群里面去就可以了。然后设置 bot 的 webhook 地址,就能收到群消息然后处理了,具体的可以看 bot 开发文档
    Alex76
        4
    Alex76  
    OP
       69 天前
    @xycool 感谢,周末研究研究
    ongongethan
        5
    ongongethan  
       69 天前
    使用 bot 的话, 有两种方法可以接受的消息:
    1. pull 方式,使用 getUpdates(),文档 https://core.telegram.org/bots/api#getupdates
    2. push 方式,使用 webhook ,文档 https://core.telegram.org/bots/api#setwebhook
    ongongethan
        6
    ongongethan  
       69 天前
    @ongongethan 接受的消息 - > 接收到消息
    Alex76
        7
    Alex76  
    OP
       69 天前
    @ongongethan 谢谢
    关于   ·   帮助文档   ·   博客   ·   nftychat   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   829 人在线   最高记录 5634   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 21:55 · PVG 05:55 · LAX 14:55 · JFK 17:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.