+379
-141
@@ -4,14 +4,25 @@ package tgapi
|
||||
// Since: Bot API 1.0
|
||||
// See https://core.telegram.org/bots/api#chat
|
||||
type Chat struct {
|
||||
ID int64 `json:"id"`
|
||||
Type ChatType `json:"type"`
|
||||
Title *string `json:"title,omitempty"`
|
||||
Username *string `json:"username,omitempty"`
|
||||
FirstName *string `json:"first_name,omitempty"`
|
||||
LastName *string `json:"last_name,omitempty"`
|
||||
IsForum *bool `json:"is_forum,omitempty"` // Since: Bot API 6.3
|
||||
IsDirectMessages *bool `json:"is_direct_messages,omitempty"` // Since: Bot API 9.2
|
||||
// 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.
|
||||
@@ -32,65 +43,146 @@ const (
|
||||
// Since: Bot API 7.5
|
||||
// See https://core.telegram.org/bots/api#chatfullinfo
|
||||
type ChatFullInfo struct {
|
||||
ID int64 `json:"id"`
|
||||
Type ChatType `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Username string `json:"username"`
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
IsForum bool `json:"is_forum"`
|
||||
IsDirectMessages bool `json:"is_direct_messages"`
|
||||
AccentColorID int `json:"accent_color_id"`
|
||||
MaxReactionCount int `json:"max_reaction_count"`
|
||||
Photo *ChatPhoto `json:"photo,omitempty"`
|
||||
ActiveUsernames []string `json:"active_usernames,omitempty"`
|
||||
Birthdate *Birthdate `json:"birthdate,omitempty"`
|
||||
// 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 *BusinessIntro `json:"business_intro,omitempty"`
|
||||
BusinessLocation *BusinessLocation `json:"business_location,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 *Chat `json:"parent_chat,omitempty"` // Since: Bot API 9.2
|
||||
// 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 []ReactionType `json:"available_reaction,omitempty"`
|
||||
// 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 *string `json:"background_custom_emoji_id,omitempty"`
|
||||
ProfileAccentColorID *int `json:"profile_accent_color_id,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 *string `json:"emoji_status_custom_emoji_id,omitempty"`
|
||||
EmojiStatusExpirationDate *int `json:"emoji_status_expiration_date,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 *string `json:"bio,omitempty"`
|
||||
HasPrivateForwards *bool `json:"has_private_forwards,omitempty"`
|
||||
HasRestrictedVoiceAndVideoMessages *bool `json:"has_restricted_voice_and_video_messages,omitempty"`
|
||||
JoinToSendMessages *bool `json:"join_to_send_messages,omitempty"`
|
||||
JoinByRequest *bool `json:"join_by_request,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 *string `json:"description,omitempty"`
|
||||
InviteLink *string `json:"invite_link,omitempty"`
|
||||
PinnedMessage *Message `json:"pinned_message,omitempty"`
|
||||
Permissions *ChatPermissions `json:"permissions,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 *bool `json:"can_send_paid_media,omitempty"`
|
||||
SlowModeDelay *int `json:"slow_mode_delay,omitempty"`
|
||||
UnrestrictedBoostCount *int `json:"unrestricted_boost_count,omitempty"`
|
||||
MessageAutoDeleteTime *int `json:"message_auto_delete_time,omitempty"`
|
||||
HasAggressiveAntiSpamEnabled *bool `json:"has_aggressive_anti_spam_enabled,omitempty"`
|
||||
HasHiddenMembers *bool `json:"has_hidden_members,omitempty"`
|
||||
HasProtectedContent *bool `json:"has_protected_content,omitempty"`
|
||||
HasVisibleHistory *bool `json:"has_visible_history,omitempty"`
|
||||
StickerSetName *string `json:"sticker_set_name,omitempty"`
|
||||
CanSetStickerSet *bool `json:"can_set_sticker_set,omitempty"`
|
||||
CustomEmojiStickerSetName *string `json:"custom_emoji_sticker_set_name,omitempty"`
|
||||
LinkedChatID *int64 `json:"linked_chat_id,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 *ChatLocation `json:"location,omitempty"`
|
||||
Rating *UserRating `json:"rating,omitempty"`
|
||||
FirstProfileAudio *Audio `json:"first_profile_audio,omitempty"` // Since: Bot API 9.4
|
||||
UniqueGiftColors *UniqueGiftColors `json:"unique_gift_colors,omitempty"` // Since: Bot API 9.3
|
||||
PaidMessageStarCount *int `json:"paid_message_star_count,omitempty"` // Since: Bot API 9.3
|
||||
// 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.
|
||||
@@ -101,58 +193,105 @@ type ChatFullInfo struct {
|
||||
// Since: Bot API 3.1
|
||||
// See https://core.telegram.org/bots/api#chatphoto
|
||||
type ChatPhoto struct {
|
||||
SmallFileID string `json:"small_file_id"`
|
||||
// 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 string `json:"big_file_id"`
|
||||
BigFileUniqueID string `json:"big_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 non‑administrator 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 bool `json:"can_send_messages"`
|
||||
CanSendAudios bool `json:"can_send_audios"` // Since: Bot API 6.5
|
||||
CanSendDocuments bool `json:"can_send_documents"` // Since: Bot API 6.5
|
||||
CanSendPhotos bool `json:"can_send_photos"` // Since: Bot API 6.5
|
||||
CanSendVideos bool `json:"can_send_videos"` // Since: Bot API 6.5
|
||||
CanSendVideoNotes bool `json:"can_send_video_notes"` // Since: Bot API 6.5
|
||||
CanSendVoiceNotes bool `json:"can_send_voice_notes"` // Since: Bot API 6.5
|
||||
CanSendPolls bool `json:"can_send_polls"`
|
||||
// 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 bool `json:"can_react_to_messages"` // Since: Bot API 10.0
|
||||
CanEditTag bool `json:"can_edit_tag"` // Since: Bot API 9.5
|
||||
CanChangeInfo bool `json:"can_change_info"`
|
||||
CanInviteUsers bool `json:"can_invite_users"`
|
||||
CanPinMessages bool `json:"can_pin_messages"`
|
||||
CanManageTopics bool `json:"can_manage_topics"` // Since: Bot API 6.3
|
||||
// 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 string `json:"address"`
|
||||
// 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 string `json:"invite_link"`
|
||||
Creator User `json:"creator"`
|
||||
CreateJoinRequest bool `json:"creates_join_request"`
|
||||
IsPrimary bool `json:"is_primary"`
|
||||
IsRevoked bool `json:"is_revoked"`
|
||||
// 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 *string `json:"name,omitempty"`
|
||||
ExpireDate *int `json:"expire_date,omitempty"`
|
||||
MemberLimit *int `json:"member_limit,omitempty"`
|
||||
PendingJoinRequestCount *int `json:"pending_join_request_count,omitempty"`
|
||||
SubscriptionPeriod *int `json:"subscription_period,omitempty"`
|
||||
SubscriptionPrice *int `json:"subscription_price,omitempty"`
|
||||
// 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.
|
||||
@@ -177,92 +316,154 @@ const (
|
||||
// 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 User `json:"user"`
|
||||
Tag string `json:"tag,omitempty"` // Since: Bot API 9.5
|
||||
// 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"`
|
||||
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 *bool `json:"can_manage_chat,omitempty"`
|
||||
CanDeleteMessages *bool `json:"can_delete_messages,omitempty"`
|
||||
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 *bool `json:"can_restrict_members,omitempty"`
|
||||
CanPromoteMembers *bool `json:"can_promote_members,omitempty"`
|
||||
CanChangeInfo *bool `json:"can_change_info,omitempty"`
|
||||
CanInviteUsers *bool `json:"can_invite_users,omitempty"`
|
||||
CanPostStories *bool `json:"can_post_stories,omitempty"` // Since: Bot API 6.9
|
||||
CanEditStories *bool `json:"can_edit_stories,omitempty"` // Since: Bot API 6.9
|
||||
CanDeleteStories *bool `json:"can_delete_stories,omitempty"` // Since: Bot API 6.9
|
||||
// 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 *bool `json:"can_post_messages,omitempty"`
|
||||
CanEditMessages *bool `json:"can_edit_messages,omitempty"`
|
||||
CanPinMessages *bool `json:"can_pin_messages,omitempty"`
|
||||
CanManageTopics *bool `json:"can_manage_topics,omitempty"` // Since: Bot API 6.3
|
||||
// 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 *bool `json:"can_manage_tags,omitempty"` // Since: Bot API 9.5
|
||||
// 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 *bool `json:"can_send_messages,omitempty"`
|
||||
CanSendAudios *bool `json:"can_send_audios,omitempty"` // Since: Bot API 6.5
|
||||
CanSendDocuments *bool `json:"can_send_documents,omitempty"` // Since: Bot API 6.5
|
||||
CanSendPhotos *bool `json:"can_send_photos,omitempty"` // Since: Bot API 6.5
|
||||
CanSendVideos *bool `json:"can_send_videos,omitempty"` // Since: Bot API 6.5
|
||||
CanSendVideoNotes *bool `json:"can_send_video_notes,omitempty"` // Since: Bot API 6.5
|
||||
CanSendVoiceNotes *bool `json:"can_send_voice_notes,omitempty"` // Since: Bot API 6.5
|
||||
CanSendPolls *bool `json:"can_send_polls,omitempty"`
|
||||
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 *bool `json:"can_react_to_messages,omitempty"` // Since: Bot API 10.0
|
||||
CanEditTag *bool `json:"can_edit_tag,omitempty"` // Since: Bot API 9.5
|
||||
// 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 User `json:"user"`
|
||||
// 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 *int `json:"prize_star_count,omitempty"`
|
||||
IsUnclaimed *bool `json:"is_unclaimed,omitempty"`
|
||||
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 string `json:"boost_id"`
|
||||
AddDate int `json:"add_date"`
|
||||
ExpirationDate int `json:"expiration_date"`
|
||||
Source ChatBoostSource `json:"source"`
|
||||
// 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"`
|
||||
}
|
||||
|
||||
@@ -270,6 +471,8 @@ type ChatBackground struct {
|
||||
// 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"`
|
||||
}
|
||||
|
||||
@@ -277,6 +480,7 @@ type ChatOwnerLeft struct {
|
||||
// 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"`
|
||||
}
|
||||
|
||||
@@ -284,31 +488,61 @@ type ChatOwnerChanged struct {
|
||||
// Since: Bot API 6.0
|
||||
// See https://core.telegram.org/bots/api#chatadministratorrights
|
||||
type ChatAdministratorRights struct {
|
||||
IsAnonymous bool `json:"is_anonymous"`
|
||||
CanManageChat bool `json:"can_manage_chat"`
|
||||
CanDeleteMessages bool `json:"can_delete_messages"`
|
||||
// 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 bool `json:"can_restrict_members"`
|
||||
CanPromoteMembers bool `json:"can_promote_members"`
|
||||
CanChangeInfo bool `json:"can_change_info"`
|
||||
CanInviteUsers bool `json:"can_invite_users"`
|
||||
CanPostStories bool `json:"can_post_stories"`
|
||||
CanEditStories bool `json:"can_edit_stories"`
|
||||
CanDeleteStories bool `json:"can_delete_stories"`
|
||||
// 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 *bool `json:"can_post_messages,omitempty"`
|
||||
CanEditMessages *bool `json:"can_edit_messages,omitempty"`
|
||||
CanPinMessages *bool `json:"can_pin_messages,omitempty"`
|
||||
CanManageTopics *bool `json:"can_manage_topics,omitempty"`
|
||||
// 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 *bool `json:"can_manage_tags,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 `json:"chat"`
|
||||
// Chat Chat which was boosted
|
||||
Chat Chat `json:"chat"`
|
||||
// Boost Information about the chat boost
|
||||
Boost ChatBoost `json:"boost"`
|
||||
}
|
||||
|
||||
@@ -316,10 +550,14 @@ type ChatBoostUpdated struct {
|
||||
// Since: Bot API 7.0
|
||||
// See https://core.telegram.org/bots/api#chatboostremoved
|
||||
type ChatBoostRemoved struct {
|
||||
Chat Chat `json:"chat"`
|
||||
BoostID string `json:"boost_id"`
|
||||
RemoveDate int `json:"remove_date"`
|
||||
Source ChatBoostSource `json:"source"`
|
||||
// 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.
|
||||
|
||||
Reference in New Issue
Block a user