I have a simple code:
const env = require('../.env')
const Telegraf = require('telegraf')
const bot = new Telegraf(env.token)
bot.on('text', async ctx=> {
console.log(ctx.update.message.text)
await ctx.reply('Done')
})
bot.startPolling()
It’s work very well….
I have another program whose code is in VB script (http) that sends a message via the bot to a user and it works… but “bot.on” doesn’t run.
I need to read the message that the vb script sent to save it in a database, is it possible? From what I understand, “bot.on” only works with a direct iteration between the user and the bot.
New contributor
Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.