FILE / ScuroNeko/Laniakea
tgapi/users_types.go
Исходный файл и его история в репозитории.
103 lines
5.2 KiB
Go
103 lines
5.2 KiB
Go
package tgapi
|
|
|
|
// User represents a Telegram user or bot.
|
|
// Since: Bot API 1.0
|
|
// See https://core.telegram.org/bots/api#user
|
|
type User struct {
|
|
// ID 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.
|
|
ID int64 `json:"id"`
|
|
// FirstName User's or bot's first name
|
|
FirstName string `json:"first_name"`
|
|
// LastName Optional. User's or bot's last name
|
|
LastName *string `json:"last_name,omitempty"`
|
|
// Username Optional. User's or bot's username
|
|
Username *string `json:"username,omitempty"`
|
|
|
|
// IsBot True, if this user is a bot
|
|
IsBot bool `json:"is_bot"` // Since: Bot API 3.3
|
|
// LanguageCode Optional. IETF language tag of the user's language
|
|
LanguageCode *string `json:"language_code,omitempty"` // Since: Bot API 3.0
|
|
// IsPremium Optional. True, if this user is a Telegram Premium user
|
|
IsPremium *bool `json:"is_premium,omitempty"` // Since: Bot API 6.1
|
|
// AddedToAttachmentMenu Optional. True, if this user added the bot to the attachment menu
|
|
AddedToAttachmentMenu *bool `json:"added_to_attachment_menu,omitempty"` // Since: Bot API 6.1
|
|
// CanJoinGroups Optional. True, if the bot can be invited to groups. Returned only in getMe.
|
|
CanJoinGroups *bool `json:"can_join_groups,omitempty"` // Since: Bot API 4.6
|
|
// CanReadAllGroupMessages Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
|
|
CanReadAllGroupMessages *bool `json:"can_read_all_group_messages,omitempty"` // Since: Bot API 4.6
|
|
// SupportsInlineQueries Optional. True, if the bot supports inline queries. Returned only in getMe.
|
|
SupportsInlineQueries *bool `json:"supports_inline_queries,omitempty"` // Since: Bot API 4.6
|
|
// CanConnectToBusiness Optional. True, if the bot can be connected to a user account to manage it. Returned
|
|
// only in getMe.
|
|
CanConnectToBusiness *bool `json:"can_connect_to_business,omitempty"` // Since: Bot API 7.2
|
|
// HasMainWebApp Optional. True, if the bot has a main Web App. Returned only in getMe.
|
|
HasMainWebApp *bool `json:"has_main_web_app,omitempty"` // Since: Bot API 7.8
|
|
// HasTopicsEnabled Optional. True, if the bot has forum topic mode enabled in private chats. Returned only
|
|
// in getMe.
|
|
HasTopicsEnabled *bool `json:"has_topics_enabled,omitempty"` // Since: Bot API 9.3
|
|
// AllowsUsersToCreateTopics Optional. True, if the bot allows users to create and delete topics in private
|
|
// chats. Returned only in getMe.
|
|
AllowsUsersToCreateTopics *bool `json:"allows_users_to_create_topics,omitempty"` // Since: Bot API 9.4
|
|
// CanManageBots Optional. True, if other bots can be created to be controlled by the bot. Returned only in
|
|
// getMe.
|
|
CanManageBots *bool `json:"can_manage_bots,omitempty"` // Since: Bot API 9.6
|
|
// SupportsGuestQueries Optional. True, if the bot supports guest queries from chats it is not a member of.
|
|
// Returned only in getMe.
|
|
SupportsGuestQueries *bool `json:"supports_guest_queries,omitempty"` // Since: Bot API 10.0
|
|
|
|
// SupportsJoinRequestQueries reports that the bot supports join request
|
|
// queries and can be assigned to process them. Returned only in getMe.
|
|
SupportsJoinRequestQueries *bool `json:"supports_join_request_queries,omitempty"` // Since: Bot API 10.1
|
|
}
|
|
|
|
// UserProfilePhotos represents a user's profile photos.
|
|
// Since: Bot API 1.4
|
|
// See https://core.telegram.org/bots/api#userprofilephotos
|
|
type UserProfilePhotos struct {
|
|
// TotalCount Total number of profile pictures the target user has
|
|
TotalCount int `json:"total_count"`
|
|
// Photos Requested profile pictures (in up to 4 sizes each)
|
|
Photos [][]PhotoSize `json:"photos"`
|
|
}
|
|
|
|
// UserProfileAudios represents a user's profile audios.
|
|
// Since: Bot API 9.3
|
|
// See https://core.telegram.org/bots/api#userprofileaudios
|
|
type UserProfileAudios struct {
|
|
// TotalCount Total number of profile audios for the target user
|
|
TotalCount int `json:"total_count"`
|
|
// Audios Requested profile audios
|
|
Audios []Audio `json:"audios"`
|
|
}
|
|
|
|
// UserRating represents a user's rating with level progression.
|
|
// Since: Bot API 9.3
|
|
// See https://core.telegram.org/bots/api#userrating
|
|
type UserRating struct {
|
|
// Level Current level of the user, indicating their reliability when purchasing digital goods and services.
|
|
// A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.
|
|
Level int `json:"level"`
|
|
// Rating Numerical value of the user's rating; the higher the rating, the better
|
|
Rating int `json:"rating"`
|
|
// CurrentLevelRating The rating value required to get the current level
|
|
CurrentLevelRating int `json:"current_level_rating"`
|
|
// NextLevelRating Optional. The rating value required to get to the next level; omitted if the maximum
|
|
// level was reached
|
|
NextLevelRating int `json:"next_level_rating"`
|
|
}
|
|
|
|
// Birthdate represents a user's birthdate.
|
|
// Since: Bot API 7.2
|
|
// See https://core.telegram.org/bots/api#birthdate
|
|
type Birthdate struct {
|
|
// Day Day of the user's birth; 1-31
|
|
Day int `json:"day"`
|
|
// Month Month of the user's birth; 1-12
|
|
Month int `json:"month"`
|
|
// Year Optional. Year of the user's birth
|
|
Year int `json:"year"`
|
|
}
|