'Replying to a specific msg in telegraf framework
Solution 1:[1]
The documentation for telegraf is here: https://www.npmjs.com/package/telegraf
From what I have read, this should work:
const { Telegraf } = require('telegraf')
const bot = new Telegraf(process.env.BOT_TOKEN)
bot.hears('good morning', (ctx) => ctx.reply('Good morning to you too!'))
bot.launch()
// Enable graceful stop
process.once('SIGINT', () => bot.stop('SIGINT'))
process.once('SIGTERM', () => bot.stop('SIGTERM'))
This is edited code from the first example in the docs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | codingmaster398 |

