The provider using a polka server Polka for bot-whatsapp bot. You can apply this provider into your createProvider function.
import 'dotenv/config'
import { addKeyword, createBot, createFlow, createProvider, EVENTS, MemoryDB } from '@builderbot/bot'
import { TelegramProvider, handleCtx } from '@builderbot-plugins/telegram'
const flowWelcome = addKeyword<TelegramProvider, MemoryDB>(EVENTS.WELCOME)
.addAnswer("Hola desde telegram provider!")
const main = async () => {
let provider = createProvider(TelegramProvider, {
token: process.env.TELEGRAM_TOKEN
})
.initHttpServer(3002)
provider.http?.server.post('/webhook', handleCtx(async (bot, req, res) => {
return res.end('Hola desde telegram webhook provider!')
}))
await createBot({
database: new MemoryDB(),
provider,
flow: createFlow([flowWelcome])
})
}
main()
Elimeleth Capuano https://github.com/elimeleth