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

Allow set a function for `joinLastRow` parameter

Open sdcdsvsdv423 opened this issue 4 years ago • 6 comments

In some complicated cases I need to display a button on the same or on the next row depending on context. Now the joinLastRow parameter has boolean type and it's impossible to set value dynamically.

It would be nice if this parameter has ContextPathFunc<Context, boolean> type (the same as hide parameter).

sdcdsvsdv423 avatar Apr 21 '21 03:04 sdcdsvsdv423

Interesting idea. Not sure if that's easy or messy to add. I will look into it when I find the time.

EdJoPaTo avatar Apr 21 '21 06:04 EdJoPaTo

The joinLastRow parameter is used on startup to create the keyboard structure. It is not used afterwards. Which means… refactoring that will be messy / not as simple.

https://github.com/EdJoPaTo/telegraf-inline-menu/blob/ff9823cac16dd646e412669ba3aa28a4d3203bf1/source/keyboard.ts#L37-L46

EdJoPaTo avatar Apr 21 '21 12:04 EdJoPaTo

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar May 22 '21 04:05 stale[bot]