Options
All
  • Public
  • Public/Protected
  • All
Menu

Project telegraf.js - v4.1.2

Index

Type aliases

Middleware

Middleware<C>: MiddlewareFn<C> | MiddlewareObj<C>

Type parameters

MiddlewareFn

MiddlewareFn<C>: (ctx: C, next: () => Promise<void>) => Promise<unknown> | void

Type parameters

Type declaration

    • (ctx: C, next: () => Promise<void>): Promise<unknown> | void
    • Parameters

      • ctx: C
      • next: () => Promise<void>
          • (): Promise<void>
          • Returns Promise<void>

      Returns Promise<unknown> | void

NarrowedContext

NarrowedContext<C, U>: C & {[ P in tt.UpdateType as SnakeToCamelCase<P>]: PropOr<U, P, undefined> } & { chat: Getter<U, "chat">; from: Getter<U, "from">; senderChat: Getter<U, "sender_chat">; update: U; updateType: UpdateTypes<U> }

Narrows down C['update'] (and derived getters) to specific update type U.

Used by Composer, possibly useful for splitting a bot into multiple files.

Type parameters

Functions

deunionize

  • deunionize<T>(t: T): Deunionize<T, T>
  • Expose properties from all union variants

    Type parameters

    • T: undefined | object

    Parameters

    • t: T

    Returns Deunionize<T, T>

session

  • session<S>(options?: SessionOptions<S>): MiddlewareFn<SessionContext<S>>

Generated using TypeDoc