TelegrafRouter
Session based routing for your telegraf.js telegram bot
Installation
npm install telegraf-router --save
or using yarn
yarn add telegraf
const Router getCBData getMessage = ;const Telegraf = ;const session = const routes = path: "start" { await router; return true; } path: "select-action" children: path: "" { await ctx; return true; } path: "/form" children: path: "/register" children: children: path: '' { await ctx return true; } path: "/message" { await ctx return true; } path: "cancel" { if !ctxsessionuserfio || !ctxsessionuserphone await router; return true; await router; return true; } module{ console const bot = tgKey; bot bot bot routes { ctx; } ; await bot;}