@elimeleth/telegram
v1.0.0-alpha.3
Published
An telegram provider for VaincentFlow framework
Downloads
7
Readme
Telegram provider for bot-whatsapp
The provider using a polka server Polka for bot-whatsapp bot. You can apply this provider into your createProvider function.
Usage
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()
Author
Elimeleth Capuano https://github.com/elimeleth