I'm trying to set up a bot using the node-telegram-bot-API, I have created the bot instance as follows in Foo.js
const TelegramBot = require('node-telegram-bot-api');
const bot = new TelegramBot(config.telegram.TELEGRAM_TOKEN, {polling: true});
module.exports = bot;
I want the bot instance to be used with its methods in Bar.js as-
const bot = require('path/to/Foo');
bot.sendMessage(config.telegram.CHAT_ID, info.message);
However, it throws an error saying TypeError: bot.sendMessage is not a function