Search code examples
javascriptnode.jstelegram-botnode-telegram-bot-api

Telegram Bot Live Location via node.js


How Can I send telegram bot live location?

I'm using node-telegram-bot-api Module.

Code:
This Code just Send a Location

    await bot.sendLocation(msg.chat.id, 35.804819, 51.434070);

Solution

  • Solved.

    bot.onText(/\/livelocation/, async  msg => {
        await bot.sendLocation(msg.chat.id, 35.804819, 51.434070, {
            live_period: 86400,
        });
    });