v1.0.0 beta 15

This commit is contained in:
2026-03-12 17:45:53 +03:00
parent 3b6bb82e04
commit d6e2daec04
28 changed files with 1224 additions and 126 deletions

View File

@@ -1,23 +1,37 @@
package tgapi
// BusinessIntro contains information about the business intro.
// See https://core.telegram.org/bots/api#businessintro
type BusinessIntro struct {
Title string `json:"title,omitempty"`
Message string `json:"message,omitempty"`
Sticker *Sticker `json:"sticker,omitempty"`
}
// BusinessLocation contains information about the business location.
// See https://core.telegram.org/bots/api#businesslocation
type BusinessLocation struct {
Address string `json:"address"`
Location *Location `json:"location,omitempty"`
}
// BusinessOpeningHoursInterval represents an interval of opening hours.
// See https://core.telegram.org/bots/api#businessopeninghoursinterval
type BusinessOpeningHoursInterval struct {
OpeningMinute int `json:"opening_minute"`
ClosingMinute int `json:"closing_minute"`
}
// BusinessOpeningHours represents the opening hours of a business.
// See https://core.telegram.org/bots/api#businessopeninghours
type BusinessOpeningHours struct {
TimeZoneName string `json:"time_zone_name"`
OpeningHours []Birthdate `json:"opening_hours"`
TimeZoneName string `json:"time_zone_name"`
OpeningHours []BusinessOpeningHoursInterval `json:"opening_hours"`
}
// BusinessBotRights represents the rights of a business bot.
// All fields are optional booleans that, when present, are always true.
// See https://core.telegram.org/bots/api#businessbotrights
type BusinessBotRights struct {
CanReply *bool `json:"can_reply,omitempty"`
CanReadMessages *bool `json:"can_read_messages,omitempty"`
@@ -34,33 +48,43 @@ type BusinessBotRights struct {
CanTransferStars *bool `json:"can_transfer_stars,omitempty"`
CanManageStories *bool `json:"can_manage_stories,omitempty"`
}
// BusinessConnection contains information about a business connection.
// See https://core.telegram.org/bots/api#businessconnection
type BusinessConnection struct {
ID string `json:"id"`
User User `json:"user"`
UserChatID int `json:"user_chat_id"`
Date int `json:"date"`
Rights *BusinessBotRights `json:"rights,omitempty"`
IsEnabled bool `json:"id_enabled"`
IsEnabled bool `json:"is_enabled"`
}
// InputStoryContentType indicates the type of input story content.
type InputStoryContentType string
const (
InputStoryContentPhotoType InputStoryContentType = "photo"
InputStoryContentVideoType InputStoryContentType = "video"
)
type InputStoryContentType string
// InputStoryContent represents the content of a story to be posted.
// See https://core.telegram.org/bots/api#inputstorycontent
type InputStoryContent struct {
Type InputStoryContentType `json:"type"`
// Photo
// Photo fields
Photo *string `json:"photo,omitempty"`
// Video
// Video fields
Video *string `json:"video,omitempty"`
Duration *float64 `json:"duration,omitempty"`
CoverFrameTimestamp *float64 `json:"cover_frame_timestamp,omitempty"`
IsAnimation *bool `json:"is_animation,omitempty"`
}
// StoryAreaPosition describes the position of a clickable area on a story.
// See https://core.telegram.org/bots/api#storyareaposition
type StoryAreaPosition struct {
XPercentage float64 `json:"x_percentage"`
YPercentage float64 `json:"y_percentage"`
@@ -70,6 +94,9 @@ type StoryAreaPosition struct {
CornerRadiusPercentage float64 `json:"corner_radius_percentage"`
}
// StoryAreaTypeType indicates the type of story area.
type StoryAreaTypeType string
const (
StoryAreaTypeLocationType StoryAreaTypeType = "location"
StoryAreaTypeReactionType StoryAreaTypeType = "suggested_reaction"
@@ -78,26 +105,36 @@ const (
StoryAreaTypeUniqueGiftType StoryAreaTypeType = "unique_gift"
)
type StoryAreaTypeType string
// StoryAreaType describes the type of a clickable area on a story.
// Fields should be set according to the Type.
// See https://core.telegram.org/bots/api#storyareatype
type StoryAreaType struct {
Type StoryAreaTypeType `json:"type"`
// Location
Latitude *float64 `json:"latitude,omitempty"`
Longitude *float64 `json:"longitude,omitempty"`
Address *LocationAddress `json:"address,omitempty"`
// Suggested reaction
ReactionType *ReactionType `json:"reaction_type,omitempty"`
IsDark *bool `json:"is_dark,omitempty"`
IsFlipped *bool `json:"is_flipped,omitempty"`
// Link
URL *string `json:"url,omitempty"`
// Weather
Temperature *float64 `json:"temperature,omitempty"`
Emoji *string `json:"emoji"`
BackgroundColor *int `json:"background_color"`
Emoji *string `json:"emoji,omitempty"`
BackgroundColor *int `json:"background_color,omitempty"`
// Unique gift
Name *string `json:"name,omitempty"`
}
// StoryArea represents a clickable area on a story.
// See https://core.telegram.org/bots/api#storyarea
type StoryArea struct {
Position StoryAreaPosition `json:"position"`
Type StoryAreaType `json:"type"`