grammy-inline-menu icon indicating copy to clipboard operation
grammy-inline-menu copied to clipboard

How do I call navigate in the code?

Open romanticsoul opened this issue 1 year ago • 1 comments

how can I make a transition to another page using return in do()

// ✅ It works
mainMenu.navigate("/item:1", {
  text: "item 1",
});

// ❌ it doesn't work (how to fix it?)
mainMenu.interact(nanoid(), {
  text: "item 2",
  do: () => "/item:2",
});

mainMenu.manualAction(/item:(\d+)/, async (ctx) => {
  await editMenuOnContext(itemMenu, ctx, "/");
  return false;
});

tried different options: /item:2, /item:2/, item:2/, ../item:2, ../item:2/

romanticsoul avatar Sep 30 '24 14:09 romanticsoul

Have you checked out How does it work on the README? Adding the suggested bot.use with a console.log can be quite helpful in order to figure out where the menu is you want to trigger manually.

As you try to trigger them starting with / it might not be on the root level so not starting with the /?

EdJoPaTo avatar Sep 30 '24 21:09 EdJoPaTo

I'll just close this due to inactivity. If you have any questions feel free to ask ahead!

EdJoPaTo avatar Oct 31 '24 17:10 EdJoPaTo