Class ShippingQuery

Hierarchy (view full)

Constructors

Properties

author: User

User who sent the query

id: string

Unique query identifier

invoicePayload: string

Bot specified invoice payload.

shippingAddress: {
    city: string;
    countryCode: string;
    postCode: string;
    state: string;
    streetLine1: string;
    streetLine2: string;
}

User specified shipping address

Type declaration

  • city: string
    • City
  • countryCode: string
    • Two-letter ISO 3166-1 alpha-2 country code
  • postCode: string
    • Address post code
  • state: string
    • State, if applicable
  • streetLine1: string
    • First line for the address
  • streetLine2: string
    • Second line for the address

Accessors

Methods

  • Protected

    Creates a clone of the current instance

    Returns Base

    A clone of the current instance

  • Protected

    Patches the current instance with new data

    Parameters

    • data: Record<string, any>

      The data to patch the instance with

    Returns Record<string, any>

    The patched data

  • Protected

    Updates the current instance with new data and returns a clone of the updated instance

    Parameters

    • data: Record<string, any>

      The data to update the instance with

    Returns Base

    A clone of the updated instance

  • If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries.

    Parameters

    • ok: boolean

      Pass True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)

    • Optionaloptions: Omit<{
          errorMessage?: string;
          ok: boolean;
          shippingOptions?: readonly ShippingOption[];
          shippingQueryId: string;
      }, "ok" | "shippingQueryId">

      out parameters

    Returns Promise<true>

    On success, True is returned.

  • Flatten an object. Any properties that are collections will get converted to an array of keys.

    Parameters

    • OptionalpropsRecursive: boolean

      Optional. If true, calls toJSON method on nested objects.

    • Rest...props: Record<string, string | boolean>[]

      Optional. Specific properties to include/exclude, or rename.

    Returns Record<string, any>

    Flattened object.

  • Returns the id instance Chat, User, ChatMember and other

    Returns null | string