ultra-telegram-framework
    Preparing search index...

    Class InlineMenu<C>

    Class for creating interactive Inline menus.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Registers a handler for inline button clicks (callback_query).

      Parameters

      • actionName: string | RegExp

        String or regular expression to check callback_data

      • ...middlewares: Middleware<C>[]

        Functions that will be executed on a match

      Returns this

    • Registers a handler for a specific command (or an array of commands).

      Parameters

      • command: string | string[]

        Command name without the slash (e.g., 'start' or ['start', 'help'])

      • ...middlewares: Middleware<C>[]

        Functions that will be executed if the command matches

      Returns this

    • Registers a handler for text messages that match a string or regular expression.

      Parameters

      • triggers: string | RegExp | (string | RegExp)[]

        String or regular expression (or array of them) to match against the text

      • ...middlewares: Middleware<NarrowedContext<C, "text">>[]

        Functions that will be executed on a match

      Returns this

    • Registers a handler that will trigger under certain conditions (update type, presence of a field or entity).

      Type Parameters

      Parameters

      • filter: F | F[]

        Field name or array of names (e.g., 'photo', 'document', 'callback_query')

      • ...middlewares: Middleware<NarrowedContext<C, F>>[]

        Handler functions that will be executed on a match

      Returns this

    • Add a page to the menu

      Parameters

      • id: string

        Unique page ID

      • renderer: MenuPageRender<C>

        Function that returns text and keyboard

      • Optionaloptions: MenuPageOptions

        Page settings (e.g., Back button)

      Returns this

    • Magic engine: collects an array of middlewares into a single execution chain. When one middleware calls next(), this function triggers the next one.

      Type Parameters

      Parameters

      Returns Middleware<C>