grammyjs / menu

Interactive menus for grammY.
https://grammy.dev/plugins/menu
MIT License
31 stars 11 forks source link

feat: Allow `menu.url` to accept dynamic urls and text #26

Closed yohanesyuen closed 1 year ago

yohanesyuen commented 2 years ago

Current Signature

url(text: MaybeDynamicString<C>, url: string)

Proposed Signature

url(text: MaybeDynamicString<C>, url: MaybeDynamicString<C>)
yohanesyuen commented 2 years ago

@KnorpelSenf I notice that most of the functions takes the form func(text, ...middlewares). Will this feature require a rewrite of the core?

KnorpelSenf commented 2 years ago

@KnorpelSenf I notice that most of the functions takes the form func(text, ...middlewares). Will this feature require a rewrite of the core?

No. All we need to do is to also resolve url properties from the buttons, rather than just resolving the text properties.

KnorpelSenf commented 2 years ago

This needs to be done at https://github.com/grammyjs/menu/blob/a9818bfb35780ed5834c81e521b831753a92789e/src/menu.ts#L768 by calling uniform also for the URL.

KnorpelSenf commented 1 year ago

@yohanesyuen do you want to contribute back the changes?

KnorpelSenf commented 1 year ago

It seems like no one is willing to work on this. Note that you can already solve this problem using dynamic ranges. If anyone is willing to pick it up again, feel free to leave a comment. Closing.