Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow set a function for joinLastRow parameter #151

Open
esindger opened this issue Apr 21, 2021 · 3 comments
Open

Allow set a function for joinLastRow parameter #151

esindger opened this issue Apr 21, 2021 · 3 comments
Labels
enhancement New feature or request pinned Prevent from automatically closing due to inactivity

Comments

@esindger
Copy link

esindger commented Apr 21, 2021

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).

@esindger esindger added the enhancement New feature or request label Apr 21, 2021
@EdJoPaTo
Copy link
Owner

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

@EdJoPaTo
Copy link
Owner

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

@stale

This comment was marked as off-topic.

@stale stale bot added the stale Has no activity and will be closed soon label May 22, 2021
@EdJoPaTo EdJoPaTo added pinned Prevent from automatically closing due to inactivity and removed stale Has no activity and will be closed soon labels May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned Prevent from automatically closing due to inactivity
Projects
None yet
Development

No branches or pull requests

2 participants