const Telegraf = require('telegraf') // import telegram lib
const bot = new Telegraf(process.env.BOT_TOKEN) // get the token from environment variable
bot.start((ctx) => ctx.reply('Welcome')) // display Welcome text when we start bot
bot.hears('hi', (ctx) => ctx.reply('Hey there')) // listen and handle when user type hi text
bot.launch() // startasync function interact(ctx, chatID, request){
const response = await axios({
method: "POST",
url: `https://general-runtime.voiceflow.com/state/user/${chatID}/interact`,
headers: { Authorization: process.env.VOICEFLOW_API_KEY },
data: { request }
});
}