EdJoPaTo / grammy-inline-menu

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

Error: Choices can not contain '/'. #160

Closed ghost closed 3 years ago

ghost commented 3 years ago

Use it as string in choise arr, but wtf?

EdJoPaTo commented 3 years ago

Thanks for providing an issue on something that is unclear.

This library assumes the position within the menu from the callback data and uses the / as delimiter. If you would use the / for things that are not submenus the position within the menu can not be determined anymore. That's why this character is not allowed. This is explained in more detail in the README: How does it work. On a filesystem this is similar as the / also isn't allowed in filenames. It is used to separate folder names.

You can temporary replace it with something your usecase does not include. Later you can replace it back to the /. For example early versions of this library used : as delimiter and time (hh:mm) include : but never -.

Hope it helps to understand the reason behind this.

ghost commented 3 years ago

Okay, thank u for resonsing.