【问题标题】:ETELEGRAM: 400 Bad Request: there is no live location in the message to editETELEGRAM:400 错误请求:消息中没有要编辑的实时位置
【发布时间】:2017-12-25 22:26:59
【问题描述】:

我想将我的实时位置发送给电报机器人用户,机器人我收到了这个错误:

ETELEGRAM:400 错误请求:消息中没有要编辑的实时位置

我应该如何解决?

模块: (https://github.com/yagop/node-telegram-bot-api)

代码:

bot.on('callback_query', msg => {
    if (msg.data == `ourlivelocation`) {
        bot.editMessageLiveLocation(32.2624884, 53.4246188, {
            parse_mode: 'Markdown',
            message_id: msg.message.message_id,
            chat_id: msg.message.chat.id,
            reply_markup: {
                inline_keyboard: livelocationKeyboard
            }
        });

    }
});

【问题讨论】:

  • livelocationKeyboard在哪里?
  • const livelocationKeyboard = [[{ text: `????????`, callback_data: `en` }]] ,我不知道该怎么解决!
  • 发送位置码在哪里

标签: javascript telegram-bot


【解决方案1】:

您需要先发送实时位置。

sendLocation 方法与live_period 一起使用,就像下面的实例一样:

【讨论】:

  • 如果用户没有主动请求机器人,我认为用户的 ID 不能做一些有用的事情,但最好从图片,以防万一……
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-03-08
  • 2017-05-13
  • 2013-07-21
  • 1970-01-01
  • 1970-01-01
  • 2015-03-08
  • 2020-08-16
相关资源
最近更新 更多