Documentation - v0.27.0
    Preparing search index...
    • Send a star gift to a user.

      Note: this method is not indended to be used by full-fledged clients, as this method hides the actual invoice and payment form from the user. For GUI clients, you should refer to the method's source code and present the payment form to the user.

      Parameters

      • client: ITelegramClient
      • params: {
            anonymous?: boolean;
            gift: Long | StarGift;
            message?: InputText;
            peerId: InputPeerLike;
            shouldDispatch?: true;
            withUpgrade?: boolean;
        }
        • Optionalanonymous?: boolean

          Whether to send the gift anonymously (i.e. if the recipient chooses to display the gift on their profile, your name won't be visible)

        • gift: Long | StarGift

          ID of the gift to send

        • Optionalmessage?: InputText

          Message to send along with the gift

        • peerId: InputPeerLike

          ID of the peer to send the gift to

        • OptionalshouldDispatch?: true

          Whether to dispatch the new message event to the client's update handler.

        • OptionalwithUpgrade?: boolean

          Whether to automatically upgrade the gift to a unique star gift

      Returns Promise<Message | null>

      Service message about the sent gift, if one was generated.