Firebase session for Telegraf
Firebase powered session middleware for Telegraf.
Installation
$ npm install telegraf-session-firebase
Example
const Telegraf = const firebaseSession = const admin = const serviceAccount = adminconst database = admin const bot = processenvBOT_TOKENbotbotbotbot
API
Options
property
: context property name (default:session
)getSessionKey
: session key resolver function (default:(ctx) => any
)
Default implementation of getSessionKey
:
{ if !ctxfrom || !ctxchat return return `/`}
Destroying a session
To destroy a session simply set it to null
.
bot