gpt4 book ai didi

telegram-bot - Telegram Bot 如何知道用户打开了聊天窗口?

转载 作者:行者123 更新时间:2023-12-04 04:07:31 64 4
gpt4 key购买 nike

当用户刚刚打开聊天时,机器人如何向用户发送消息。

例子:

  • 用户已经添加了 Telegram bot到他的联系人列表并开始对话
  • 稍后,用户打开与该机器人的聊天窗口
  • 机器人“看到”该用户已打开聊天窗口,但尚未写入任何内容
  • 机器人应该说“你好,有什么可以帮到你的?”给用户

  • Telegram Bot API 中的第 3 步是否有任何事件/触发器?

    最佳答案

    不。每次用户打开聊天窗口时都没有触发,但第一次如下:

    When someone opens a chat with bot "FOR THE FIRST TIME", automatically Telegram sends /start command to bot .It is like an ordinary command when user sends a command or write /start and send, so your bot can catch it and say hello or do any commands to that user. As soon as user opens the chat window with your bot, Telegrams send this message automatically to your bot containing info about user and so on.

    关于telegram-bot - Telegram Bot 如何知道用户打开了聊天窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38830013/

    64 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com