Skip to content

feat: Static menus #2

@KnorpelSenf

Description

@KnorpelSenf

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.

const menu = new Menu('id', {
  static: new Menu.Range().text('go', ctx => ctx.reply('whee'))
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions