Alex76
V2EX  ›  Telegram

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

  •  
  •   Alex76 · Mar 22, 2023 · 1826 views
    This topic created in 1157 days ago, the information mentioned may be changed or developed.
    大佬们,有对 TG 很熟吗,TG(telegram)最新群消息有自动通知接口吗,还是自己去定时去 pull 消息呢,哪个实现好,并且稳定
    7 replies    2023-03-22 19:40:19 +08:00
    4BVL25L90W260T9U
        1
    4BVL25L90W260T9U  
       Mar 22, 2023   ❤️ 1
    不要滥用爬虫这个词,“拉”(pull) 不更好么?
    Alex76
        2
    Alex76  
    OP
       Mar 22, 2023
    @ospider 感谢,改了
    xycool
        3
    xycool  
       Mar 22, 2023
    创建一个 bot ,把 bot 拉到群里面去就可以了。然后设置 bot 的 webhook 地址,就能收到群消息然后处理了,具体的可以看 bot 开发文档
    Alex76
        4
    Alex76  
    OP
       Mar 22, 2023
    @xycool 感谢,周末研究研究
    ongongethan
        5
    ongongethan  
       Mar 22, 2023
    使用 bot 的话, 有两种方法可以接受的消息:
    1. pull 方式,使用 getUpdates(),文档 https://core.telegram.org/bots/api#getupdates
    2. push 方式,使用 webhook ,文档 https://core.telegram.org/bots/api#setwebhook
    ongongethan
        6
    ongongethan  
       Mar 22, 2023
    @ongongethan 接受的消息 - > 接收到消息
    Alex76
        7
    Alex76  
    OP
       Mar 22, 2023
    @ongongethan 谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5335 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 07:38 · PVG 15:38 · LAX 00:38 · JFK 03:38
    ♥ Do have faith in what you're doing.