mirror of
https://github.com/c0re100/gotdlib.git
synced 2026-02-21 20:20:17 +01:00
Update to TDLib 1.8.26
This commit is contained in:
parent
97ffe5213a
commit
7005072ba4
4 changed files with 1666 additions and 12 deletions
|
|
@ -3663,6 +3663,38 @@ func (client *Client) ForwardMessages(req *ForwardMessagesRequest) (*Messages, e
|
|||
return UnmarshalMessages(result.Data)
|
||||
}
|
||||
|
||||
type SendQuickReplyShortcutMessagesRequest struct {
|
||||
// Identifier of the chat to which to send messages. The chat must be a private chat with a regular user
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Unique identifier of the quick reply shortcut
|
||||
ShortcutId int32 `json:"shortcut_id"`
|
||||
// Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates
|
||||
SendingId int32 `json:"sending_id"`
|
||||
}
|
||||
|
||||
// Sends messages from a quick reply shortcut. Requires Telegram Business subscription
|
||||
func (client *Client) SendQuickReplyShortcutMessages(req *SendQuickReplyShortcutMessagesRequest) (*Messages, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "sendQuickReplyShortcutMessages",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"shortcut_id": req.ShortcutId,
|
||||
"sending_id": req.SendingId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalMessages(result.Data)
|
||||
}
|
||||
|
||||
type ResendMessagesRequest struct {
|
||||
// Identifier of the chat to send messages
|
||||
ChatId int64 `json:"chat_id"`
|
||||
|
|
@ -4228,6 +4260,192 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState
|
|||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type CheckQuickReplyShortcutNameRequest struct {
|
||||
// The name of the shortcut; 1-32 characters
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// Checks validness of a name for a quick reply shortcut. Can be called synchronously
|
||||
func CheckQuickReplyShortcutName(req *CheckQuickReplyShortcutNameRequest) (*Ok, error) {
|
||||
result, err := Execute(Request{
|
||||
meta: meta{
|
||||
Type: "checkQuickReplyShortcutName",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"name": req.Name,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
// deprecated
|
||||
// Checks validness of a name for a quick reply shortcut. Can be called synchronously
|
||||
func (client *Client) CheckQuickReplyShortcutName(req *CheckQuickReplyShortcutNameRequest) (*Ok, error) {
|
||||
return CheckQuickReplyShortcutName(req)}
|
||||
|
||||
// Loads quick reply shortcuts created by the current user. The loaded topics will be sent through updateQuickReplyShortcuts
|
||||
func (client *Client) LoadQuickReplyShortcuts() (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "loadQuickReplyShortcuts",
|
||||
},
|
||||
Data: map[string]interface{}{},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type SetQuickReplyShortcutNameRequest struct {
|
||||
// Unique identifier of the quick reply shortcut
|
||||
ShortcutId int32 `json:"shortcut_id"`
|
||||
// New name for the shortcut. Use checkQuickReplyShortcutName to check its validness
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// Changes name of a quick reply shortcut
|
||||
func (client *Client) SetQuickReplyShortcutName(req *SetQuickReplyShortcutNameRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setQuickReplyShortcutName",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"shortcut_id": req.ShortcutId,
|
||||
"name": req.Name,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type DeleteQuickReplyShortcutRequest struct {
|
||||
// Unique identifier of the quick reply shortcut
|
||||
ShortcutId int32 `json:"shortcut_id"`
|
||||
}
|
||||
|
||||
// Deletes a quick reply shortcut
|
||||
func (client *Client) DeleteQuickReplyShortcut(req *DeleteQuickReplyShortcutRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "deleteQuickReplyShortcut",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"shortcut_id": req.ShortcutId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type ReorderQuickReplyShortcutsRequest struct {
|
||||
// The new order of quick reply shortcuts
|
||||
ShortcutIds []int32 `json:"shortcut_ids"`
|
||||
}
|
||||
|
||||
// Changes the order of quick reply shortcuts
|
||||
func (client *Client) ReorderQuickReplyShortcuts(req *ReorderQuickReplyShortcutsRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "reorderQuickReplyShortcuts",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"shortcut_ids": req.ShortcutIds,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type LoadQuickReplyShortcutMessagesRequest struct {
|
||||
// Unique identifier of the quick reply shortcut
|
||||
ShortcutId int32 `json:"shortcut_id"`
|
||||
}
|
||||
|
||||
// Loads quick reply messages that can be sent by a given quick reply shortcut. The loaded messages will be sent through updateQuickReplyShortcutMessages
|
||||
func (client *Client) LoadQuickReplyShortcutMessages(req *LoadQuickReplyShortcutMessagesRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "loadQuickReplyShortcutMessages",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"shortcut_id": req.ShortcutId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type DeleteQuickReplyShortcutMessagesRequest struct {
|
||||
// Unique identifier of the quick reply shortcut to which the messages belong
|
||||
ShortcutId int32 `json:"shortcut_id"`
|
||||
// Unique identifiers of the messages
|
||||
MessageIds []int64 `json:"message_ids"`
|
||||
}
|
||||
|
||||
// Deletes specified quick reply messages
|
||||
func (client *Client) DeleteQuickReplyShortcutMessages(req *DeleteQuickReplyShortcutMessagesRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "deleteQuickReplyShortcutMessages",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"shortcut_id": req.ShortcutId,
|
||||
"message_ids": req.MessageIds,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
// Returns list of custom emojis, which can be used as forum topic icon by all users
|
||||
func (client *Client) GetForumTopicDefaultIcons() (*Stickers, error) {
|
||||
result, err := client.Send(Request{
|
||||
|
|
@ -7296,6 +7514,32 @@ func (client *Client) ReorderChatFolders(req *ReorderChatFoldersRequest) (*Ok, e
|
|||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type ToggleChatFolderTagsRequest struct {
|
||||
// Pass true to enable folder tags; pass false to disable them
|
||||
AreTagsEnabled bool `json:"are_tags_enabled"`
|
||||
}
|
||||
|
||||
// Toggles whether chat folder tags are enabled
|
||||
func (client *Client) ToggleChatFolderTags(req *ToggleChatFolderTagsRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "toggleChatFolderTags",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"are_tags_enabled": req.AreTagsEnabled,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
// Returns recommended chat folders for the current user
|
||||
func (client *Client) GetRecommendedChatFolders() (*RecommendedChatFolders, error) {
|
||||
result, err := client.Send(Request{
|
||||
|
|
@ -13429,7 +13673,7 @@ type AddRecentStickerRequest struct {
|
|||
Sticker InputFile `json:"sticker"`
|
||||
}
|
||||
|
||||
// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers
|
||||
// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP format can be added to this list. Emoji stickers can't be added to recent stickers
|
||||
func (client *Client) AddRecentSticker(req *AddRecentStickerRequest) (*Stickers, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -13530,7 +13774,7 @@ type AddFavoriteStickerRequest struct {
|
|||
Sticker InputFile `json:"sticker"`
|
||||
}
|
||||
|
||||
// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to favorite stickers
|
||||
// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP format can be added to this list. Emoji stickers can't be added to favorite stickers
|
||||
func (client *Client) AddFavoriteSticker(req *AddFavoriteStickerRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -14305,7 +14549,7 @@ type SetLocationRequest struct {
|
|||
Location *Location `json:"location"`
|
||||
}
|
||||
|
||||
// Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer
|
||||
// Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer. Must not be called if the user has a business location
|
||||
func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -14326,6 +14570,110 @@ func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) {
|
|||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type SetBusinessLocationRequest struct {
|
||||
// The new location of the business; pass null to remove the location
|
||||
Location *BusinessLocation `json:"location"`
|
||||
}
|
||||
|
||||
// Changes the business location of the current user. Requires Telegram Business subscription
|
||||
func (client *Client) SetBusinessLocation(req *SetBusinessLocationRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setBusinessLocation",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"location": req.Location,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type SetBusinessOpeningHoursRequest struct {
|
||||
// The new opening hours of the business; pass null to remove the opening hours
|
||||
OpeningHours *BusinessOpeningHours `json:"opening_hours"`
|
||||
}
|
||||
|
||||
// Changes the business opening hours of the current user. Requires Telegram Business subscription
|
||||
func (client *Client) SetBusinessOpeningHours(req *SetBusinessOpeningHoursRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setBusinessOpeningHours",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"opening_hours": req.OpeningHours,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type SetBusinessGreetingMessageSettingsRequest struct {
|
||||
// The new settings for the greeting message of the business; pass null to disable the greeting message
|
||||
GreetingMessageSettings *BusinessGreetingMessageSettings `json:"greeting_message_settings"`
|
||||
}
|
||||
|
||||
// Changes the business greeting message settings of the current user. Requires Telegram Business subscription
|
||||
func (client *Client) SetBusinessGreetingMessageSettings(req *SetBusinessGreetingMessageSettingsRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setBusinessGreetingMessageSettings",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"greeting_message_settings": req.GreetingMessageSettings,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type SetBusinessAwayMessageSettingsRequest struct {
|
||||
// The new settings for the away message of the business; pass null to disable the away message
|
||||
AwayMessageSettings *BusinessAwayMessageSettings `json:"away_message_settings"`
|
||||
}
|
||||
|
||||
// Changes the business away message settings of the current user. Requires Telegram Business subscription
|
||||
func (client *Client) SetBusinessAwayMessageSettings(req *SetBusinessAwayMessageSettingsRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setBusinessAwayMessageSettings",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"away_message_settings": req.AwayMessageSettings,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type ChangePhoneNumberRequest struct {
|
||||
// The new phone number of the user in international format
|
||||
PhoneNumber string `json:"phone_number"`
|
||||
|
|
@ -14400,6 +14748,77 @@ func (client *Client) CheckChangePhoneNumberCode(req *CheckChangePhoneNumberCode
|
|||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
// Returns the business bot that is connected to the current user account. Returns a 404 error if there is no connected bot
|
||||
func (client *Client) GetBusinessConnectedBot() (*BusinessConnectedBot, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "getBusinessConnectedBot",
|
||||
},
|
||||
Data: map[string]interface{}{},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalBusinessConnectedBot(result.Data)
|
||||
}
|
||||
|
||||
type SetBusinessConnectedBotRequest struct {
|
||||
// Connection settings for the bot
|
||||
Bot *BusinessConnectedBot `json:"bot"`
|
||||
}
|
||||
|
||||
// Adds or changes business bot that is connected to the current user account
|
||||
func (client *Client) SetBusinessConnectedBot(req *SetBusinessConnectedBotRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setBusinessConnectedBot",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"bot": req.Bot,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type DeleteBusinessConnectedBotRequest struct {
|
||||
// Unique user identifier for the bot
|
||||
BotUserId int64 `json:"bot_user_id"`
|
||||
}
|
||||
|
||||
// Deletes the business bot that is connected to the current user account
|
||||
func (client *Client) DeleteBusinessConnectedBot(req *DeleteBusinessConnectedBotRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "deleteBusinessConnectedBot",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"bot_user_id": req.BotUserId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
// Returns an HTTPS link, which can be used to get information about the current user
|
||||
func (client *Client) GetUserLink() (*UserLink, error) {
|
||||
result, err := client.Send(Request{
|
||||
|
|
@ -15829,6 +16248,25 @@ func (client *Client) GetChatEventLog(req *GetChatEventLogRequest) (*ChatEvents,
|
|||
return UnmarshalChatEvents(result.Data)
|
||||
}
|
||||
|
||||
// Returns the list of supported time zones
|
||||
func (client *Client) GetTimeZones() (*TimeZones, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "getTimeZones",
|
||||
},
|
||||
Data: map[string]interface{}{},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalTimeZones(result.Data)
|
||||
}
|
||||
|
||||
type GetPaymentFormRequest struct {
|
||||
// The invoice
|
||||
InputInvoice InputInvoice `json:"input_invoice"`
|
||||
|
|
@ -20332,6 +20770,12 @@ func (client *Client) TestUseUpdate() (Update, error) {
|
|||
case TypeUpdateChatPosition:
|
||||
return UnmarshalUpdateChatPosition(result.Data)
|
||||
|
||||
case TypeUpdateChatAddedToList:
|
||||
return UnmarshalUpdateChatAddedToList(result.Data)
|
||||
|
||||
case TypeUpdateChatRemovedFromList:
|
||||
return UnmarshalUpdateChatRemovedFromList(result.Data)
|
||||
|
||||
case TypeUpdateChatReadInbox:
|
||||
return UnmarshalUpdateChatReadInbox(result.Data)
|
||||
|
||||
|
|
@ -20413,6 +20857,18 @@ func (client *Client) TestUseUpdate() (Update, error) {
|
|||
case TypeUpdateSavedMessagesTopicCount:
|
||||
return UnmarshalUpdateSavedMessagesTopicCount(result.Data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcut:
|
||||
return UnmarshalUpdateQuickReplyShortcut(result.Data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcutDeleted:
|
||||
return UnmarshalUpdateQuickReplyShortcutDeleted(result.Data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcuts:
|
||||
return UnmarshalUpdateQuickReplyShortcuts(result.Data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcutMessages:
|
||||
return UnmarshalUpdateQuickReplyShortcutMessages(result.Data)
|
||||
|
||||
case TypeUpdateForumTopicInfo:
|
||||
return UnmarshalUpdateForumTopicInfo(result.Data)
|
||||
|
||||
|
|
|
|||
734
client/type.go
734
client/type.go
|
|
@ -19,6 +19,7 @@ const (
|
|||
ClassStickerFullType = "StickerFullType"
|
||||
ClassPollType = "PollType"
|
||||
ClassUserType = "UserType"
|
||||
ClassBusinessAwayMessageSchedule = "BusinessAwayMessageSchedule"
|
||||
ClassChatPhotoStickerType = "ChatPhotoStickerType"
|
||||
ClassInputChatPhoto = "InputChatPhoto"
|
||||
ClassPremiumGiveawayParticipantStatus = "PremiumGiveawayParticipantStatus"
|
||||
|
|
@ -187,6 +188,14 @@ const (
|
|||
ClassBotCommands = "BotCommands"
|
||||
ClassBotMenuButton = "BotMenuButton"
|
||||
ClassChatLocation = "ChatLocation"
|
||||
ClassBusinessLocation = "BusinessLocation"
|
||||
ClassBusinessRecipients = "BusinessRecipients"
|
||||
ClassBusinessAwayMessageSettings = "BusinessAwayMessageSettings"
|
||||
ClassBusinessGreetingMessageSettings = "BusinessGreetingMessageSettings"
|
||||
ClassBusinessConnectedBot = "BusinessConnectedBot"
|
||||
ClassBusinessOpeningHoursInterval = "BusinessOpeningHoursInterval"
|
||||
ClassBusinessOpeningHours = "BusinessOpeningHours"
|
||||
ClassBusinessInfo = "BusinessInfo"
|
||||
ClassChatPhotoSticker = "ChatPhotoSticker"
|
||||
ClassAnimatedChatPhoto = "AnimatedChatPhoto"
|
||||
ClassChatPhoto = "ChatPhoto"
|
||||
|
|
@ -355,6 +364,8 @@ const (
|
|||
ClassChatActiveStories = "ChatActiveStories"
|
||||
ClassStoryInteraction = "StoryInteraction"
|
||||
ClassStoryInteractions = "StoryInteractions"
|
||||
ClassQuickReplyMessage = "QuickReplyMessage"
|
||||
ClassQuickReplyShortcut = "QuickReplyShortcut"
|
||||
ClassPublicForwards = "PublicForwards"
|
||||
ClassChatBoostLevelFeatures = "ChatBoostLevelFeatures"
|
||||
ClassChatBoostFeatures = "ChatBoostFeatures"
|
||||
|
|
@ -410,6 +421,8 @@ const (
|
|||
ClassPushReceiverId = "PushReceiverId"
|
||||
ClassThemeSettings = "ThemeSettings"
|
||||
ClassChatTheme = "ChatTheme"
|
||||
ClassTimeZone = "TimeZone"
|
||||
ClassTimeZones = "TimeZones"
|
||||
ClassHashtags = "Hashtags"
|
||||
ClassNotificationSound = "NotificationSound"
|
||||
ClassNotificationSounds = "NotificationSounds"
|
||||
|
|
@ -576,6 +589,17 @@ const (
|
|||
TypeBotCommands = "botCommands"
|
||||
TypeBotMenuButton = "botMenuButton"
|
||||
TypeChatLocation = "chatLocation"
|
||||
TypeBusinessAwayMessageScheduleAlways = "businessAwayMessageScheduleAlways"
|
||||
TypeBusinessAwayMessageScheduleOutsideOfOpeningHours = "businessAwayMessageScheduleOutsideOfOpeningHours"
|
||||
TypeBusinessAwayMessageScheduleCustom = "businessAwayMessageScheduleCustom"
|
||||
TypeBusinessLocation = "businessLocation"
|
||||
TypeBusinessRecipients = "businessRecipients"
|
||||
TypeBusinessAwayMessageSettings = "businessAwayMessageSettings"
|
||||
TypeBusinessGreetingMessageSettings = "businessGreetingMessageSettings"
|
||||
TypeBusinessConnectedBot = "businessConnectedBot"
|
||||
TypeBusinessOpeningHoursInterval = "businessOpeningHoursInterval"
|
||||
TypeBusinessOpeningHours = "businessOpeningHours"
|
||||
TypeBusinessInfo = "businessInfo"
|
||||
TypeChatPhotoStickerTypeRegularOrMask = "chatPhotoStickerTypeRegularOrMask"
|
||||
TypeChatPhotoStickerTypeCustomEmoji = "chatPhotoStickerTypeCustomEmoji"
|
||||
TypeChatPhotoSticker = "chatPhotoSticker"
|
||||
|
|
@ -1163,6 +1187,8 @@ const (
|
|||
TypeStoryInteractionTypeRepost = "storyInteractionTypeRepost"
|
||||
TypeStoryInteraction = "storyInteraction"
|
||||
TypeStoryInteractions = "storyInteractions"
|
||||
TypeQuickReplyMessage = "quickReplyMessage"
|
||||
TypeQuickReplyShortcut = "quickReplyShortcut"
|
||||
TypePublicForwardMessage = "publicForwardMessage"
|
||||
TypePublicForwardStory = "publicForwardStory"
|
||||
TypePublicForwards = "publicForwards"
|
||||
|
|
@ -1423,6 +1449,8 @@ const (
|
|||
TypeInputBackgroundPrevious = "inputBackgroundPrevious"
|
||||
TypeThemeSettings = "themeSettings"
|
||||
TypeChatTheme = "chatTheme"
|
||||
TypeTimeZone = "timeZone"
|
||||
TypeTimeZones = "timeZones"
|
||||
TypeHashtags = "hashtags"
|
||||
TypeCanSendStoryResultOk = "canSendStoryResultOk"
|
||||
TypeCanSendStoryResultPremiumNeeded = "canSendStoryResultPremiumNeeded"
|
||||
|
|
@ -1750,6 +1778,8 @@ const (
|
|||
TypeUpdateChatPermissions = "updateChatPermissions"
|
||||
TypeUpdateChatLastMessage = "updateChatLastMessage"
|
||||
TypeUpdateChatPosition = "updateChatPosition"
|
||||
TypeUpdateChatAddedToList = "updateChatAddedToList"
|
||||
TypeUpdateChatRemovedFromList = "updateChatRemovedFromList"
|
||||
TypeUpdateChatReadInbox = "updateChatReadInbox"
|
||||
TypeUpdateChatReadOutbox = "updateChatReadOutbox"
|
||||
TypeUpdateChatActionBar = "updateChatActionBar"
|
||||
|
|
@ -1777,6 +1807,10 @@ const (
|
|||
TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount"
|
||||
TypeUpdateSavedMessagesTopic = "updateSavedMessagesTopic"
|
||||
TypeUpdateSavedMessagesTopicCount = "updateSavedMessagesTopicCount"
|
||||
TypeUpdateQuickReplyShortcut = "updateQuickReplyShortcut"
|
||||
TypeUpdateQuickReplyShortcutDeleted = "updateQuickReplyShortcutDeleted"
|
||||
TypeUpdateQuickReplyShortcuts = "updateQuickReplyShortcuts"
|
||||
TypeUpdateQuickReplyShortcutMessages = "updateQuickReplyShortcutMessages"
|
||||
TypeUpdateForumTopicInfo = "updateForumTopicInfo"
|
||||
TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings"
|
||||
TypeUpdateNotification = "updateNotification"
|
||||
|
|
@ -1935,6 +1969,11 @@ type UserType interface {
|
|||
UserTypeType() string
|
||||
}
|
||||
|
||||
// Describes conditions for sending of away messages by a Telegram Business account
|
||||
type BusinessAwayMessageSchedule interface {
|
||||
BusinessAwayMessageScheduleType() string
|
||||
}
|
||||
|
||||
// Describes type of a sticker, which was used to create a chat photo
|
||||
type ChatPhotoStickerType interface {
|
||||
ChatPhotoStickerTypeType() string
|
||||
|
|
@ -5632,6 +5671,328 @@ func (*ChatLocation) GetType() string {
|
|||
return TypeChatLocation
|
||||
}
|
||||
|
||||
// Send away messages always
|
||||
type BusinessAwayMessageScheduleAlways struct{
|
||||
meta
|
||||
}
|
||||
|
||||
func (entity *BusinessAwayMessageScheduleAlways) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub BusinessAwayMessageScheduleAlways
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*BusinessAwayMessageScheduleAlways) GetClass() string {
|
||||
return ClassBusinessAwayMessageSchedule
|
||||
}
|
||||
|
||||
func (*BusinessAwayMessageScheduleAlways) GetType() string {
|
||||
return TypeBusinessAwayMessageScheduleAlways
|
||||
}
|
||||
|
||||
func (*BusinessAwayMessageScheduleAlways) BusinessAwayMessageScheduleType() string {
|
||||
return TypeBusinessAwayMessageScheduleAlways
|
||||
}
|
||||
|
||||
// Send away messages outside of the business opening hours
|
||||
type BusinessAwayMessageScheduleOutsideOfOpeningHours struct{
|
||||
meta
|
||||
}
|
||||
|
||||
func (entity *BusinessAwayMessageScheduleOutsideOfOpeningHours) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub BusinessAwayMessageScheduleOutsideOfOpeningHours
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*BusinessAwayMessageScheduleOutsideOfOpeningHours) GetClass() string {
|
||||
return ClassBusinessAwayMessageSchedule
|
||||
}
|
||||
|
||||
func (*BusinessAwayMessageScheduleOutsideOfOpeningHours) GetType() string {
|
||||
return TypeBusinessAwayMessageScheduleOutsideOfOpeningHours
|
||||
}
|
||||
|
||||
func (*BusinessAwayMessageScheduleOutsideOfOpeningHours) BusinessAwayMessageScheduleType() string {
|
||||
return TypeBusinessAwayMessageScheduleOutsideOfOpeningHours
|
||||
}
|
||||
|
||||
// Send away messages only in the specified time span
|
||||
type BusinessAwayMessageScheduleCustom struct {
|
||||
meta
|
||||
// Point in time (Unix timestamp) when the away messages will start to be sent
|
||||
StartDate int32 `json:"start_date"`
|
||||
// Point in time (Unix timestamp) when the away messages will stop to be sent
|
||||
EndDate int32 `json:"end_date"`
|
||||
}
|
||||
|
||||
func (entity *BusinessAwayMessageScheduleCustom) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub BusinessAwayMessageScheduleCustom
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*BusinessAwayMessageScheduleCustom) GetClass() string {
|
||||
return ClassBusinessAwayMessageSchedule
|
||||
}
|
||||
|
||||
func (*BusinessAwayMessageScheduleCustom) GetType() string {
|
||||
return TypeBusinessAwayMessageScheduleCustom
|
||||
}
|
||||
|
||||
func (*BusinessAwayMessageScheduleCustom) BusinessAwayMessageScheduleType() string {
|
||||
return TypeBusinessAwayMessageScheduleCustom
|
||||
}
|
||||
|
||||
// Represents a location of a business
|
||||
type BusinessLocation struct {
|
||||
meta
|
||||
// The location; may be null if not specified
|
||||
Location *Location `json:"location"`
|
||||
// Location address; 1-96 characters
|
||||
Address string `json:"address"`
|
||||
}
|
||||
|
||||
func (entity *BusinessLocation) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub BusinessLocation
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*BusinessLocation) GetClass() string {
|
||||
return ClassBusinessLocation
|
||||
}
|
||||
|
||||
func (*BusinessLocation) GetType() string {
|
||||
return TypeBusinessLocation
|
||||
}
|
||||
|
||||
// Describes private chats chosen for automatic interaction with a business
|
||||
type BusinessRecipients struct {
|
||||
meta
|
||||
// Identifiers of selected private chats
|
||||
ChatIds []int64 `json:"chat_ids"`
|
||||
// True, if all existing private chats are selected
|
||||
SelectExistingChats bool `json:"select_existing_chats"`
|
||||
// True, if all new private chats are selected
|
||||
SelectNewChats bool `json:"select_new_chats"`
|
||||
// True, if all private chats with contacts are selected
|
||||
SelectContacts bool `json:"select_contacts"`
|
||||
// True, if all private chats with non-contacts are selected
|
||||
SelectNonContacts bool `json:"select_non_contacts"`
|
||||
// If true, then all private chats except the selected are chosen. Otherwise, only the selected chats are chosen
|
||||
ExcludeSelected bool `json:"exclude_selected"`
|
||||
}
|
||||
|
||||
func (entity *BusinessRecipients) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub BusinessRecipients
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*BusinessRecipients) GetClass() string {
|
||||
return ClassBusinessRecipients
|
||||
}
|
||||
|
||||
func (*BusinessRecipients) GetType() string {
|
||||
return TypeBusinessRecipients
|
||||
}
|
||||
|
||||
// Describes settings for messages that are automatically sent by a Telegram Business account when it is away
|
||||
type BusinessAwayMessageSettings struct {
|
||||
meta
|
||||
// Unique quick reply shortcut identifier for the away messages
|
||||
ShortcutId int32 `json:"shortcut_id"`
|
||||
// Chosen recipients of the away messages
|
||||
Recipients *BusinessRecipients `json:"recipients"`
|
||||
// Settings used to check whether the current user is away
|
||||
Schedule BusinessAwayMessageSchedule `json:"schedule"`
|
||||
// True, if the messages must not be sent if the account was online in the last 10 minutes
|
||||
OfflineOnly bool `json:"offline_only"`
|
||||
}
|
||||
|
||||
func (entity *BusinessAwayMessageSettings) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub BusinessAwayMessageSettings
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*BusinessAwayMessageSettings) GetClass() string {
|
||||
return ClassBusinessAwayMessageSettings
|
||||
}
|
||||
|
||||
func (*BusinessAwayMessageSettings) GetType() string {
|
||||
return TypeBusinessAwayMessageSettings
|
||||
}
|
||||
|
||||
func (businessAwayMessageSettings *BusinessAwayMessageSettings) UnmarshalJSON(data []byte) error {
|
||||
var tmp struct {
|
||||
ShortcutId int32 `json:"shortcut_id"`
|
||||
Recipients *BusinessRecipients `json:"recipients"`
|
||||
Schedule json.RawMessage `json:"schedule"`
|
||||
OfflineOnly bool `json:"offline_only"`
|
||||
}
|
||||
|
||||
err := json.Unmarshal(data, &tmp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
businessAwayMessageSettings.ShortcutId = tmp.ShortcutId
|
||||
businessAwayMessageSettings.Recipients = tmp.Recipients
|
||||
businessAwayMessageSettings.OfflineOnly = tmp.OfflineOnly
|
||||
|
||||
fieldSchedule, _ := UnmarshalBusinessAwayMessageSchedule(tmp.Schedule)
|
||||
businessAwayMessageSettings.Schedule = fieldSchedule
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Describes settings for greeting messages that are automatically sent by a Telegram Business account as response to incoming messages in an inactive private chat
|
||||
type BusinessGreetingMessageSettings struct {
|
||||
meta
|
||||
// Unique quick reply shortcut identifier for the greeting messages
|
||||
ShortcutId int32 `json:"shortcut_id"`
|
||||
// Chosen recipients of the greeting messages
|
||||
Recipients *BusinessRecipients `json:"recipients"`
|
||||
// The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28
|
||||
InactivityDays int32 `json:"inactivity_days"`
|
||||
}
|
||||
|
||||
func (entity *BusinessGreetingMessageSettings) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub BusinessGreetingMessageSettings
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*BusinessGreetingMessageSettings) GetClass() string {
|
||||
return ClassBusinessGreetingMessageSettings
|
||||
}
|
||||
|
||||
func (*BusinessGreetingMessageSettings) GetType() string {
|
||||
return TypeBusinessGreetingMessageSettings
|
||||
}
|
||||
|
||||
// Describes a bot connected to a business account
|
||||
type BusinessConnectedBot struct {
|
||||
meta
|
||||
// User identifier of the bot
|
||||
BotUserId int64 `json:"bot_user_id"`
|
||||
// Private chats that will be accessible to the bot
|
||||
Recipients *BusinessRecipients `json:"recipients"`
|
||||
// True, if the bot can send messages to the private chats; false otherwise
|
||||
CanReply bool `json:"can_reply"`
|
||||
}
|
||||
|
||||
func (entity *BusinessConnectedBot) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub BusinessConnectedBot
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*BusinessConnectedBot) GetClass() string {
|
||||
return ClassBusinessConnectedBot
|
||||
}
|
||||
|
||||
func (*BusinessConnectedBot) GetType() string {
|
||||
return TypeBusinessConnectedBot
|
||||
}
|
||||
|
||||
// Describes an interval of time when the business is open
|
||||
type BusinessOpeningHoursInterval struct {
|
||||
meta
|
||||
// The first minute of the interval since start of the week; 0-7*24*60
|
||||
StartMinute int32 `json:"start_minute"`
|
||||
// The first minute after the end of the interval since start of the week; 1-8*24*60
|
||||
EndMinute int32 `json:"end_minute"`
|
||||
}
|
||||
|
||||
func (entity *BusinessOpeningHoursInterval) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub BusinessOpeningHoursInterval
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*BusinessOpeningHoursInterval) GetClass() string {
|
||||
return ClassBusinessOpeningHoursInterval
|
||||
}
|
||||
|
||||
func (*BusinessOpeningHoursInterval) GetType() string {
|
||||
return TypeBusinessOpeningHoursInterval
|
||||
}
|
||||
|
||||
// Describes opening hours of a business
|
||||
type BusinessOpeningHours struct {
|
||||
meta
|
||||
// Unique time zone identifier
|
||||
TimeZoneId string `json:"time_zone_id"`
|
||||
// Intervals of the time when the business is open
|
||||
OpeningHours []*BusinessOpeningHoursInterval `json:"opening_hours"`
|
||||
}
|
||||
|
||||
func (entity *BusinessOpeningHours) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub BusinessOpeningHours
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*BusinessOpeningHours) GetClass() string {
|
||||
return ClassBusinessOpeningHours
|
||||
}
|
||||
|
||||
func (*BusinessOpeningHours) GetType() string {
|
||||
return TypeBusinessOpeningHours
|
||||
}
|
||||
|
||||
// Contains information about a Telegram Business account
|
||||
type BusinessInfo struct {
|
||||
meta
|
||||
// Location of the business; may be null if none
|
||||
Location *BusinessLocation `json:"location"`
|
||||
// Opening hours of the business; may be null if none. The hours are guaranteed to be valid and has already been split by week days
|
||||
OpeningHours *BusinessOpeningHours `json:"opening_hours"`
|
||||
// The greeting message; may be null if none or the Business account is not of the current user
|
||||
GreetingMessageSettings *BusinessGreetingMessageSettings `json:"greeting_message_settings"`
|
||||
// The away message; may be null if none or the Business account is not of the current user
|
||||
AwayMessageSettings *BusinessAwayMessageSettings `json:"away_message_settings"`
|
||||
}
|
||||
|
||||
func (entity *BusinessInfo) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub BusinessInfo
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*BusinessInfo) GetClass() string {
|
||||
return ClassBusinessInfo
|
||||
}
|
||||
|
||||
func (*BusinessInfo) GetType() string {
|
||||
return TypeBusinessInfo
|
||||
}
|
||||
|
||||
// Information about the sticker, which was used to create the chat photo
|
||||
type ChatPhotoStickerTypeRegularOrMask struct {
|
||||
meta
|
||||
|
|
@ -6941,6 +7302,8 @@ type UserFullInfo struct {
|
|||
PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"`
|
||||
// Number of group chats where both the other user and the current user are a member; 0 for the current user
|
||||
GroupInCommonCount int32 `json:"group_in_common_count"`
|
||||
// Information about business settings for Telegram Business accounts; may be null if none
|
||||
BusinessInfo *BusinessInfo `json:"business_info"`
|
||||
// For bots, information about the bot; may be null if the user isn't a bot
|
||||
BotInfo *BotInfo `json:"bot_info"`
|
||||
}
|
||||
|
|
@ -6978,6 +7341,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error {
|
|||
Bio *FormattedText `json:"bio"`
|
||||
PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"`
|
||||
GroupInCommonCount int32 `json:"group_in_common_count"`
|
||||
BusinessInfo *BusinessInfo `json:"business_info"`
|
||||
BotInfo *BotInfo `json:"bot_info"`
|
||||
}
|
||||
|
||||
|
|
@ -7000,6 +7364,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error {
|
|||
userFullInfo.Bio = tmp.Bio
|
||||
userFullInfo.PremiumGiftOptions = tmp.PremiumGiftOptions
|
||||
userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount
|
||||
userFullInfo.BusinessInfo = tmp.BusinessInfo
|
||||
userFullInfo.BotInfo = tmp.BotInfo
|
||||
|
||||
fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList)
|
||||
|
|
@ -11138,6 +11503,8 @@ type ChatFolder struct {
|
|||
Title string `json:"title"`
|
||||
// The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder
|
||||
Icon *ChatFolderIcon `json:"icon"`
|
||||
// The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled
|
||||
ColorId int32 `json:"color_id"`
|
||||
// True, if at least one link has been created for the folder
|
||||
IsShareable bool `json:"is_shareable"`
|
||||
// The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
|
||||
|
|
@ -11189,6 +11556,8 @@ type ChatFolderInfo struct {
|
|||
Title string `json:"title"`
|
||||
// The chosen or default icon for the chat folder
|
||||
Icon *ChatFolderIcon `json:"icon"`
|
||||
// The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled
|
||||
ColorId int32 `json:"color_id"`
|
||||
// True, if at least one link has been created for the folder
|
||||
IsShareable bool `json:"is_shareable"`
|
||||
// True, if the chat folder has invite links created by the current user
|
||||
|
|
@ -11799,6 +12168,8 @@ type Chat struct {
|
|||
LastMessage *Message `json:"last_message"`
|
||||
// Positions of the chat in chat lists
|
||||
Positions []*ChatPosition `json:"positions"`
|
||||
// Chat lists to which the chat belongs. A chat can have a non-zero position in a chat list even it doesn't belong to the chat list and have no position in a chat list even it belongs to the chat list
|
||||
ChatLists []ChatList `json:"chat_lists"`
|
||||
// Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender
|
||||
MessageSenderId MessageSender `json:"message_sender_id"`
|
||||
// Block list to which the chat is added; may be null if none
|
||||
|
|
@ -11886,6 +12257,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error {
|
|||
Permissions *ChatPermissions `json:"permissions"`
|
||||
LastMessage *Message `json:"last_message"`
|
||||
Positions []*ChatPosition `json:"positions"`
|
||||
ChatLists []json.RawMessage `json:"chat_lists"`
|
||||
MessageSenderId json.RawMessage `json:"message_sender_id"`
|
||||
BlockList json.RawMessage `json:"block_list"`
|
||||
HasProtectedContent bool `json:"has_protected_content"`
|
||||
|
|
@ -11959,6 +12331,9 @@ func (chat *Chat) UnmarshalJSON(data []byte) error {
|
|||
fieldType, _ := UnmarshalChatType(tmp.Type)
|
||||
chat.Type = fieldType
|
||||
|
||||
fieldChatLists, _ := UnmarshalListOfChatList(tmp.ChatLists)
|
||||
chat.ChatLists = fieldChatLists
|
||||
|
||||
fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId)
|
||||
chat.MessageSenderId = fieldMessageSenderId
|
||||
|
||||
|
|
@ -25691,6 +26066,107 @@ func (*StoryInteractions) GetType() string {
|
|||
return TypeStoryInteractions
|
||||
}
|
||||
|
||||
// Describes a message that can be used for quick reply
|
||||
type QuickReplyMessage struct {
|
||||
meta
|
||||
// Unique message identifier among all quick replies
|
||||
Id int64 `json:"id"`
|
||||
// The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent
|
||||
SendingState MessageSendingState `json:"sending_state"`
|
||||
// True, if the message can be edited
|
||||
CanBeEdited bool `json:"can_be_edited"`
|
||||
// Information about the identifier of the quick reply message to which the message replies
|
||||
ReplyToMessageId int64 `json:"reply_to_message_id"`
|
||||
// If non-zero, the user identifier of the bot through which this message was sent
|
||||
ViaBotUserId int64 `json:"via_bot_user_id"`
|
||||
// Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums
|
||||
MediaAlbumId JsonInt64 `json:"media_album_id"`
|
||||
// Content of the message
|
||||
Content MessageContent `json:"content"`
|
||||
// Inline keyboard reply markup for the message; may be null if none
|
||||
ReplyMarkup ReplyMarkup `json:"reply_markup"`
|
||||
}
|
||||
|
||||
func (entity *QuickReplyMessage) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub QuickReplyMessage
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*QuickReplyMessage) GetClass() string {
|
||||
return ClassQuickReplyMessage
|
||||
}
|
||||
|
||||
func (*QuickReplyMessage) GetType() string {
|
||||
return TypeQuickReplyMessage
|
||||
}
|
||||
|
||||
func (quickReplyMessage *QuickReplyMessage) UnmarshalJSON(data []byte) error {
|
||||
var tmp struct {
|
||||
Id int64 `json:"id"`
|
||||
SendingState json.RawMessage `json:"sending_state"`
|
||||
CanBeEdited bool `json:"can_be_edited"`
|
||||
ReplyToMessageId int64 `json:"reply_to_message_id"`
|
||||
ViaBotUserId int64 `json:"via_bot_user_id"`
|
||||
MediaAlbumId JsonInt64 `json:"media_album_id"`
|
||||
Content json.RawMessage `json:"content"`
|
||||
ReplyMarkup json.RawMessage `json:"reply_markup"`
|
||||
}
|
||||
|
||||
err := json.Unmarshal(data, &tmp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
quickReplyMessage.Id = tmp.Id
|
||||
quickReplyMessage.CanBeEdited = tmp.CanBeEdited
|
||||
quickReplyMessage.ReplyToMessageId = tmp.ReplyToMessageId
|
||||
quickReplyMessage.ViaBotUserId = tmp.ViaBotUserId
|
||||
quickReplyMessage.MediaAlbumId = tmp.MediaAlbumId
|
||||
|
||||
fieldSendingState, _ := UnmarshalMessageSendingState(tmp.SendingState)
|
||||
quickReplyMessage.SendingState = fieldSendingState
|
||||
|
||||
fieldContent, _ := UnmarshalMessageContent(tmp.Content)
|
||||
quickReplyMessage.Content = fieldContent
|
||||
|
||||
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
|
||||
quickReplyMessage.ReplyMarkup = fieldReplyMarkup
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Describes a shortcut that can be used for a quick reply
|
||||
type QuickReplyShortcut struct {
|
||||
meta
|
||||
// Unique shortcut identifier
|
||||
Id int32 `json:"id"`
|
||||
// The name of the shortcut that can be used to use the shortcut
|
||||
Name string `json:"name"`
|
||||
// The first shortcut message
|
||||
FirstMessage *QuickReplyMessage `json:"first_message"`
|
||||
// The total number of messages in the shortcut
|
||||
MessageCount int32 `json:"message_count"`
|
||||
}
|
||||
|
||||
func (entity *QuickReplyShortcut) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub QuickReplyShortcut
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*QuickReplyShortcut) GetClass() string {
|
||||
return ClassQuickReplyShortcut
|
||||
}
|
||||
|
||||
func (*QuickReplyShortcut) GetType() string {
|
||||
return TypeQuickReplyShortcut
|
||||
}
|
||||
|
||||
// Contains a public forward as a message
|
||||
type PublicForwardMessage struct {
|
||||
meta
|
||||
|
|
@ -34229,6 +34705,56 @@ func (*ChatTheme) GetType() string {
|
|||
return TypeChatTheme
|
||||
}
|
||||
|
||||
// Describes a time zone
|
||||
type TimeZone struct {
|
||||
meta
|
||||
// Unique time zone identifier
|
||||
Id string `json:"id"`
|
||||
// Time zone name
|
||||
Name string `json:"name"`
|
||||
// Current UTC time offset for the time zone
|
||||
UtcTimeOffset int32 `json:"utc_time_offset"`
|
||||
}
|
||||
|
||||
func (entity *TimeZone) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub TimeZone
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*TimeZone) GetClass() string {
|
||||
return ClassTimeZone
|
||||
}
|
||||
|
||||
func (*TimeZone) GetType() string {
|
||||
return TypeTimeZone
|
||||
}
|
||||
|
||||
// Contains a list of time zones
|
||||
type TimeZones struct {
|
||||
meta
|
||||
// A list of time zones
|
||||
TimeZones []*TimeZone `json:"time_zones"`
|
||||
}
|
||||
|
||||
func (entity *TimeZones) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub TimeZones
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*TimeZones) GetClass() string {
|
||||
return ClassTimeZones
|
||||
}
|
||||
|
||||
func (*TimeZones) GetType() string {
|
||||
return TypeTimeZones
|
||||
}
|
||||
|
||||
// Contains a list of hashtags
|
||||
type Hashtags struct {
|
||||
meta
|
||||
|
|
@ -43713,6 +44239,102 @@ func (*UpdateChatPosition) UpdateType() string {
|
|||
return TypeUpdateChatPosition
|
||||
}
|
||||
|
||||
// A chat was added to a chat list
|
||||
type UpdateChatAddedToList struct {
|
||||
meta
|
||||
// Chat identifier
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// The chat list to which the chat was added
|
||||
ChatList ChatList `json:"chat_list"`
|
||||
}
|
||||
|
||||
func (entity *UpdateChatAddedToList) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub UpdateChatAddedToList
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*UpdateChatAddedToList) GetClass() string {
|
||||
return ClassUpdate
|
||||
}
|
||||
|
||||
func (*UpdateChatAddedToList) GetType() string {
|
||||
return TypeUpdateChatAddedToList
|
||||
}
|
||||
|
||||
func (*UpdateChatAddedToList) UpdateType() string {
|
||||
return TypeUpdateChatAddedToList
|
||||
}
|
||||
|
||||
func (updateChatAddedToList *UpdateChatAddedToList) UnmarshalJSON(data []byte) error {
|
||||
var tmp struct {
|
||||
ChatId int64 `json:"chat_id"`
|
||||
ChatList json.RawMessage `json:"chat_list"`
|
||||
}
|
||||
|
||||
err := json.Unmarshal(data, &tmp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
updateChatAddedToList.ChatId = tmp.ChatId
|
||||
|
||||
fieldChatList, _ := UnmarshalChatList(tmp.ChatList)
|
||||
updateChatAddedToList.ChatList = fieldChatList
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// A chat was removed from a chat list
|
||||
type UpdateChatRemovedFromList struct {
|
||||
meta
|
||||
// Chat identifier
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// The chat list from which the chat was removed
|
||||
ChatList ChatList `json:"chat_list"`
|
||||
}
|
||||
|
||||
func (entity *UpdateChatRemovedFromList) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub UpdateChatRemovedFromList
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*UpdateChatRemovedFromList) GetClass() string {
|
||||
return ClassUpdate
|
||||
}
|
||||
|
||||
func (*UpdateChatRemovedFromList) GetType() string {
|
||||
return TypeUpdateChatRemovedFromList
|
||||
}
|
||||
|
||||
func (*UpdateChatRemovedFromList) UpdateType() string {
|
||||
return TypeUpdateChatRemovedFromList
|
||||
}
|
||||
|
||||
func (updateChatRemovedFromList *UpdateChatRemovedFromList) UnmarshalJSON(data []byte) error {
|
||||
var tmp struct {
|
||||
ChatId int64 `json:"chat_id"`
|
||||
ChatList json.RawMessage `json:"chat_list"`
|
||||
}
|
||||
|
||||
err := json.Unmarshal(data, &tmp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
updateChatRemovedFromList.ChatId = tmp.ChatId
|
||||
|
||||
fieldChatList, _ := UnmarshalChatList(tmp.ChatList)
|
||||
updateChatRemovedFromList.ChatList = fieldChatList
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Incoming messages were read or the number of unread messages has been changed
|
||||
type UpdateChatReadInbox struct {
|
||||
meta
|
||||
|
|
@ -44467,6 +45089,8 @@ type UpdateChatFolders struct {
|
|||
ChatFolders []*ChatFolderInfo `json:"chat_folders"`
|
||||
// Position of the main chat list among chat folders, 0-based
|
||||
MainChatListPosition int32 `json:"main_chat_list_position"`
|
||||
// True, if folder tags are enabled
|
||||
AreTagsEnabled bool `json:"are_tags_enabled"`
|
||||
}
|
||||
|
||||
func (entity *UpdateChatFolders) MarshalJSON() ([]byte, error) {
|
||||
|
|
@ -44572,6 +45196,116 @@ func (*UpdateSavedMessagesTopicCount) UpdateType() string {
|
|||
return TypeUpdateSavedMessagesTopicCount
|
||||
}
|
||||
|
||||
// Basic information about a quick reply shortcut has changed. This update is guaranteed to come before the quick shortcut name is returned to the application
|
||||
type UpdateQuickReplyShortcut struct {
|
||||
meta
|
||||
// New data about the shortcut
|
||||
Shortcut *QuickReplyShortcut `json:"shortcut"`
|
||||
}
|
||||
|
||||
func (entity *UpdateQuickReplyShortcut) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub UpdateQuickReplyShortcut
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcut) GetClass() string {
|
||||
return ClassUpdate
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcut) GetType() string {
|
||||
return TypeUpdateQuickReplyShortcut
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcut) UpdateType() string {
|
||||
return TypeUpdateQuickReplyShortcut
|
||||
}
|
||||
|
||||
// A quick reply shortcut and all its messages were deleted
|
||||
type UpdateQuickReplyShortcutDeleted struct {
|
||||
meta
|
||||
// The identifier of the deleted shortcut
|
||||
ShortcutId int32 `json:"shortcut_id"`
|
||||
}
|
||||
|
||||
func (entity *UpdateQuickReplyShortcutDeleted) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub UpdateQuickReplyShortcutDeleted
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcutDeleted) GetClass() string {
|
||||
return ClassUpdate
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcutDeleted) GetType() string {
|
||||
return TypeUpdateQuickReplyShortcutDeleted
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcutDeleted) UpdateType() string {
|
||||
return TypeUpdateQuickReplyShortcutDeleted
|
||||
}
|
||||
|
||||
// The list of quick reply shortcuts has changed
|
||||
type UpdateQuickReplyShortcuts struct {
|
||||
meta
|
||||
// The new list of identifiers of quick reply shortcuts
|
||||
ShortcutIds []int32 `json:"shortcut_ids"`
|
||||
}
|
||||
|
||||
func (entity *UpdateQuickReplyShortcuts) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub UpdateQuickReplyShortcuts
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcuts) GetClass() string {
|
||||
return ClassUpdate
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcuts) GetType() string {
|
||||
return TypeUpdateQuickReplyShortcuts
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcuts) UpdateType() string {
|
||||
return TypeUpdateQuickReplyShortcuts
|
||||
}
|
||||
|
||||
// The list of quick reply shortcut messages has changed
|
||||
type UpdateQuickReplyShortcutMessages struct {
|
||||
meta
|
||||
// The identifier of the shortcut
|
||||
ShortcutId int32 `json:"shortcut_id"`
|
||||
// The new list of quick reply messages for the shortcut in order from the first to the last sent
|
||||
Messages []*QuickReplyMessage `json:"messages"`
|
||||
}
|
||||
|
||||
func (entity *UpdateQuickReplyShortcutMessages) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub UpdateQuickReplyShortcutMessages
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcutMessages) GetClass() string {
|
||||
return ClassUpdate
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcutMessages) GetType() string {
|
||||
return TypeUpdateQuickReplyShortcutMessages
|
||||
}
|
||||
|
||||
func (*UpdateQuickReplyShortcutMessages) UpdateType() string {
|
||||
return TypeUpdateQuickReplyShortcutMessages
|
||||
}
|
||||
|
||||
// Basic information about a topic in a forum chat was changed
|
||||
type UpdateForumTopicInfo struct {
|
||||
meta
|
||||
|
|
|
|||
|
|
@ -508,6 +508,43 @@ func UnmarshalListOfUserType(dataList []json.RawMessage) ([]UserType, error) {
|
|||
return list, nil
|
||||
}
|
||||
|
||||
func UnmarshalBusinessAwayMessageSchedule(data json.RawMessage) (BusinessAwayMessageSchedule, error) {
|
||||
var meta meta
|
||||
|
||||
err := json.Unmarshal(data, &meta)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch meta.Type {
|
||||
case TypeBusinessAwayMessageScheduleAlways:
|
||||
return UnmarshalBusinessAwayMessageScheduleAlways(data)
|
||||
|
||||
case TypeBusinessAwayMessageScheduleOutsideOfOpeningHours:
|
||||
return UnmarshalBusinessAwayMessageScheduleOutsideOfOpeningHours(data)
|
||||
|
||||
case TypeBusinessAwayMessageScheduleCustom:
|
||||
return UnmarshalBusinessAwayMessageScheduleCustom(data)
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
|
||||
}
|
||||
}
|
||||
|
||||
func UnmarshalListOfBusinessAwayMessageSchedule(dataList []json.RawMessage) ([]BusinessAwayMessageSchedule, error) {
|
||||
list := []BusinessAwayMessageSchedule{}
|
||||
|
||||
for _, data := range dataList {
|
||||
entity, err := UnmarshalBusinessAwayMessageSchedule(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list = append(list, entity)
|
||||
}
|
||||
|
||||
return list, nil
|
||||
}
|
||||
|
||||
func UnmarshalChatPhotoStickerType(data json.RawMessage) (ChatPhotoStickerType, error) {
|
||||
var meta meta
|
||||
|
||||
|
|
@ -6627,6 +6664,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
|
|||
case TypeUpdateChatPosition:
|
||||
return UnmarshalUpdateChatPosition(data)
|
||||
|
||||
case TypeUpdateChatAddedToList:
|
||||
return UnmarshalUpdateChatAddedToList(data)
|
||||
|
||||
case TypeUpdateChatRemovedFromList:
|
||||
return UnmarshalUpdateChatRemovedFromList(data)
|
||||
|
||||
case TypeUpdateChatReadInbox:
|
||||
return UnmarshalUpdateChatReadInbox(data)
|
||||
|
||||
|
|
@ -6708,6 +6751,18 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
|
|||
case TypeUpdateSavedMessagesTopicCount:
|
||||
return UnmarshalUpdateSavedMessagesTopicCount(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcut:
|
||||
return UnmarshalUpdateQuickReplyShortcut(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcutDeleted:
|
||||
return UnmarshalUpdateQuickReplyShortcutDeleted(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcuts:
|
||||
return UnmarshalUpdateQuickReplyShortcuts(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcutMessages:
|
||||
return UnmarshalUpdateQuickReplyShortcutMessages(data)
|
||||
|
||||
case TypeUpdateForumTopicInfo:
|
||||
return UnmarshalUpdateForumTopicInfo(data)
|
||||
|
||||
|
|
@ -7802,6 +7857,94 @@ func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) {
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalBusinessAwayMessageScheduleAlways(data json.RawMessage) (*BusinessAwayMessageScheduleAlways, error) {
|
||||
var resp BusinessAwayMessageScheduleAlways
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalBusinessAwayMessageScheduleOutsideOfOpeningHours(data json.RawMessage) (*BusinessAwayMessageScheduleOutsideOfOpeningHours, error) {
|
||||
var resp BusinessAwayMessageScheduleOutsideOfOpeningHours
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalBusinessAwayMessageScheduleCustom(data json.RawMessage) (*BusinessAwayMessageScheduleCustom, error) {
|
||||
var resp BusinessAwayMessageScheduleCustom
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalBusinessLocation(data json.RawMessage) (*BusinessLocation, error) {
|
||||
var resp BusinessLocation
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalBusinessRecipients(data json.RawMessage) (*BusinessRecipients, error) {
|
||||
var resp BusinessRecipients
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalBusinessAwayMessageSettings(data json.RawMessage) (*BusinessAwayMessageSettings, error) {
|
||||
var resp BusinessAwayMessageSettings
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalBusinessGreetingMessageSettings(data json.RawMessage) (*BusinessGreetingMessageSettings, error) {
|
||||
var resp BusinessGreetingMessageSettings
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalBusinessConnectedBot(data json.RawMessage) (*BusinessConnectedBot, error) {
|
||||
var resp BusinessConnectedBot
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalBusinessOpeningHoursInterval(data json.RawMessage) (*BusinessOpeningHoursInterval, error) {
|
||||
var resp BusinessOpeningHoursInterval
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalBusinessOpeningHours(data json.RawMessage) (*BusinessOpeningHours, error) {
|
||||
var resp BusinessOpeningHours
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalBusinessInfo(data json.RawMessage) (*BusinessInfo, error) {
|
||||
var resp BusinessInfo
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalChatPhotoStickerTypeRegularOrMask(data json.RawMessage) (*ChatPhotoStickerTypeRegularOrMask, error) {
|
||||
var resp ChatPhotoStickerTypeRegularOrMask
|
||||
|
||||
|
|
@ -12498,6 +12641,22 @@ func UnmarshalStoryInteractions(data json.RawMessage) (*StoryInteractions, error
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalQuickReplyMessage(data json.RawMessage) (*QuickReplyMessage, error) {
|
||||
var resp QuickReplyMessage
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalQuickReplyShortcut(data json.RawMessage) (*QuickReplyShortcut, error) {
|
||||
var resp QuickReplyShortcut
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalPublicForwardMessage(data json.RawMessage) (*PublicForwardMessage, error) {
|
||||
var resp PublicForwardMessage
|
||||
|
||||
|
|
@ -14578,6 +14737,22 @@ func UnmarshalChatTheme(data json.RawMessage) (*ChatTheme, error) {
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalTimeZone(data json.RawMessage) (*TimeZone, error) {
|
||||
var resp TimeZone
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalTimeZones(data json.RawMessage) (*TimeZones, error) {
|
||||
var resp TimeZones
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalHashtags(data json.RawMessage) (*Hashtags, error) {
|
||||
var resp Hashtags
|
||||
|
||||
|
|
@ -17194,6 +17369,22 @@ func UnmarshalUpdateChatPosition(data json.RawMessage) (*UpdateChatPosition, err
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateChatAddedToList(data json.RawMessage) (*UpdateChatAddedToList, error) {
|
||||
var resp UpdateChatAddedToList
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateChatRemovedFromList(data json.RawMessage) (*UpdateChatRemovedFromList, error) {
|
||||
var resp UpdateChatRemovedFromList
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateChatReadInbox(data json.RawMessage) (*UpdateChatReadInbox, error) {
|
||||
var resp UpdateChatReadInbox
|
||||
|
||||
|
|
@ -17410,6 +17601,38 @@ func UnmarshalUpdateSavedMessagesTopicCount(data json.RawMessage) (*UpdateSavedM
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateQuickReplyShortcut(data json.RawMessage) (*UpdateQuickReplyShortcut, error) {
|
||||
var resp UpdateQuickReplyShortcut
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateQuickReplyShortcutDeleted(data json.RawMessage) (*UpdateQuickReplyShortcutDeleted, error) {
|
||||
var resp UpdateQuickReplyShortcutDeleted
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateQuickReplyShortcuts(data json.RawMessage) (*UpdateQuickReplyShortcuts, error) {
|
||||
var resp UpdateQuickReplyShortcuts
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateQuickReplyShortcutMessages(data json.RawMessage) (*UpdateQuickReplyShortcutMessages, error) {
|
||||
var resp UpdateQuickReplyShortcutMessages
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateForumTopicInfo(data json.RawMessage) (*UpdateForumTopicInfo, error) {
|
||||
var resp UpdateForumTopicInfo
|
||||
|
||||
|
|
@ -18484,6 +18707,39 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeChatLocation:
|
||||
return UnmarshalChatLocation(data)
|
||||
|
||||
case TypeBusinessAwayMessageScheduleAlways:
|
||||
return UnmarshalBusinessAwayMessageScheduleAlways(data)
|
||||
|
||||
case TypeBusinessAwayMessageScheduleOutsideOfOpeningHours:
|
||||
return UnmarshalBusinessAwayMessageScheduleOutsideOfOpeningHours(data)
|
||||
|
||||
case TypeBusinessAwayMessageScheduleCustom:
|
||||
return UnmarshalBusinessAwayMessageScheduleCustom(data)
|
||||
|
||||
case TypeBusinessLocation:
|
||||
return UnmarshalBusinessLocation(data)
|
||||
|
||||
case TypeBusinessRecipients:
|
||||
return UnmarshalBusinessRecipients(data)
|
||||
|
||||
case TypeBusinessAwayMessageSettings:
|
||||
return UnmarshalBusinessAwayMessageSettings(data)
|
||||
|
||||
case TypeBusinessGreetingMessageSettings:
|
||||
return UnmarshalBusinessGreetingMessageSettings(data)
|
||||
|
||||
case TypeBusinessConnectedBot:
|
||||
return UnmarshalBusinessConnectedBot(data)
|
||||
|
||||
case TypeBusinessOpeningHoursInterval:
|
||||
return UnmarshalBusinessOpeningHoursInterval(data)
|
||||
|
||||
case TypeBusinessOpeningHours:
|
||||
return UnmarshalBusinessOpeningHours(data)
|
||||
|
||||
case TypeBusinessInfo:
|
||||
return UnmarshalBusinessInfo(data)
|
||||
|
||||
case TypeChatPhotoStickerTypeRegularOrMask:
|
||||
return UnmarshalChatPhotoStickerTypeRegularOrMask(data)
|
||||
|
||||
|
|
@ -20245,6 +20501,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeStoryInteractions:
|
||||
return UnmarshalStoryInteractions(data)
|
||||
|
||||
case TypeQuickReplyMessage:
|
||||
return UnmarshalQuickReplyMessage(data)
|
||||
|
||||
case TypeQuickReplyShortcut:
|
||||
return UnmarshalQuickReplyShortcut(data)
|
||||
|
||||
case TypePublicForwardMessage:
|
||||
return UnmarshalPublicForwardMessage(data)
|
||||
|
||||
|
|
@ -21025,6 +21287,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeChatTheme:
|
||||
return UnmarshalChatTheme(data)
|
||||
|
||||
case TypeTimeZone:
|
||||
return UnmarshalTimeZone(data)
|
||||
|
||||
case TypeTimeZones:
|
||||
return UnmarshalTimeZones(data)
|
||||
|
||||
case TypeHashtags:
|
||||
return UnmarshalHashtags(data)
|
||||
|
||||
|
|
@ -22006,6 +22274,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeUpdateChatPosition:
|
||||
return UnmarshalUpdateChatPosition(data)
|
||||
|
||||
case TypeUpdateChatAddedToList:
|
||||
return UnmarshalUpdateChatAddedToList(data)
|
||||
|
||||
case TypeUpdateChatRemovedFromList:
|
||||
return UnmarshalUpdateChatRemovedFromList(data)
|
||||
|
||||
case TypeUpdateChatReadInbox:
|
||||
return UnmarshalUpdateChatReadInbox(data)
|
||||
|
||||
|
|
@ -22087,6 +22361,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeUpdateSavedMessagesTopicCount:
|
||||
return UnmarshalUpdateSavedMessagesTopicCount(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcut:
|
||||
return UnmarshalUpdateQuickReplyShortcut(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcutDeleted:
|
||||
return UnmarshalUpdateQuickReplyShortcutDeleted(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcuts:
|
||||
return UnmarshalUpdateQuickReplyShortcuts(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcutMessages:
|
||||
return UnmarshalUpdateQuickReplyShortcutMessages(data)
|
||||
|
||||
case TypeUpdateForumTopicInfo:
|
||||
return UnmarshalUpdateForumTopicInfo(data)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue