Saeed Heidarizarei
Saeed Heidarizarei

Reputation: 8916

ETELEGRAM: 400 Bad Request: there is no live location in the message to edit

I Want to Send My Live Location to telegram bot users, Bot I got This Error:

ETELEGRAM: 400 Bad Request: there is no live location in the message to edit

How Should I Solve?

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

Code:

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
            }
        });

    }
});

Upvotes: 0

Views: 339

Answers (1)

Sean Wei
Sean Wei

Reputation: 7985

You need to send live location first.

Use sendLocation method with live_period, just like the following instance:

Awesome Telegram Bot

Upvotes: 1

Related Questions