Class SharedUser

Hierarchy (view full)

Constructors

Properties

firstName?: string

First name of the user, if the name was requested by the bot

lastName?: string

Last name of the user, if the name was requested by the bot

photo?: Photo[]

Available sizes of the chat photo, if the photo was requested by the bot

userId: string

Identifier of the shared user. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.

username?: string

Username of the user, if the username was requested by the bot

Accessors

Methods

  • Parameters

    • data: SharedUser

      Data about the contains information about a user that was shared with the bot using a KeyboardButtonRequestUser button

    Returns SharedUser

  • 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

  • Use this method to get a list of profile pictures for a user.

    Parameters

    • Optionaloffset: number

      Sequential number of the first photo to be returned. By default, all photos are returned

    • Optionallimit: number

      Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100

    Returns Promise<UserProfilePhotos>

    Returns a UserProfilePhotos object.

  • Refunds a successful payment in Telegram Stars.

    Parameters

    • telegramPaymentId: string

      Telegram payment identifier

    Returns Promise<true>

    Returns True on success.

  • Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change).

    Parameters

    Returns Promise<true>

    Returns True on success.