【问题标题】:How to quote a message using telegram bot reply?如何使用电报机器人回复引用消息?
【发布时间】:2020-08-27 07:15:46
【问题描述】:

我有一个机器人,它运行良好。但是如何引用触发机器人的消息,以便用户知道机器人回复了他?

这是我用来返回消息的代码。

return res.status(200).send({
    method: 'sendMessage',
    chat_id,
    text: `Hello, welcome to <bot_name>`,
    parse_mode: 'Markdown'
})

我想在回复中这样引用该消息:

【问题讨论】:

    标签: node.js typescript firebase telegram telegram-bot


    【解决方案1】:

    使用sendMessagereply_to_message_id 设置为您要回复的原始消息ID。

    return res.status(200).send({
        method: 'sendMessage',
        chat_id,
        reply_to_message_id: messageIdtoReply,
        text: `Hello, welcome to <bot_name>`,
        parse_mode: 'Markdown'
    })
    

    参考:https://core.telegram.org/bots/api#sendmessage

    【讨论】:

    • 感谢您的回答,我一整天都在尝试这样做,但文档中似乎有错误,因为他们说使用了reply_to_message,但正确的形式是reply_to_message_id
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-10-19
    • 2022-11-10
    • 1970-01-01
    • 2020-08-01
    • 2020-08-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多