recast.ai middleware for Telegraf
recast.ai middleware for Telegraf. Easily create Telegram bots with Natural Language Processing.
Installation
$ npm install telegraf-recast
Example
const Telegraf = const TelegrafAI = const app = processenvBOT_TOKENconst recast = processenvRECASTAI_TOKEN // Add recast.ai middlewareapp // Intent handlerrecast
API
TelegrafAI.new(token)
Initialize new TelegrafAI.
Param | Type | Description |
---|---|---|
token | string |
Recast request access token |
TelegrafAI.on(name, fn, [fn, ...])
Adds intent handlers to app
Param | Type | Description |
---|---|---|
name | string |
Intent name |
fn | function |
Intent handler middleware |
User context
Telegraf user context props and functions:
recast