Closed Marcuuu closed 2 years ago
or
update line
const token = process.env.TOKEN;
as
const token = process.env.TOKEN || /*<put your token here>*/;
In my case this worked
And also when deploying to heroku long polling method won't work as heroku dynos will shutdown when bot is inactive for some period of time
So insted of using long polling , use webhook method
I have provided the token over here.
`require('dotenv').config(); const TelegramBot = require('node-telegram-bot-api'); const moment = require('moment');
const token = process.env.TOKEN;
const bot = new TelegramBot(token, { polling: true });`
However, after deploying into Heroku, the logs tells me that I did not provide the token to the bot.