2022-04-26 00:02:51 +08:00
|
|
|
package models
|
|
|
|
|
2022-04-29 17:21:42 +08:00
|
|
|
// ChatJoinRequest https://core.telegram.org/bots/api#chatjoinrequest
|
2022-04-26 00:02:51 +08:00
|
|
|
type ChatJoinRequest struct {
|
|
|
|
Chat Chat `json:"chat"`
|
|
|
|
From User `json:"from"`
|
2023-02-06 15:54:44 +08:00
|
|
|
UserChatID int64 `json:"user_chat_id"`
|
2022-04-26 00:02:51 +08:00
|
|
|
Date int `json:"date"`
|
|
|
|
Bio string `json:"bio,omitempty"`
|
|
|
|
InviteLink *ChatInviteLink `json:"invite_link,omitempty"`
|
|
|
|
}
|
|
|
|
|
2022-04-29 17:21:42 +08:00
|
|
|
// ChatPhoto https://core.telegram.org/bots/api#chatphoto
|
2022-04-26 00:02:51 +08:00
|
|
|
type ChatPhoto struct {
|
|
|
|
SmallFileID string `json:"small_file_id"`
|
|
|
|
SmallFileUniqueID string `json:"small_file_unique_id"`
|
|
|
|
BigFileID string `json:"big_file_id"`
|
|
|
|
BigFileUniqueID string `json:"big_file_unique_id"`
|
|
|
|
}
|
|
|
|
|
2022-04-29 17:21:42 +08:00
|
|
|
// ChatInviteLink https://core.telegram.org/bots/api#chatinvitelink
|
2022-04-26 00:02:51 +08:00
|
|
|
type ChatInviteLink struct {
|
|
|
|
InviteLink string `json:"invite_link"`
|
|
|
|
Creator User `json:"creator"`
|
|
|
|
CreatesJoinRequest bool `json:"creates_join_request"`
|
|
|
|
IsPrimary bool `json:"is_primary"`
|
|
|
|
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"`
|
|
|
|
}
|
|
|
|
|
2022-04-29 17:21:42 +08:00
|
|
|
// ChatAdministratorRights 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"`
|
|
|
|
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"`
|
|
|
|
CanPostMessages bool `json:"can_post_messages,omitempty"`
|
|
|
|
CanEditMessages bool `json:"can_edit_messages,omitempty"`
|
|
|
|
CanPinMessages bool `json:"can_pin_messages,omitempty"`
|
2023-09-28 18:57:02 +08:00
|
|
|
CanPostStories bool `json:"can_post_stories,omitempty"`
|
|
|
|
CanEditStories bool `json:"can_edit_stories,omitempty"`
|
|
|
|
CanDeleteStories bool `json:"can_delete_stories,omitempty"`
|
2022-11-06 00:31:41 +08:00
|
|
|
CanManageTopics bool `json:"can_manage_topics,omitempty"`
|
2022-04-29 17:21:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ChatPermissions https://core.telegram.org/bots/api#chatpermissions
|
|
|
|
type ChatPermissions struct {
|
|
|
|
CanSendMessages bool `json:"can_send_messages,omitempty"`
|
2023-02-06 15:54:44 +08:00
|
|
|
CanSendAudios bool `json:"can_send_audios"`
|
|
|
|
CanSendDocuments bool `json:"can_send_documents"`
|
|
|
|
CanSendPhotos bool `json:"can_send_photos"`
|
|
|
|
CanSendVideos bool `json:"can_send_videos"`
|
|
|
|
CanSendVideoNotes bool `json:"can_send_video_notes"`
|
|
|
|
CanSendVoiceNotes bool `json:"can_send_voice_notes"`
|
2022-04-29 17:21:42 +08:00
|
|
|
CanSendPolls bool `json:"can_send_polls,omitempty"`
|
|
|
|
CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"`
|
|
|
|
CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"`
|
|
|
|
CanChangeInfo bool `json:"can_change_info,omitempty"`
|
|
|
|
CanInviteUsers bool `json:"can_invite_users,omitempty"`
|
|
|
|
CanPinMessages bool `json:"can_pin_messages,omitempty"`
|
2022-11-06 00:31:41 +08:00
|
|
|
CanManageTopics bool `json:"can_manage_topics,omitempty"`
|
2022-04-29 17:21:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ChatLocation https://core.telegram.org/bots/api#chatlocation
|
|
|
|
type ChatLocation struct {
|
|
|
|
Location Location `json:"location"`
|
|
|
|
Address string `json:"address"`
|
|
|
|
}
|
|
|
|
|
2024-04-02 23:09:36 +08:00
|
|
|
type Birthdate struct {
|
|
|
|
Day int `json:"day"`
|
|
|
|
Month int `json:"month"`
|
|
|
|
Year int `json:"year,omitempty"`
|
|
|
|
}
|
|
|
|
|
2024-09-13 20:43:05 +08:00
|
|
|
type ChatType string
|
|
|
|
|
|
|
|
const (
|
|
|
|
ChatTypePrivate ChatType = "private"
|
|
|
|
ChatTypeGroup ChatType = "group"
|
|
|
|
ChatTypeSupergroup ChatType = "supergroup"
|
|
|
|
ChatTypeChannel ChatType = "channel"
|
|
|
|
)
|
|
|
|
|
2022-04-29 17:21:42 +08:00
|
|
|
// Chat https://core.telegram.org/bots/api#chat
|
2022-04-26 00:02:51 +08:00
|
|
|
type Chat struct {
|
2024-09-13 20:43:05 +08:00
|
|
|
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"`
|
2024-05-20 17:07:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ChatFullInfo https://core.telegram.org/bots/api#chatfullinfo
|
|
|
|
type ChatFullInfo struct {
|
2024-04-02 23:09:36 +08:00
|
|
|
ID int64 `json:"id"`
|
2024-09-13 20:43:05 +08:00
|
|
|
Type ChatType `json:"type"`
|
2024-04-02 23:09:36 +08:00
|
|
|
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"`
|
|
|
|
Photo *ChatPhoto `json:"photo,omitempty"`
|
|
|
|
ActiveUsernames []string `json:"active_usernames,omitempty"`
|
|
|
|
Birthdate Birthdate `json:"birthdate,omitempty"`
|
|
|
|
BusinessIntro *BusinessIntro `json:"business_intro,omitempty"`
|
|
|
|
BusinessLocation *BusinessLocation `json:"business_location,omitempty"`
|
|
|
|
BusinessOpeningHours *BusinessOpeningHours `json:"business_opening_hours,omitempty"`
|
|
|
|
PersonalChat *Chat `json:"personal_chat,omitempty"`
|
|
|
|
AvailableReactions []ReactionType `json:"available_reactions,omitempty"`
|
|
|
|
AccentColorID int `json:"accent_color_id,omitempty"`
|
2024-05-20 17:07:43 +08:00
|
|
|
MaxReactionCount int `json:"max_reaction_count"`
|
2024-04-02 23:09:36 +08:00
|
|
|
BackgroundCustomEmojiID string `json:"background_custom_emoji_id,omitempty"`
|
|
|
|
ProfileAccentColorID int `json:"profile_accent_color_id,omitempty"`
|
|
|
|
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"`
|
|
|
|
Bio string `json:"bio"`
|
|
|
|
HasPrivateForwards bool `json:"has_private_forwards,omitempty"`
|
|
|
|
HasRestrictedVoiceAndVideoMessages bool `json:"has_restricted_voice_and_video_messages,omitempty"`
|
|
|
|
JoinToSendMessages bool `json:"join_to_send_messages"`
|
|
|
|
JoinByRequest bool `json:"join_by_request"`
|
|
|
|
Description string `json:"description,omitempty"`
|
|
|
|
InviteLink string `json:"invite_link,omitempty"`
|
|
|
|
PinnedMessage *Message `json:"pinned_message,omitempty"`
|
|
|
|
Permissions *ChatPermissions `json:"permissions,omitempty"`
|
2024-07-18 22:37:31 +08:00
|
|
|
CanSendPaidMedia bool `json:"can_send_paid_media,omitempty"`
|
2024-04-02 23:09:36 +08:00
|
|
|
SlowModeDelay int `json:"slow_mode_delay,omitempty"`
|
|
|
|
UnrestrictBoostCount int `json:"unrestrict_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"`
|
|
|
|
Location *ChatLocation `json:"location,omitempty"`
|
2022-04-26 00:02:51 +08:00
|
|
|
}
|