Some problems with scenes
See original GitHub issueI am using scenes like what is in the tutorial. My problem is that for example in function command I want to do this:
greeterBlue.command('red', async (ctx) => {
ctx.reply("Hi")
ctx.scene.leave()
ctx.scene.enter('greeter-red')
})
But it seems that just the first line of the function executes. How can I write this to execute all three lines?
Thanks for any help.
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
5 Common Scene Struggles and How to Fix Them - Stage 32
2. Unnatural Dialogue · 1. Small Talk · 2. Inauthentic Expression · 3. Carbon-Copy Voice.
Read more >Common Problems with Scenes - GoGuardian
One or more students are being blocked by an unknown Scene or another teacher's Scene. · My Scene is not being applied to...
Read more >8 Ways to Troubleshoot a Scene-and 5 Ways Make It Fabulous
4. The Scene Lacks a Resolution ... To truly move the plot, every scene must be cohesive unit unto itself. It must have...
Read more >SCENE 25: 10 Scene Problems Solved - Darcy Pattison
Solve pesky scene problems: loss of focus, inadvertent interruptions, phony disasters, and more.
Read more >10 Solutions To 10 Common On-Set Problems | Stareable Blog
SOLUTION: Restructure the day so that the person or persons who have to leave early do all their scenes first. Sometimes, this will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just add await for each line inside the function:
greeterBlue.command('red', async (ctx) => { await ctx.reply("Hi") await ctx.scene.leave() awiat ctx.scene.enter('greeter-red') })
ctx.scene.leave()
makes currentctx.scene
inactive, isn’t it?You should use static method of the Stage class, IMHO
UPD: fixed!