sendGift

inline fun sendGift(userId: Long, giftId: String, textParseMode: ParseMode? = null, noinline text: () -> String? = null): SendGiftAction

Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success.

Api reference

Parameters

userId

Unique identifier of the target user that will receive the gift

giftId

Identifier of the gift

text

Text that will be shown along with the gift; 0-255 characters

textParseMode

Mode for parsing entities in the text. See formatting options for more details. Entities other than "bold", "italic", "underline", "strikethrough", "spoiler", and "custom_emoji" are ignored.

textEntities

A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than "bold", "italic", "underline", "strikethrough", "spoiler", and "custom_emoji" are ignored.