User

@Serializable
data class User(val id: Long, val isBot: Boolean, val firstName: String, val lastName: String? = null, val username: String? = null, val languageCode: String? = null, val isPremium: Boolean? = null, val addedToAttachmentMenu: Boolean? = null, val canJoinGroups: Boolean? = null, val canReadAllGroupMessages: Boolean? = null, val supportsInlineQueries: Boolean? = null, val canConnectToBusiness: Boolean? = null)

This object represents a Telegram user or bot.

Api reference

Constructors

Link copied to clipboard
constructor(id: Long, isBot: Boolean, firstName: String, lastName: String? = null, username: String? = null, languageCode: String? = null, isPremium: Boolean? = null, addedToAttachmentMenu: Boolean? = null, canJoinGroups: Boolean? = null, canReadAllGroupMessages: Boolean? = null, supportsInlineQueries: Boolean? = null, canConnectToBusiness: Boolean? = null)

Properties

Link copied to clipboard

Optional. True, if this user added the bot to the attachment menu

Link copied to clipboard

Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe.

Link copied to clipboard
val canJoinGroups: Boolean? = null

Optional. True, if the bot can be invited to groups. Returned only in getMe.

Link copied to clipboard

Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.

Link copied to clipboard

User's or bot's first name

Link copied to clipboard
val id: Long

Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

Link copied to clipboard

True, if this user is a bot

Link copied to clipboard
val isPremium: Boolean? = null

Optional. True, if this user is a Telegram Premium user

Link copied to clipboard
val languageCode: String? = null

Optional. IETF language tag of the user's language

Link copied to clipboard
val lastName: String? = null

Optional. User's or bot's last name

Link copied to clipboard

Optional. True, if the bot supports inline queries. Returned only in getMe.

Link copied to clipboard
val username: String? = null

Optional. User's or bot's username