I'm trying to create a telegram bot using telegraf
I read its documentation and I just wanted to start coding using their own examples
this is the example provided in documentation:
const { Telegraf } = require('telegraf')
const bot = new Telegraf(process.env.BOT_TOKEN)
bot.start((ctx) => ctx.reply('Welcome'))
bot.help((ctx) => ctx.reply('Send me a sticker'))
bot.on('sticker', (ctx) => ctx.reply(''))
bot.hears('hi', (ctx) => ctx.reply('Hey there'))
bot.launch()
// Enable graceful stop
process.once('SIGINT', () => bot.stop('SIGINT'))
process.once('SIGTERM', () => bot.stop('SIGTERM'))
when i try to run the code,i get the following error:
PS: I have got my BOT_TOKEN
from BotFather and placed it in the .env
thanks in advance