feat: Static menus
- Dominant language
- TypeScript
- Stars
- 35
- Forks
- 14
- Avg merge
- 6h 39m
- Merged PRs (30d)
- 2
Description
Menus cannot be sent via `bot.api` because they require an installed API transformer. This transformer is only installed during `bot.use(menu)`.
One way would be to directly provide the API transformer to be installed on `bot.api`, but this does not follow the intuitive pattern of the rest of the plugin.
Instead, it would be cool if we can have a statically rendered version of the menu (a menu range) that can be passed to the constructor of the menu. Whenever the menu is sent (the internal `Proxy` is accessed), this static menu is rendered and sent. It obviously may not depend on a context object, so we should throw an error if someone tries to use dynamic strings/dynamic ranges.
```ts
const menu = new Menu('id', {
static: new Menu.Range().text('go', ctx => ctx.reply('whee'))
})
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.