Package org.drinkless.tdlib
Class TdApi.SendGift
- Enclosing class:
- TdApi
Sends a gift to another user or channel chat. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out.
Returns Ok
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Identifier uniquely determining type of the object.long
Identifier of the gift to send.boolean
Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them.Identifier of the user or the channel chat that will receive the gift.boolean
Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free.Text to show along with the gift; 0-getOption("gift_text_length_max") characters. -
Constructor Summary
ConstructorsConstructorDescriptionSendGift()
Default constructor for a function, which sends a gift to another user or channel chat.SendGift
(long giftId, TdApi.MessageSender ownerId, TdApi.FormattedText text, boolean isPrivate, boolean payForUpgrade) Creates a function, which sends a gift to another user or channel chat. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns an identifier uniquely determining type of the object.Methods inherited from class org.drinkless.tdlib.TdApi.Function
toString
-
Field Details
-
giftId
public long giftIdIdentifier of the gift to send. -
ownerId
Identifier of the user or the channel chat that will receive the gift. -
text
Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed. Must be empty if the receiver enabled paid messages. -
isPrivate
public boolean isPrivatePass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them. -
payForUpgrade
public boolean payForUpgradePass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free. -
CONSTRUCTOR
public static final int CONSTRUCTORIdentifier uniquely determining type of the object.- See Also:
-
-
Constructor Details
-
SendGift
public SendGift()Default constructor for a function, which sends a gift to another user or channel chat. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out.Returns
Ok
-
SendGift
public SendGift(long giftId, TdApi.MessageSender ownerId, TdApi.FormattedText text, boolean isPrivate, boolean payForUpgrade) Creates a function, which sends a gift to another user or channel chat. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out.Returns
Ok
- Parameters:
giftId
- Identifier of the gift to send.ownerId
- Identifier of the user or the channel chat that will receive the gift.text
- Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed. Must be empty if the receiver enabled paid messages.isPrivate
- Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them.payForUpgrade
- Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free.
-
-
Method Details
-
getConstructor
public int getConstructor()Description copied from class:TdApi.Object
Returns an identifier uniquely determining type of the object.- Specified by:
getConstructor
in classTdApi.Object
- Returns:
- this.CONSTRUCTOR
-