Telegraf: How can leave a scene without command?

Created on 26 Feb 2018  路  1Comment  路  Source: telegraf/telegraf

Hi
I try leave a scene in this codes :
scene.leave((ctx)=>console.log('leave')) scene.on('text',({reply})=>{ reply('bye'); leave('join'); })
And
scene.on('text',({reply})=>{ reply('bye'); },leave())
But they doesn't work.
So how can leave a stage after many instructions in a function?

Most helpful comment

I see source code and find that with ctx can do it.
ctx.scene.leave()
or
ctx.scene.leave('<sceneName>')

>All comments

I see source code and find that with ctx can do it.
ctx.scene.leave()
or
ctx.scene.leave('<sceneName>')

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Stephirio picture Stephirio  路  3Comments

Blaumaus picture Blaumaus  路  3Comments

aminjoharinia picture aminjoharinia  路  3Comments

ghost picture ghost  路  3Comments

trgwii picture trgwii  路  3Comments