How to load dynamic voice to menu?
See original GitHub issueI have this menu:
const project = new TelegrafInlineMenu(ctx =>
ctx.reply(projectController.DisplayProjectDetails(ctx.match[1])));
const projectsHandler = new TelegrafInlineMenu(ctx => ctx.i18n.t('hereYourProjs'));
projectsHandler.setCommand('myprojects');
projectsHandler.selectSubmenu(
'PROJECTS',
async ctx => projectController.GetProjects(await ctx.getChatMember(ctx.chat.id)),
project,
{
columns: 1
}
);
essentially when I type the command “/myprojects” the controller “projectController” load all the projects available from my database as menu voice.
Now I would like to know how can I click on a voice menu (loaded from the database) and display the details of that voice. Eg:
- /mycommands
- bot load all the projects as voice menu 3 I click on a voice menu eg: “test”, the bot need to display the details of that project as a submenu and in that submenu I need to have also the back button to display again all the projects.
Could you kindly show me a little example how to do this?
Note: this method projectController.DisplayProjectDetails
just return the project object that must be displayed as submenu after clicking on it.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
android - Open Dialog via dynamic menu - Stack Overflow
Use Android Intent with Intent.ACTION_SEND . Which will share the link of .apk file on available application on device which handle SHARE Intent ......
Read more >Creating Dynamic Menus - Avaya Documentation
You must create Dynamic Menus in Control Manager after creating an IVR point from the type of Dynamic Menu . Navigate to Avaya...
Read more >Use Voice Control on your iPhone, iPad, or iPod touch
To return to a previous screen or menu, say, “Go back.” How to customize Voice Control settings. You can customize several settings under...
Read more >How to Create a Dynamic Voice and Add Personality to Your ...
Check out the tips in this post and learn how to add a dash of personality to your blogging. Make your writing voice...
Read more >Push dynamic shortcuts to Assistant - Android Developers
Define the dynamic shortcut for a menu item ... it is eligible to appear as a Voice Shortcut suggestion in the Assistant Android...
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
In general I assume you have two methods depending on your storage setup:
My approach to writing a menu is this way:
I hope it helps 😃
Thanks. Now I got what you want to achieve. In this case you already have the
project
menu?Your projectMenu has a selectSubmenu with all the projects of the user as buttons. When the user uses a button he gets into the project menu and
ctx.match[1]
contains the chosen project as you already implemented. But you should not usectx.reply
there. You have to return the text in that function so it should be like this:Also the back button is only there when you defined its text in
menu.init
like you defined the back to main menu button. See the its documentation.I hope it helps 😃