+112
-42
@@ -4,8 +4,11 @@ package tgapi
|
||||
// Since: Bot API 7.2
|
||||
// See https://core.telegram.org/bots/api#businessintro
|
||||
type BusinessIntro struct {
|
||||
Title string `json:"title,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
// Title Optional. Title text of the business intro
|
||||
Title string `json:"title,omitempty"`
|
||||
// Message Optional. Message text of the business intro
|
||||
Message string `json:"message,omitempty"`
|
||||
// Sticker Optional. Sticker of the business intro
|
||||
Sticker *Sticker `json:"sticker,omitempty"`
|
||||
}
|
||||
|
||||
@@ -13,7 +16,9 @@ type BusinessIntro struct {
|
||||
// Since: Bot API 7.2
|
||||
// See https://core.telegram.org/bots/api#businesslocation
|
||||
type BusinessLocation struct {
|
||||
Address string `json:"address"`
|
||||
// Address Address of the business
|
||||
Address string `json:"address"`
|
||||
// Location Optional. Location of the business
|
||||
Location *Location `json:"location,omitempty"`
|
||||
}
|
||||
|
||||
@@ -21,7 +26,11 @@ type BusinessLocation struct {
|
||||
// Since: Bot API 7.2
|
||||
// See https://core.telegram.org/bots/api#businessopeninghoursinterval
|
||||
type BusinessOpeningHoursInterval struct {
|
||||
// OpeningMinute The minute's sequence number in a week, starting on Monday, marking the start of the time
|
||||
// interval during which the business is open; 0 - 7 * 24 * 60
|
||||
OpeningMinute int `json:"opening_minute"`
|
||||
// ClosingMinute The minute's sequence number in a week, starting on Monday, marking the end of the time
|
||||
// interval during which the business is open; 0 - 8 * 24 * 60
|
||||
ClosingMinute int `json:"closing_minute"`
|
||||
}
|
||||
|
||||
@@ -29,7 +38,9 @@ type BusinessOpeningHoursInterval struct {
|
||||
// Since: Bot API 7.2
|
||||
// See https://core.telegram.org/bots/api#businessopeninghours
|
||||
type BusinessOpeningHours struct {
|
||||
TimeZoneName string `json:"time_zone_name"`
|
||||
// TimeZoneName Unique name of the time zone for which the opening hours are defined
|
||||
TimeZoneName string `json:"time_zone_name"`
|
||||
// OpeningHours List of time intervals describing business opening hours
|
||||
OpeningHours []BusinessOpeningHoursInterval `json:"opening_hours"`
|
||||
}
|
||||
|
||||
@@ -38,41 +49,75 @@ type BusinessOpeningHours struct {
|
||||
// Since: Bot API 9.0
|
||||
// See https://core.telegram.org/bots/api#businessbotrights
|
||||
type BusinessBotRights struct {
|
||||
CanReply *bool `json:"can_reply,omitempty"`
|
||||
CanReadMessages *bool `json:"can_read_messages,omitempty"`
|
||||
CanDeleteSentMessages *bool `json:"can_delete_sent_messages,omitempty"`
|
||||
CanDeleteAllMessages *bool `json:"can_delete_all_messages,omitempty"`
|
||||
CanEditName *bool `json:"can_edit_name,omitempty"`
|
||||
CanEditBio *bool `json:"can_edit_bio,omitempty"`
|
||||
CanEditProfilePhoto *bool `json:"can_edit_profile_photo,omitempty"`
|
||||
CanEditUsername *bool `json:"can_edit_username,omitempty"`
|
||||
CanChangeGiftSettings *bool `json:"can_change_gift_settings,omitempty"`
|
||||
CanViewGiftsAndStars *bool `json:"can_view_gifts_and_stars,omitempty"`
|
||||
CanConvertGiftsToStars *bool `json:"can_convert_gifts_to_stars,omitempty"`
|
||||
// CanReply Optional. True, if the bot can send and edit messages in the private chats that had incoming
|
||||
// messages in the last 24 hours
|
||||
CanReply *bool `json:"can_reply,omitempty"`
|
||||
// CanReadMessages Optional. True, if the bot can mark incoming private messages as read
|
||||
CanReadMessages *bool `json:"can_read_messages,omitempty"`
|
||||
// CanDeleteSentMessages Optional. True, if the bot can delete messages sent by the bot
|
||||
CanDeleteSentMessages *bool `json:"can_delete_sent_messages,omitempty"`
|
||||
// CanDeleteAllMessages Optional. True, if the bot can delete all private messages in managed chats
|
||||
CanDeleteAllMessages *bool `json:"can_delete_all_messages,omitempty"`
|
||||
// CanEditName Optional. True, if the bot can edit the first and last name of the business account
|
||||
CanEditName *bool `json:"can_edit_name,omitempty"`
|
||||
// CanEditBio Optional. True, if the bot can edit the bio of the business account
|
||||
CanEditBio *bool `json:"can_edit_bio,omitempty"`
|
||||
// CanEditProfilePhoto Optional. True, if the bot can edit the profile photo of the business account
|
||||
CanEditProfilePhoto *bool `json:"can_edit_profile_photo,omitempty"`
|
||||
// CanEditUsername Optional. True, if the bot can edit the username of the business account
|
||||
CanEditUsername *bool `json:"can_edit_username,omitempty"`
|
||||
// CanChangeGiftSettings Optional. True, if the bot can change the privacy settings pertaining to gifts for
|
||||
// the business account
|
||||
CanChangeGiftSettings *bool `json:"can_change_gift_settings,omitempty"`
|
||||
// CanViewGiftsAndStars Optional. True, if the bot can view gifts and the amount of Telegram Stars owned by
|
||||
// the business account
|
||||
CanViewGiftsAndStars *bool `json:"can_view_gifts_and_stars,omitempty"`
|
||||
// CanConvertGiftsToStars Optional. True, if the bot can convert regular gifts owned by the business account
|
||||
// to Telegram Stars
|
||||
CanConvertGiftsToStars *bool `json:"can_convert_gifts_to_stars,omitempty"`
|
||||
// CanTransferAndUpgradeGifts Optional. True, if the bot can transfer and upgrade gifts owned by the
|
||||
// business account
|
||||
CanTransferAndUpgradeGifts *bool `json:"can_transfer_and_upgrade_gifts,omitempty"`
|
||||
CanTransferStars *bool `json:"can_transfer_stars,omitempty"`
|
||||
CanManageStories *bool `json:"can_manage_stories,omitempty"`
|
||||
// CanTransferStars Optional. True, if the bot can transfer Telegram Stars received by the business account
|
||||
// to its own account, or use them to upgrade and transfer gifts
|
||||
CanTransferStars *bool `json:"can_transfer_stars,omitempty"`
|
||||
// CanManageStories Optional. True, if the bot can post, edit and delete stories on behalf of the business
|
||||
// account
|
||||
CanManageStories *bool `json:"can_manage_stories,omitempty"`
|
||||
}
|
||||
|
||||
// BusinessConnection contains information about a business connection.
|
||||
// Since: Bot API 7.2
|
||||
// See https://core.telegram.org/bots/api#businessconnection
|
||||
type BusinessConnection struct {
|
||||
ID string `json:"id"`
|
||||
User User `json:"user"`
|
||||
UserChatID int64 `json:"user_chat_id"`
|
||||
Date int `json:"date"`
|
||||
Rights *BusinessBotRights `json:"rights,omitempty"`
|
||||
IsEnabled bool `json:"is_enabled"`
|
||||
// ID Unique identifier of the business connection
|
||||
ID string `json:"id"`
|
||||
// User Business account user that created the business connection
|
||||
User User `json:"user"`
|
||||
// UserChatID Identifier of a private chat with the user who created the business connection. 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.
|
||||
UserChatID int64 `json:"user_chat_id"`
|
||||
// Date Date the connection was established in Unix time
|
||||
Date int `json:"date"`
|
||||
// Rights Optional. Rights of the business bot
|
||||
Rights *BusinessBotRights `json:"rights,omitempty"`
|
||||
// IsEnabled True, if the connection is active
|
||||
IsEnabled bool `json:"is_enabled"`
|
||||
}
|
||||
|
||||
// BusinessMessagesDeleted is received when messages are deleted from a connected business account.
|
||||
// Since: Bot API 7.2
|
||||
// See https://core.telegram.org/bots/api#businessmessagesdeleted
|
||||
type BusinessMessagesDeleted struct {
|
||||
// BusinessConnectionID Unique identifier of the business connection
|
||||
BusinessConnectionID string `json:"business_connection_id"`
|
||||
Chat Chat `json:"chat"`
|
||||
MessageIDs []int `json:"message_ids"`
|
||||
// Chat Information about a chat in the business account. The bot may not have access to the chat or the
|
||||
// corresponding user.
|
||||
Chat Chat `json:"chat"`
|
||||
// MessageIDs The list of identifiers of deleted messages in the chat of the business account
|
||||
MessageIDs []int `json:"message_ids"`
|
||||
}
|
||||
|
||||
// InputStoryContentType indicates the type of input story content.
|
||||
@@ -89,27 +134,38 @@ const (
|
||||
// Since: Bot API 9.0
|
||||
// See https://core.telegram.org/bots/api#inputstorycontent
|
||||
type InputStoryContent struct {
|
||||
// Type identifies the photo or video story-content variant.
|
||||
Type InputStoryContentType `json:"type"`
|
||||
|
||||
// Photo fields
|
||||
Photo *string `json:"photo,omitempty"`
|
||||
|
||||
// Video fields
|
||||
Video *string `json:"video,omitempty"`
|
||||
Duration *float64 `json:"duration,omitempty"`
|
||||
Video *string `json:"video,omitempty"`
|
||||
// Duration Optional. Precise duration of the video in seconds; 0-60
|
||||
Duration *float64 `json:"duration,omitempty"`
|
||||
// CoverFrameTimestamp Optional. Timestamp in seconds of the frame that will be used as the static cover for
|
||||
// the story. Defaults to 0.0.
|
||||
CoverFrameTimestamp *float64 `json:"cover_frame_timestamp,omitempty"`
|
||||
IsAnimation *bool `json:"is_animation,omitempty"`
|
||||
// IsAnimation Optional. Pass True if the video has no sound
|
||||
IsAnimation *bool `json:"is_animation,omitempty"`
|
||||
}
|
||||
|
||||
// StoryAreaPosition describes the position of a clickable area on a story.
|
||||
// Since: Bot API 9.0
|
||||
// See https://core.telegram.org/bots/api#storyareaposition
|
||||
type StoryAreaPosition struct {
|
||||
XPercentage float64 `json:"x_percentage"`
|
||||
YPercentage float64 `json:"y_percentage"`
|
||||
WidthPercentage float64 `json:"width_percentage"`
|
||||
HeightPercentage float64 `json:"height_percentage"`
|
||||
RotationAngle float64 `json:"rotation_angle"`
|
||||
// XPercentage The abscissa of the area's center, as a percentage of the media width
|
||||
XPercentage float64 `json:"x_percentage"`
|
||||
// YPercentage The ordinate of the area's center, as a percentage of the media height
|
||||
YPercentage float64 `json:"y_percentage"`
|
||||
// WidthPercentage The width of the area's rectangle, as a percentage of the media width
|
||||
WidthPercentage float64 `json:"width_percentage"`
|
||||
// HeightPercentage The height of the area's rectangle, as a percentage of the media height
|
||||
HeightPercentage float64 `json:"height_percentage"`
|
||||
// RotationAngle The clockwise rotation angle of the rectangle, in degrees; 0-360
|
||||
RotationAngle float64 `json:"rotation_angle"`
|
||||
// CornerRadiusPercentage The radius of the rectangle corner rounding, as a percentage of the media width
|
||||
CornerRadiusPercentage float64 `json:"corner_radius_percentage"`
|
||||
}
|
||||
|
||||
@@ -133,26 +189,38 @@ const (
|
||||
// Since: Bot API 9.0
|
||||
// See https://core.telegram.org/bots/api#storyareatype
|
||||
type StoryAreaType struct {
|
||||
// Type identifies the concrete story-area variant.
|
||||
Type StoryAreaTypeType `json:"type"`
|
||||
|
||||
// Latitude Location latitude in degrees
|
||||
// Location
|
||||
Latitude *float64 `json:"latitude,omitempty"`
|
||||
Longitude *float64 `json:"longitude,omitempty"`
|
||||
Address *LocationAddress `json:"address,omitempty"`
|
||||
Latitude *float64 `json:"latitude,omitempty"`
|
||||
// Longitude Location longitude in degrees
|
||||
Longitude *float64 `json:"longitude,omitempty"`
|
||||
// Address Optional. Address of the location
|
||||
Address *LocationAddress `json:"address,omitempty"`
|
||||
|
||||
// ReactionType Type of the reaction
|
||||
// Suggested reaction
|
||||
ReactionType *ReactionType `json:"reaction_type,omitempty"`
|
||||
IsDark *bool `json:"is_dark,omitempty"`
|
||||
IsFlipped *bool `json:"is_flipped,omitempty"`
|
||||
// IsDark Optional. Pass True if the reaction area has a dark background
|
||||
IsDark *bool `json:"is_dark,omitempty"`
|
||||
// IsFlipped Optional. Pass True if reaction area corner is flipped
|
||||
IsFlipped *bool `json:"is_flipped,omitempty"`
|
||||
|
||||
// URL HTTP or tg:// URL to be opened when the area is clicked
|
||||
// Link
|
||||
URL *string `json:"url,omitempty"`
|
||||
|
||||
// Temperature Temperature, in degree Celsius
|
||||
// Weather
|
||||
Temperature *float64 `json:"temperature,omitempty"`
|
||||
Emoji *string `json:"emoji,omitempty"`
|
||||
BackgroundColor *int `json:"background_color,omitempty"`
|
||||
Temperature *float64 `json:"temperature,omitempty"`
|
||||
// Emoji Emoji representing the weather
|
||||
Emoji *string `json:"emoji,omitempty"`
|
||||
// BackgroundColor A color of the area background in the ARGB format
|
||||
BackgroundColor *int `json:"background_color,omitempty"`
|
||||
|
||||
// Name Unique name of the gift
|
||||
// Unique gift
|
||||
Name *string `json:"name,omitempty"`
|
||||
}
|
||||
@@ -161,6 +229,8 @@ type StoryAreaType struct {
|
||||
// Since: Bot API 9.0
|
||||
// See https://core.telegram.org/bots/api#storyarea
|
||||
type StoryArea struct {
|
||||
// Position Position of the area
|
||||
Position StoryAreaPosition `json:"position"`
|
||||
Type StoryAreaType `json:"type"`
|
||||
// Type Type of the area
|
||||
Type StoryAreaType `json:"type"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user