EdJoPaTo / grammy-inline-menu

Inline Menus for Telegram made simple. Successor of telegraf-inline-menu.
MIT License
357 stars 44 forks source link

Navigate to submenus while keeping body text #206

Closed harshithmohan closed 1 year ago

harshithmohan commented 1 year ago

Describe your goal I want to be able to navigate to sub menus but keep the message body intact. Similar to how submenus work in the menu plugin. I'm loading the message body using an API and don't want to call it multiple times while navigating through sub menus. Is there a way that this can be done?

Expected I couldn't find a way in the documentation to be able to do this or I'm just reading it correctly.

EdJoPaTo commented 1 year ago

This library only displays what you respond to the given functions so it does not cache anything. I am assuming the menu plugin only changes the keyboard of a message which this library does not offer. But you can do caching of requests yourself which is probably a good idea anyway when the API call shouldnt be done more often than necessary.

I hope this helps?

harshithmohan commented 1 year ago

Thanks! Yes, I was thinking the same. To cache as an alternative if the feature didn't exist. Anyway, glad to know I wasn't just not reading things correctly.