I need to call a method of a class which should not be instantiated again, since it causes an error.
In main.js:
var telegram = require('./telegram.js');
telegram.hello();
In telegram.js
const bot = new TelegramBot(token, {polling: true});
function hello(req) {
console.log("hello!!");
}
module.exports.hello = hello;
The error is to instantiate the telegram bot twice:
Conflict: terminated by other long poll or webhook