How to open menu via code?
See original GitHub issueHi,
I have the following menu:
const projectEdit = new TelegrafInlineMenu(
async ctx => await projectController.DisplayProjectDetails(ctx, ctx.match[1])
);
projectEdit.simpleButton(ctx => ctx.i18n.t('editName'), 'EDIT_PR_NAME', {
doFunc: async ctx => {
await ctx.scene.enter('projectName-wizard');
}
});
this menu simply allow the user to edit the name of the project through ctx.scene.enter('projectName-wizard')
. So when the Wizard-Scene
is completed, that scene print the following message:
ctx.reply(ctx.i18n.t('projectUpdated'));
and then:
return pr;
where pr
is the object which contains the project. I get the following result:
[PROJECT EDIT MENU] => EDIT PROJECT NAME INSERT NEW NAME: foo Project updated!
Is possible go back to [PROJECT EDIT MENU], and so reloading the project details as did by: elegrafInlineMenu(async ctx => await projectController.DisplayProjectDetails(ctx, ctx.match[1]));
?
How can I do this?
Thanks in advance.
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Application Menu Example & Code - W3C
Application Menu Example & Code. in Menus Tutorial. Example. File. New; Open; Print. Edit.
Read more >Menus - Android Developers
For all menu types, Android provides a standard XML format to define menu items. Instead of building a menu in your activity's code,...
Read more >Android: Open menu programmatically - Stack Overflow
If you are using customized toolbar in your app, then the following way will be useful, new Handler().postDelayed(new Runnable() { @Override public void ......
Read more >How to Create Android Popup Menu Programmatically and ...
Hi and welcome to another tutorial from CodingDemos :) In this tutorial, you will learn how to create Android popup menu or floating...
Read more >Popup Menu in Android With Example - GeeksforGeeks
<? xml version = "1.0" encoding = "utf-8" ?> ... In the MainActivity.java file, we will get the reference of the Button and...
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 FreeTop 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
Top GitHub Comments
A working example is within the tests: https://github.com/EdJoPaTo/telegraf-inline-menu/blob/4120680680893ceaf7e50f696b9a4b6737825e46/test/reply-menu-middleware.ts#L59-L76
My approach of solving things is to simplify and remove as much as possible in my experimental environment. If there it is not fitting on one screen there is to much going on to understand. 😃
When I have more time I will take a look but I will only do the same: simplify everything 😉 I hope I could help 😃
hide
prevents a button to be seen or when still existing to be clicked.If you want to locked button feature you could do it yourself like this: