ultra-telegram-framework
    Preparing search index...

    Class Composer<C>

    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

    • Returns all handlers registered in this class as one large function. Wrapped in try...catch to intercept errors.

      Returns Middleware<C>

    • 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

    • Adds a general handler or an ENTIRE MODULE (another Composer).

      Parameters

      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>