= require('telegraf/stage')
const Scene = require('telegraf/scenes/base')
const scene = new Scene('getName')
scene.enter(ctx => ctx.reply('What is your name?'))
scene.on('message', ctx => ctx.reply(`Hi, ${ctx.message.text}`))
bot.command('name', Stage.enter('getName'))
const { enter, leave } = Stage
const Stage = require('telegraf/stage') const Scene = require('telegraf/scenes/base') const stage = new Stage() const scene = new Scene('get-name') scene.enter(ctx => ctx.reply('What is your name?')) scene.on('message', ctx => ctx.reply(`Hi, ${ctx.message.text}`)) stage.command('name', ctx => ctx.scene.enter('get-name')) stage.register(scene) bot.use(stage)
Обсуждают сегодня