FILE / ScuroNeko/Laniakea

tgapi/chat_types.go

Исходный файл и его история в репозитории.
FILE dev
Files
ScuroNeko 29b208eeec
Golang lint / lint (push) Successful in 11m32s
(new): v1.2 release
2026-08-19 14:58:25 +03:00

585 lines
32 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package tgapi
// Chat represents a chat (private, group, supergroup, channel).
// Since: Bot API 1.0
// See https://core.telegram.org/bots/api#chat
type Chat struct {
// ID Unique identifier for this chat. 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 signed 64-bit integer or double-precision float type are safe for storing this
// identifier.
ID int64 `json:"id"`
// Type Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
Type ChatType `json:"type"`
// Title Optional. Title, for supergroups, channels and group chats
Title *string `json:"title,omitempty"`
// Username Optional. Username, for private chats, supergroups and channels if available
Username *string `json:"username,omitempty"`
// FirstName Optional. First name of the other party in a private chat
FirstName *string `json:"first_name,omitempty"`
// LastName Optional. Last name of the other party in a private chat
LastName *string `json:"last_name,omitempty"`
// IsForum Optional. True, if the supergroup chat is a forum (has topics enabled)
IsForum *bool `json:"is_forum,omitempty"` // Since: Bot API 6.3
// IsDirectMessages Optional. True, if the chat is the direct messages chat of a channel
IsDirectMessages *bool `json:"is_direct_messages,omitempty"` // Since: Bot API 9.2
}
// ChatType represents the type of a chat.
type ChatType string
const (
// ChatTypePrivate identifies a private chat.
ChatTypePrivate ChatType = "private"
// ChatTypeGroup identifies a basic group chat.
ChatTypeGroup ChatType = "group"
// ChatTypeSupergroup identifies a supergroup chat.
ChatTypeSupergroup ChatType = "supergroup"
// ChatTypeChannel identifies a channel chat.
ChatTypeChannel ChatType = "channel"
)
// ChatFullInfo contains full information about a chat.
// Since: Bot API 7.5
// See https://core.telegram.org/bots/api#chatfullinfo
type ChatFullInfo struct {
// ID Unique identifier for this chat. 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 signed 64-bit integer or double-precision float type are safe for storing this
// identifier.
ID int64 `json:"id"`
// Type Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
Type ChatType `json:"type"`
// Title Optional. Title, for supergroups, channels and group chats
Title string `json:"title"`
// Username Optional. Username, for private chats, supergroups and channels if available
Username string `json:"username"`
// FirstName Optional. First name of the other party in a private chat
FirstName string `json:"first_name"`
// LastName Optional. Last name of the other party in a private chat
LastName string `json:"last_name"`
// IsForum Optional. True, if the supergroup chat is a forum (has topics enabled)
IsForum bool `json:"is_forum"`
// IsDirectMessages Optional. True, if the chat is the direct messages chat of a channel
IsDirectMessages bool `json:"is_direct_messages"`
// AccentColorID Identifier of the accent color for the chat name and backgrounds of the chat photo, reply
// header, and link preview. See accent colors for more details.
AccentColorID int `json:"accent_color_id"`
// MaxReactionCount The maximum number of reactions that can be set on a message in the chat
MaxReactionCount int `json:"max_reaction_count"`
// Photo Optional. Chat photo
Photo *ChatPhoto `json:"photo,omitempty"`
// ActiveUsernames Optional. If non-empty, the list of all active chat usernames; for private chats,
// supergroups and channels
ActiveUsernames []string `json:"active_usernames,omitempty"`
// Birthdate Optional. For private chats, the date of birth of the user
Birthdate *Birthdate `json:"birthdate,omitempty"`
// BusinessIntro Optional. For private chats with business accounts, the intro of the business
BusinessIntro *BusinessIntro `json:"business_intro,omitempty"`
// BusinessLocation Optional. For private chats with business accounts, the location of the business
BusinessLocation *BusinessLocation `json:"business_location,omitempty"`
// BusinessOpeningHours Optional. For private chats with business accounts, the opening hours of the
// business
BusinessOpeningHours *BusinessOpeningHours `json:"business_opening_hours,omitempty"`
// PersonalChat Optional. For private chats, the personal channel of the user
PersonalChat *Chat `json:"personal_chat,omitempty"`
// ParentChat Optional. Information about the corresponding channel chat; for direct messages chats only
ParentChat *Chat `json:"parent_chat,omitempty"` // Since: Bot API 9.2
// AvailableReaction Optional. List of available reactions allowed in the chat. If omitted, then all emoji
// reactions are allowed.
// Subject to change in v2: the Go field name may be pluralized to AvailableReactions.
AvailableReaction []ReactionType `json:"available_reactions,omitempty"`
// BackgroundCustomEmojiID Optional. Custom emoji identifier of the emoji chosen by the chat for the reply
// header and link preview background
BackgroundCustomEmojiID *string `json:"background_custom_emoji_id,omitempty"`
// ProfileAccentColorID Optional. Identifier of the accent color for the chat's profile background. See
// profile accent colors for more details.
ProfileAccentColorID *int `json:"profile_accent_color_id,omitempty"`
// ProfileBackgroundCustomEmojiID Optional. Custom emoji identifier of the emoji chosen by the chat for its
// profile background
ProfileBackgroundCustomEmojiID *string `json:"profile_background_custom_emoji_id,omitempty"`
// EmojiStatusCustomEmojiID Optional. Custom emoji identifier of the emoji status of the chat or the other
// party in a private chat
EmojiStatusCustomEmojiID *string `json:"emoji_status_custom_emoji_id,omitempty"`
// EmojiStatusExpirationDate Optional. Expiration date of the emoji status of the chat or the other party in
// a private chat, in Unix time, if any
EmojiStatusExpirationDate *int `json:"emoji_status_expiration_date,omitempty"`
// Bio Optional. Bio of the other party in a private chat
Bio *string `json:"bio,omitempty"`
// HasPrivateForwards Optional. True, if privacy settings of the other party in the private chat allows to
// use tg://user?id=<user_id> links only in chats with the user
HasPrivateForwards *bool `json:"has_private_forwards,omitempty"`
// HasRestrictedVoiceAndVideoMessages Optional. True, if the privacy settings of the other party restrict
// sending voice and video note messages in the private chat
HasRestrictedVoiceAndVideoMessages *bool `json:"has_restricted_voice_and_video_messages,omitempty"`
// JoinToSendMessages Optional. True, if users need to join the supergroup before they can send messages
JoinToSendMessages *bool `json:"join_to_send_messages,omitempty"`
// JoinByRequest Optional. True, if all users directly joining the supergroup without using an invite link
// need to be approved by supergroup administrators
JoinByRequest *bool `json:"join_by_request,omitempty"`
// Description Optional. Description, for groups, supergroups and channel chats
Description *string `json:"description,omitempty"`
// InviteLink Optional. Primary invite link, for groups, supergroups and channel chats
InviteLink *string `json:"invite_link,omitempty"`
// PinnedMessage Optional. The most recent pinned message (by sending date)
PinnedMessage *Message `json:"pinned_message,omitempty"`
// Permissions Optional. Default chat member permissions, for groups and supergroups
Permissions *ChatPermissions `json:"permissions,omitempty"`
// AcceptedGiftTypes Information about types of gifts that are accepted by the chat or by the corresponding
// user for private chats
AcceptedGiftTypes *AcceptedGiftTypes `json:"accepted_gift_types,omitempty"`
// CanSendPaidMedia Optional. True, if paid media messages can be sent or forwarded to the channel chat. The
// field is available only for channel chats.
CanSendPaidMedia *bool `json:"can_send_paid_media,omitempty"`
// SlowModeDelay Optional. For supergroups, the minimum allowed delay between consecutive messages sent by
// each unprivileged user; in seconds
SlowModeDelay *int `json:"slow_mode_delay,omitempty"`
// UnrestrictedBoostCount is the number of unrestricted boosts available to the chat.
UnrestrictedBoostCount *int `json:"unrestricted_boost_count,omitempty"`
// MessageAutoDeleteTime Optional. The time after which all messages sent to the chat will be automatically
// deleted; in seconds
MessageAutoDeleteTime *int `json:"message_auto_delete_time,omitempty"`
// HasAggressiveAntiSpamEnabled Optional. True, if aggressive anti-spam checks are enabled in the
// supergroup. The field is only available to chat administrators.
HasAggressiveAntiSpamEnabled *bool `json:"has_aggressive_anti_spam_enabled,omitempty"`
// HasHiddenMembers Optional. True, if non-administrators can only get the list of bots and administrators
// in the chat
HasHiddenMembers *bool `json:"has_hidden_members,omitempty"`
// HasProtectedContent Optional. True, if messages from the chat can't be forwarded to other chats
HasProtectedContent *bool `json:"has_protected_content,omitempty"`
// HasVisibleHistory Optional. True, if new chat members will have access to old messages; available only to
// chat administrators
HasVisibleHistory *bool `json:"has_visible_history,omitempty"`
// StickerSetName Optional. For supergroups, name of the group sticker set
StickerSetName *string `json:"sticker_set_name,omitempty"`
// CanSetStickerSet Optional. True, if the bot can change the group sticker set
CanSetStickerSet *bool `json:"can_set_sticker_set,omitempty"`
// CustomEmojiStickerSetName Optional. For supergroups, the name of the group's custom emoji sticker set.
// Custom emoji from this set can be used by all users and bots in the group.
CustomEmojiStickerSetName *string `json:"custom_emoji_sticker_set_name,omitempty"`
// LinkedChatID Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a
// channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits
// and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller
// than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this
// identifier.
LinkedChatID *int64 `json:"linked_chat_id,omitempty"`
// Location Optional. For supergroups, the location to which the supergroup is connected
Location *ChatLocation `json:"location,omitempty"`
// Rating Optional. For private chats, the rating of the user if any
Rating *UserRating `json:"rating,omitempty"`
// FirstProfileAudio Optional. For private chats, the first audio added to the profile of the user
FirstProfileAudio *Audio `json:"first_profile_audio,omitempty"` // Since: Bot API 9.4
// UniqueGiftColors Optional. The color scheme based on a unique gift that must be used for the chat's name,
// message replies and link previews
UniqueGiftColors *UniqueGiftColors `json:"unique_gift_colors,omitempty"` // Since: Bot API 9.3
// PaidMessageStarCount Optional. The number of Telegram Stars a general user has to pay to send a message
// to the chat
PaidMessageStarCount *int `json:"paid_message_star_count,omitempty"` // Since: Bot API 9.3
// GuardBot contains the guard bot visible to chat administrators.
GuardBot *User `json:"guard_bot,omitempty"` // Since: Bot API 10.1; visible to chat administrators only
// Community contains information about the affected community.
Community *Community `json:"community,omitempty"` // Since: Bot API 10.2
}
// ChatPhoto represents a chat photo.
// Since: Bot API 3.1
// See https://core.telegram.org/bots/api#chatphoto
type ChatPhoto struct {
// SmallFileID File identifier of small (160x160) chat photo. This file_id can be used only for photo
// download and only for as long as the photo is not changed.
SmallFileID string `json:"small_file_id"`
// SmallFileUniqueID Unique file identifier of small (160x160) chat photo, which is supposed to be the same
// over time and for different bots. Can't be used to download or reuse the file.
SmallFileUniqueID string `json:"small_file_unique_id"`
// BigFileID File identifier of big (640x640) chat photo. This file_id can be used only for photo download
// and only for as long as the photo is not changed.
BigFileID string `json:"big_file_id"`
// BigFileUniqueID Unique file identifier of big (640x640) chat photo, which is supposed to be the same over
// time and for different bots. Can't be used to download or reuse the file.
BigFileUniqueID string `json:"big_file_unique_id"`
}
// ChatPermissions describes actions that a nonadministrator user is allowed to take in a chat.
// Since: Bot API 4.4
// See https://core.telegram.org/bots/api#chatpermissions
type ChatPermissions struct {
// CanSendMessages Optional. True, if the user is allowed to send text messages, rich messages, contacts,
// giveaways, giveaway winners, invoices, locations and venues
CanSendMessages bool `json:"can_send_messages"`
// CanSendAudios Optional. True, if the user is allowed to send audios
CanSendAudios bool `json:"can_send_audios"` // Since: Bot API 6.5
// CanSendDocuments Optional. True, if the user is allowed to send documents
CanSendDocuments bool `json:"can_send_documents"` // Since: Bot API 6.5
// CanSendPhotos Optional. True, if the user is allowed to send photos
CanSendPhotos bool `json:"can_send_photos"` // Since: Bot API 6.5
// CanSendVideos Optional. True, if the user is allowed to send videos
CanSendVideos bool `json:"can_send_videos"` // Since: Bot API 6.5
// CanSendVideoNotes Optional. True, if the user is allowed to send video notes
CanSendVideoNotes bool `json:"can_send_video_notes"` // Since: Bot API 6.5
// CanSendVoiceNotes Optional. True, if the user is allowed to send voice notes
CanSendVoiceNotes bool `json:"can_send_voice_notes"` // Since: Bot API 6.5
// CanSendPolls Optional. True, if the user is allowed to send polls and checklists
CanSendPolls bool `json:"can_send_polls"`
// CanSendOtherMessages Optional. True, if the user is allowed to send animations, games, stickers and use
// inline bots
CanSendOtherMessages bool `json:"can_send_other_messages"`
// CanAddWebPagePreview Optional. True, if the user is allowed to add web page previews to their messages
CanAddWebPagePreview bool `json:"can_add_web_page_previews"`
// CanReactToMessages Optional. True, if the user is allowed to react to messages. If omitted, defaults to
// the value of can_send_messages.
CanReactToMessages bool `json:"can_react_to_messages"` // Since: Bot API 10.0
// CanEditTag Optional. True, if the user is allowed to edit their own tag. If omitted, defaults to the
// value of can_pin_messages.
CanEditTag bool `json:"can_edit_tag"` // Since: Bot API 9.5
// CanChangeInfo Optional. True, if the user is allowed to change the chat title, photo and other settings.
// Ignored in public supergroups.
CanChangeInfo bool `json:"can_change_info"`
// CanInviteUsers Optional. True, if the user is allowed to invite new users to the chat
CanInviteUsers bool `json:"can_invite_users"`
// CanPinMessages Optional. True, if the user is allowed to pin messages. Ignored in public supergroups.
CanPinMessages bool `json:"can_pin_messages"`
// CanManageTopics Optional. True, if the user is allowed to create forum topics. If omitted, defaults to
// the value of can_pin_messages.
CanManageTopics bool `json:"can_manage_topics"` // Since: Bot API 6.3
}
// ChatLocation represents a location to which a chat is connected.
// Since: Bot API 5.0
// See https://core.telegram.org/bots/api#chatlocation
type ChatLocation struct {
// Location The location to which the supergroup is connected. Can't be a live location.
Location Location `json:"location"`
// Address Location address; 1-64 characters, as defined by the chat owner
Address string `json:"address"`
}
// ChatInviteLink represents an invite link for a chat.
// Since: Bot API 5.1
// See https://core.telegram.org/bots/api#chatinvitelink
type ChatInviteLink struct {
// InviteLink The invite link. If the link was created by another chat administrator, then the second part
// of the link will be replaced with “…”.
InviteLink string `json:"invite_link"`
// Creator Creator of the link
Creator User `json:"creator"`
// CreateJoinRequest True, if users joining the chat via the link need to be approved by chat administrators
CreateJoinRequest bool `json:"creates_join_request"`
// IsPrimary True, if the link is primary
IsPrimary bool `json:"is_primary"`
// IsRevoked True, if the link is revoked
IsRevoked bool `json:"is_revoked"`
// Name Optional. Invite link name
Name *string `json:"name,omitempty"`
// ExpireDate Optional. Point in time (Unix timestamp) when the link will expire or has been expired
ExpireDate *int `json:"expire_date,omitempty"`
// MemberLimit Optional. The maximum number of users that can be members of the chat simultaneously after
// joining the chat via this invite link; 1-99999
MemberLimit *int `json:"member_limit,omitempty"`
// PendingJoinRequestCount Optional. Number of pending join requests created using this link
PendingJoinRequestCount *int `json:"pending_join_request_count,omitempty"`
// SubscriptionPeriod Optional. The number of seconds the subscription will be active for before the next
// payment
SubscriptionPeriod *int `json:"subscription_period,omitempty"`
// SubscriptionPrice Optional. The amount of Telegram Stars a user must pay initially and after each
// subsequent subscription period to be a member of the chat using the link
SubscriptionPrice *int `json:"subscription_price,omitempty"`
}
// ChatMemberStatusType indicates the status of a chat member.
type ChatMemberStatusType string
const (
// ChatMemberStatusOwner identifies a chat owner.
ChatMemberStatusOwner ChatMemberStatusType = "owner"
// ChatMemberStatusAdministrator identifies a chat administrator.
ChatMemberStatusAdministrator ChatMemberStatusType = "administrator"
// ChatMemberStatusMember identifies a regular member.
ChatMemberStatusMember ChatMemberStatusType = "member"
// ChatMemberStatusRestricted identifies a restricted member.
ChatMemberStatusRestricted ChatMemberStatusType = "restricted"
// ChatMemberStatusLeft identifies a user who left the chat.
ChatMemberStatusLeft ChatMemberStatusType = "left"
// ChatMemberStatusBanned identifies a banned user.
ChatMemberStatusBanned ChatMemberStatusType = "kicked"
)
// ChatMember contains information about one member of a chat.
// Since: Bot API 3.1
// See https://core.telegram.org/bots/api#chatmember
type ChatMember struct {
// Status is the member's current status in the chat.
Status ChatMemberStatusType `json:"status"`
// User Information about the user
User User `json:"user"`
// Tag Optional. Tag of the member
Tag string `json:"tag,omitempty"` // Since: Bot API 9.5
// IsAnonymous True, if the user's presence in the chat is hidden
// Owner
IsAnonymous *bool `json:"is_anonymous"`
// CustomTitle Optional. Custom title for this user
CustomTitle *string `json:"custom_title,omitempty"`
// CanBeEdited True, if the bot is allowed to edit administrator privileges of that user
// Administrator
CanBeEdited *bool `json:"can_be_edited,omitempty"`
// CanManageChat True, if the administrator can access the chat event log, get boost list, see hidden
// supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat
// without paying Telegram Stars. Implied by any other administrator privilege.
CanManageChat *bool `json:"can_manage_chat,omitempty"`
// CanDeleteMessages True, if the administrator can delete messages of other users
CanDeleteMessages *bool `json:"can_delete_messages,omitempty"`
// CanManageVideoChats True, if the administrator can manage video chats
CanManageVideoChats *bool `json:"can_manage_video_chats,omitempty"`
// CanRestrictMembers True, if the administrator can restrict, ban or unban chat members, or access
// supergroup statistics
CanRestrictMembers *bool `json:"can_restrict_members,omitempty"`
// CanPromoteMembers True, if the administrator can add new administrators with a subset of their own
// privileges or demote administrators that they have promoted, directly or indirectly (promoted by
// administrators that were appointed by the user)
CanPromoteMembers *bool `json:"can_promote_members,omitempty"`
// CanChangeInfo True, if the user is allowed to change the chat title, photo and other settings
CanChangeInfo *bool `json:"can_change_info,omitempty"`
// CanInviteUsers True, if the user is allowed to invite new users to the chat
CanInviteUsers *bool `json:"can_invite_users,omitempty"`
// CanPostStories True, if the administrator can post stories to the chat
CanPostStories *bool `json:"can_post_stories,omitempty"` // Since: Bot API 6.9
// CanEditStories True, if the administrator can edit stories posted by other users, post stories to the
// chat page, pin chat stories, and access the chat's story archive
CanEditStories *bool `json:"can_edit_stories,omitempty"` // Since: Bot API 6.9
// CanDeleteStories True, if the administrator can delete stories posted by other users
CanDeleteStories *bool `json:"can_delete_stories,omitempty"` // Since: Bot API 6.9
// CanPostMessages Optional. True, if the administrator can post messages in the channel, approve suggested
// posts, or access channel statistics; for channels only
CanPostMessages *bool `json:"can_post_messages,omitempty"`
// CanEditMessages Optional. True, if the administrator can edit messages of other users and can pin
// messages; for channels only
CanEditMessages *bool `json:"can_edit_messages,omitempty"`
// CanPinMessages reports whether the member may pin messages.
CanPinMessages *bool `json:"can_pin_messages,omitempty"`
// CanManageTopics reports whether the member may manage forum topics.
CanManageTopics *bool `json:"can_manage_topics,omitempty"` // Since: Bot API 6.3
// CanManageDirectMessages Optional. True, if the administrator can manage direct messages of the channel
// and decline suggested posts; for channels only
CanManageDirectMessages *bool `json:"can_manage_direct_messages,omitempty"` // Since: Bot API 9.1
// CanManageTags Optional. True, if the administrator can edit the tags of regular members; for groups and
// supergroups only. If omitted, defaults to the value of can_pin_messages.
CanManageTags *bool `json:"can_manage_tags,omitempty"` // Since: Bot API 9.5
// UntilDate is the Unix time when restrictions expire; zero means forever.
// Member
UntilDate *int `json:"until_date,omitempty"`
// IsMember True, if the user is a member of the chat at the moment of the request
// Restricted
IsMember *bool `json:"is_member,omitempty"`
// CanSendMessages True, if the user is allowed to send text messages, rich messages, contacts, giveaways,
// giveaway winners, invoices, locations and venues
CanSendMessages *bool `json:"can_send_messages,omitempty"`
// CanSendAudios True, if the user is allowed to send audios
CanSendAudios *bool `json:"can_send_audios,omitempty"` // Since: Bot API 6.5
// CanSendDocuments True, if the user is allowed to send documents
CanSendDocuments *bool `json:"can_send_documents,omitempty"` // Since: Bot API 6.5
// CanSendPhotos True, if the user is allowed to send photos
CanSendPhotos *bool `json:"can_send_photos,omitempty"` // Since: Bot API 6.5
// CanSendVideos True, if the user is allowed to send videos
CanSendVideos *bool `json:"can_send_videos,omitempty"` // Since: Bot API 6.5
// CanSendVideoNotes True, if the user is allowed to send video notes
CanSendVideoNotes *bool `json:"can_send_video_notes,omitempty"` // Since: Bot API 6.5
// CanSendVoiceNotes True, if the user is allowed to send voice notes
CanSendVoiceNotes *bool `json:"can_send_voice_notes,omitempty"` // Since: Bot API 6.5
// CanSendPolls True, if the user is allowed to send polls and checklists
CanSendPolls *bool `json:"can_send_polls,omitempty"`
// CanSendOtherMessages True, if the user is allowed to send animations, games, stickers and use inline bots
CanSendOtherMessages *bool `json:"can_send_other_messages,omitempty"`
// CanAddWebPagePreview True, if the user is allowed to add web page previews to their messages
CanAddWebPagePreview *bool `json:"can_add_web_page_previews,omitempty"`
// CanReactToMessages True, if the user is allowed to react to messages
CanReactToMessages *bool `json:"can_react_to_messages,omitempty"` // Since: Bot API 10.0
// CanEditTag True, if the user is allowed to edit their own tag
CanEditTag *bool `json:"can_edit_tag,omitempty"` // Since: Bot API 9.5
}
// ChatBoostSource describes the source of a chat boost.
// Since: Bot API 7.0
// See https://core.telegram.org/bots/api#chatboostsource
type ChatBoostSource struct {
// Source identifies the source variant: premium, gift_code, or giveaway.
Source string `json:"source"`
// User is the user responsible for the boost when supplied by the source variant.
User User `json:"user"`
// GiveawayMessageID Identifier of a message in the chat with the giveaway; the message could have been
// deleted already. May be 0 if the message isn't sent yet.
// Giveaway
GiveawayMessageID *int `json:"giveaway_message_id,omitempty"`
// PrizeStarCount Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram
// Star giveaways only
PrizeStarCount *int `json:"prize_star_count,omitempty"`
// IsUnclaimed Optional. True, if the giveaway was completed, but there was no user to win the prize
IsUnclaimed *bool `json:"is_unclaimed,omitempty"`
}
// ChatBoost represents a boost added to a chat.
// Since: Bot API 7.0
// See https://core.telegram.org/bots/api#chatboost
type ChatBoost struct {
// BoostID Unique identifier of the boost
BoostID string `json:"boost_id"`
// AddDate Point in time (Unix timestamp) when the chat was boosted
AddDate int `json:"add_date"`
// ExpirationDate Point in time (Unix timestamp) when the boost will automatically expire, unless the
// booster's Telegram Premium subscription is prolonged
ExpirationDate int `json:"expiration_date"`
// Source Source of the added boost
Source ChatBoostSource `json:"source"`
}
// UserChatBoosts represents a list of boosts a user has given to a chat.
// Since: Bot API 7.0
// See https://core.telegram.org/bots/api#userchatboosts
type UserChatBoosts struct {
// Boosts The list of boosts added to the chat by the user
Boosts []ChatBoost `json:"boosts"`
}
// ChatBoostAdded describes a service message about a user boosting a chat.
// Since: Bot API 7.1
type ChatBoostAdded struct {
// BoostCount Number of boosts added by the user
BoostCount int `json:"boost_count"`
}
// ChatBackground represents a chat background.
// Since: Bot API 7.5
type ChatBackground struct {
// Type Type of the background
Type BackgroundType `json:"type"`
}
// ChatOwnerLeft describes a service message about a chat owner leaving.
// Since: Bot API 9.4
// See https://core.telegram.org/bots/api#chatownerleft
type ChatOwnerLeft struct {
// NewOwner Optional. The user who will become the new owner of the chat if the previous owner does not
// return to the chat
NewOwner *User `json:"new_owner,omitempty"`
}
// ChatOwnerChanged describes a service message about a chat owner change.
// Since: Bot API 9.4
// See https://core.telegram.org/bots/api#chatownerchanged
type ChatOwnerChanged struct {
// NewOwner The new owner of the chat
NewOwner User `json:"new_owner"`
}
// ChatAdministratorRights represents the rights of an administrator in a chat.
// Since: Bot API 6.0
// See https://core.telegram.org/bots/api#chatadministratorrights
type ChatAdministratorRights struct {
// IsAnonymous True, if the user's presence in the chat is hidden
IsAnonymous bool `json:"is_anonymous"`
// CanManageChat True, if the administrator can access the chat event log, get boost list, see hidden
// supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat
// without paying Telegram Stars. Implied by any other administrator privilege.
CanManageChat bool `json:"can_manage_chat"`
// CanDeleteMessages True, if the administrator can delete messages of other users
CanDeleteMessages bool `json:"can_delete_messages"`
// CanManageVideoChats True, if the administrator can manage video chats
CanManageVideoChats bool `json:"can_manage_video_chats"`
// CanRestrictMembers True, if the administrator can restrict, ban or unban chat members, or access
// supergroup statistics
CanRestrictMembers bool `json:"can_restrict_members"`
// CanPromoteMembers True, if the administrator can add new administrators with a subset of their own
// privileges or demote administrators that they have promoted, directly or indirectly (promoted by
// administrators that were appointed by the user)
CanPromoteMembers bool `json:"can_promote_members"`
// CanChangeInfo True, if the user is allowed to change the chat title, photo and other settings
CanChangeInfo bool `json:"can_change_info"`
// CanInviteUsers True, if the user is allowed to invite new users to the chat
CanInviteUsers bool `json:"can_invite_users"`
// CanPostStories True, if the administrator can post stories to the chat
CanPostStories bool `json:"can_post_stories"`
// CanEditStories True, if the administrator can edit stories posted by other users, post stories to the
// chat page, pin chat stories, and access the chat's story archive
CanEditStories bool `json:"can_edit_stories"`
// CanDeleteStories True, if the administrator can delete stories posted by other users
CanDeleteStories bool `json:"can_delete_stories"`
// CanPostMessages Optional. True, if the administrator can post messages in the channel, approve suggested
// posts, or access channel statistics; for channels only
CanPostMessages *bool `json:"can_post_messages,omitempty"`
// CanEditMessages Optional. True, if the administrator can edit messages of other users and can pin
// messages; for channels only
CanEditMessages *bool `json:"can_edit_messages,omitempty"`
// CanPinMessages Optional. True, if the user is allowed to pin messages; for groups and supergroups only
CanPinMessages *bool `json:"can_pin_messages,omitempty"`
// CanManageTopics Optional. True, if the user is allowed to create, rename, close, and reopen forum topics;
// for supergroups only
CanManageTopics *bool `json:"can_manage_topics,omitempty"`
// CanManageDirectMessages Optional. True, if the administrator can manage direct messages of the channel
// and decline suggested posts; for channels only
CanManageDirectMessages *bool `json:"can_manage_direct_messages,omitempty"`
// CanManageTags Optional. True, if the administrator can edit the tags of regular members; for groups and
// supergroups only. If omitted, defaults to the value of can_pin_messages.
CanManageTags *bool `json:"can_manage_tags,omitempty"`
}
// ChatBoostUpdated represents a boost added to a chat or changed.
// Since: Bot API 7.0
// See https://core.telegram.org/bots/api#chatboostupdated
type ChatBoostUpdated struct {
// Chat Chat which was boosted
Chat Chat `json:"chat"`
// Boost Information about the chat boost
Boost ChatBoost `json:"boost"`
}
// ChatBoostRemoved represents a boost removed from a chat.
// Since: Bot API 7.0
// See https://core.telegram.org/bots/api#chatboostremoved
type ChatBoostRemoved struct {
// Chat Chat which was boosted
Chat Chat `json:"chat"`
// BoostID Unique identifier of the boost
BoostID string `json:"boost_id"`
// RemoveDate Point in time (Unix timestamp) when the boost was removed
RemoveDate int `json:"remove_date"`
// Source Source of the removed boost
Source ChatBoostSource `json:"source"`
}
// Community represents a group of chats.
//
// Since: Bot API 10.2
type Community struct {
// ID uniquely identifies the value within its containing object.
ID int64 `json:"id"`
// Name is the user-facing or reference name of the value.
Name string `json:"name"`
}
// CommunityChatAdded describes a service message about a chat joining a community.
//
// Since: Bot API 10.2
type CommunityChatAdded struct {
// Community contains information about the affected community.
Community Community `json:"community"`
}
// CommunityChatRemoved describes a service message about a chat leaving a community.
//
// Since: Bot API 10.2
type CommunityChatRemoved struct{}