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)
|
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 {
|
type ResendMessagesRequest struct {
|
||||||
// Identifier of the chat to send messages
|
// Identifier of the chat to send messages
|
||||||
ChatId int64 `json:"chat_id"`
|
ChatId int64 `json:"chat_id"`
|
||||||
|
|
@ -4228,6 +4260,192 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState
|
||||||
return UnmarshalOk(result.Data)
|
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
|
// Returns list of custom emojis, which can be used as forum topic icon by all users
|
||||||
func (client *Client) GetForumTopicDefaultIcons() (*Stickers, error) {
|
func (client *Client) GetForumTopicDefaultIcons() (*Stickers, error) {
|
||||||
result, err := client.Send(Request{
|
result, err := client.Send(Request{
|
||||||
|
|
@ -7296,6 +7514,32 @@ func (client *Client) ReorderChatFolders(req *ReorderChatFoldersRequest) (*Ok, e
|
||||||
return UnmarshalOk(result.Data)
|
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
|
// Returns recommended chat folders for the current user
|
||||||
func (client *Client) GetRecommendedChatFolders() (*RecommendedChatFolders, error) {
|
func (client *Client) GetRecommendedChatFolders() (*RecommendedChatFolders, error) {
|
||||||
result, err := client.Send(Request{
|
result, err := client.Send(Request{
|
||||||
|
|
@ -13429,7 +13673,7 @@ type AddRecentStickerRequest struct {
|
||||||
Sticker InputFile `json:"sticker"`
|
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) {
|
func (client *Client) AddRecentSticker(req *AddRecentStickerRequest) (*Stickers, error) {
|
||||||
result, err := client.Send(Request{
|
result, err := client.Send(Request{
|
||||||
meta: meta{
|
meta: meta{
|
||||||
|
|
@ -13530,7 +13774,7 @@ type AddFavoriteStickerRequest struct {
|
||||||
Sticker InputFile `json:"sticker"`
|
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) {
|
func (client *Client) AddFavoriteSticker(req *AddFavoriteStickerRequest) (*Ok, error) {
|
||||||
result, err := client.Send(Request{
|
result, err := client.Send(Request{
|
||||||
meta: meta{
|
meta: meta{
|
||||||
|
|
@ -14305,7 +14549,7 @@ type SetLocationRequest struct {
|
||||||
Location *Location `json:"location"`
|
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) {
|
func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) {
|
||||||
result, err := client.Send(Request{
|
result, err := client.Send(Request{
|
||||||
meta: meta{
|
meta: meta{
|
||||||
|
|
@ -14326,6 +14570,110 @@ func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) {
|
||||||
return UnmarshalOk(result.Data)
|
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 {
|
type ChangePhoneNumberRequest struct {
|
||||||
// The new phone number of the user in international format
|
// The new phone number of the user in international format
|
||||||
PhoneNumber string `json:"phone_number"`
|
PhoneNumber string `json:"phone_number"`
|
||||||
|
|
@ -14400,6 +14748,77 @@ func (client *Client) CheckChangePhoneNumberCode(req *CheckChangePhoneNumberCode
|
||||||
return UnmarshalOk(result.Data)
|
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
|
// Returns an HTTPS link, which can be used to get information about the current user
|
||||||
func (client *Client) GetUserLink() (*UserLink, error) {
|
func (client *Client) GetUserLink() (*UserLink, error) {
|
||||||
result, err := client.Send(Request{
|
result, err := client.Send(Request{
|
||||||
|
|
@ -15829,6 +16248,25 @@ func (client *Client) GetChatEventLog(req *GetChatEventLogRequest) (*ChatEvents,
|
||||||
return UnmarshalChatEvents(result.Data)
|
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 {
|
type GetPaymentFormRequest struct {
|
||||||
// The invoice
|
// The invoice
|
||||||
InputInvoice InputInvoice `json:"input_invoice"`
|
InputInvoice InputInvoice `json:"input_invoice"`
|
||||||
|
|
@ -20332,6 +20770,12 @@ func (client *Client) TestUseUpdate() (Update, error) {
|
||||||
case TypeUpdateChatPosition:
|
case TypeUpdateChatPosition:
|
||||||
return UnmarshalUpdateChatPosition(result.Data)
|
return UnmarshalUpdateChatPosition(result.Data)
|
||||||
|
|
||||||
|
case TypeUpdateChatAddedToList:
|
||||||
|
return UnmarshalUpdateChatAddedToList(result.Data)
|
||||||
|
|
||||||
|
case TypeUpdateChatRemovedFromList:
|
||||||
|
return UnmarshalUpdateChatRemovedFromList(result.Data)
|
||||||
|
|
||||||
case TypeUpdateChatReadInbox:
|
case TypeUpdateChatReadInbox:
|
||||||
return UnmarshalUpdateChatReadInbox(result.Data)
|
return UnmarshalUpdateChatReadInbox(result.Data)
|
||||||
|
|
||||||
|
|
@ -20413,6 +20857,18 @@ func (client *Client) TestUseUpdate() (Update, error) {
|
||||||
case TypeUpdateSavedMessagesTopicCount:
|
case TypeUpdateSavedMessagesTopicCount:
|
||||||
return UnmarshalUpdateSavedMessagesTopicCount(result.Data)
|
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:
|
case TypeUpdateForumTopicInfo:
|
||||||
return UnmarshalUpdateForumTopicInfo(result.Data)
|
return UnmarshalUpdateForumTopicInfo(result.Data)
|
||||||
|
|
||||||
|
|
|
||||||
734
client/type.go
734
client/type.go
|
|
@ -19,6 +19,7 @@ const (
|
||||||
ClassStickerFullType = "StickerFullType"
|
ClassStickerFullType = "StickerFullType"
|
||||||
ClassPollType = "PollType"
|
ClassPollType = "PollType"
|
||||||
ClassUserType = "UserType"
|
ClassUserType = "UserType"
|
||||||
|
ClassBusinessAwayMessageSchedule = "BusinessAwayMessageSchedule"
|
||||||
ClassChatPhotoStickerType = "ChatPhotoStickerType"
|
ClassChatPhotoStickerType = "ChatPhotoStickerType"
|
||||||
ClassInputChatPhoto = "InputChatPhoto"
|
ClassInputChatPhoto = "InputChatPhoto"
|
||||||
ClassPremiumGiveawayParticipantStatus = "PremiumGiveawayParticipantStatus"
|
ClassPremiumGiveawayParticipantStatus = "PremiumGiveawayParticipantStatus"
|
||||||
|
|
@ -187,6 +188,14 @@ const (
|
||||||
ClassBotCommands = "BotCommands"
|
ClassBotCommands = "BotCommands"
|
||||||
ClassBotMenuButton = "BotMenuButton"
|
ClassBotMenuButton = "BotMenuButton"
|
||||||
ClassChatLocation = "ChatLocation"
|
ClassChatLocation = "ChatLocation"
|
||||||
|
ClassBusinessLocation = "BusinessLocation"
|
||||||
|
ClassBusinessRecipients = "BusinessRecipients"
|
||||||
|
ClassBusinessAwayMessageSettings = "BusinessAwayMessageSettings"
|
||||||
|
ClassBusinessGreetingMessageSettings = "BusinessGreetingMessageSettings"
|
||||||
|
ClassBusinessConnectedBot = "BusinessConnectedBot"
|
||||||
|
ClassBusinessOpeningHoursInterval = "BusinessOpeningHoursInterval"
|
||||||
|
ClassBusinessOpeningHours = "BusinessOpeningHours"
|
||||||
|
ClassBusinessInfo = "BusinessInfo"
|
||||||
ClassChatPhotoSticker = "ChatPhotoSticker"
|
ClassChatPhotoSticker = "ChatPhotoSticker"
|
||||||
ClassAnimatedChatPhoto = "AnimatedChatPhoto"
|
ClassAnimatedChatPhoto = "AnimatedChatPhoto"
|
||||||
ClassChatPhoto = "ChatPhoto"
|
ClassChatPhoto = "ChatPhoto"
|
||||||
|
|
@ -355,6 +364,8 @@ const (
|
||||||
ClassChatActiveStories = "ChatActiveStories"
|
ClassChatActiveStories = "ChatActiveStories"
|
||||||
ClassStoryInteraction = "StoryInteraction"
|
ClassStoryInteraction = "StoryInteraction"
|
||||||
ClassStoryInteractions = "StoryInteractions"
|
ClassStoryInteractions = "StoryInteractions"
|
||||||
|
ClassQuickReplyMessage = "QuickReplyMessage"
|
||||||
|
ClassQuickReplyShortcut = "QuickReplyShortcut"
|
||||||
ClassPublicForwards = "PublicForwards"
|
ClassPublicForwards = "PublicForwards"
|
||||||
ClassChatBoostLevelFeatures = "ChatBoostLevelFeatures"
|
ClassChatBoostLevelFeatures = "ChatBoostLevelFeatures"
|
||||||
ClassChatBoostFeatures = "ChatBoostFeatures"
|
ClassChatBoostFeatures = "ChatBoostFeatures"
|
||||||
|
|
@ -410,6 +421,8 @@ const (
|
||||||
ClassPushReceiverId = "PushReceiverId"
|
ClassPushReceiverId = "PushReceiverId"
|
||||||
ClassThemeSettings = "ThemeSettings"
|
ClassThemeSettings = "ThemeSettings"
|
||||||
ClassChatTheme = "ChatTheme"
|
ClassChatTheme = "ChatTheme"
|
||||||
|
ClassTimeZone = "TimeZone"
|
||||||
|
ClassTimeZones = "TimeZones"
|
||||||
ClassHashtags = "Hashtags"
|
ClassHashtags = "Hashtags"
|
||||||
ClassNotificationSound = "NotificationSound"
|
ClassNotificationSound = "NotificationSound"
|
||||||
ClassNotificationSounds = "NotificationSounds"
|
ClassNotificationSounds = "NotificationSounds"
|
||||||
|
|
@ -576,6 +589,17 @@ const (
|
||||||
TypeBotCommands = "botCommands"
|
TypeBotCommands = "botCommands"
|
||||||
TypeBotMenuButton = "botMenuButton"
|
TypeBotMenuButton = "botMenuButton"
|
||||||
TypeChatLocation = "chatLocation"
|
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"
|
TypeChatPhotoStickerTypeRegularOrMask = "chatPhotoStickerTypeRegularOrMask"
|
||||||
TypeChatPhotoStickerTypeCustomEmoji = "chatPhotoStickerTypeCustomEmoji"
|
TypeChatPhotoStickerTypeCustomEmoji = "chatPhotoStickerTypeCustomEmoji"
|
||||||
TypeChatPhotoSticker = "chatPhotoSticker"
|
TypeChatPhotoSticker = "chatPhotoSticker"
|
||||||
|
|
@ -1163,6 +1187,8 @@ const (
|
||||||
TypeStoryInteractionTypeRepost = "storyInteractionTypeRepost"
|
TypeStoryInteractionTypeRepost = "storyInteractionTypeRepost"
|
||||||
TypeStoryInteraction = "storyInteraction"
|
TypeStoryInteraction = "storyInteraction"
|
||||||
TypeStoryInteractions = "storyInteractions"
|
TypeStoryInteractions = "storyInteractions"
|
||||||
|
TypeQuickReplyMessage = "quickReplyMessage"
|
||||||
|
TypeQuickReplyShortcut = "quickReplyShortcut"
|
||||||
TypePublicForwardMessage = "publicForwardMessage"
|
TypePublicForwardMessage = "publicForwardMessage"
|
||||||
TypePublicForwardStory = "publicForwardStory"
|
TypePublicForwardStory = "publicForwardStory"
|
||||||
TypePublicForwards = "publicForwards"
|
TypePublicForwards = "publicForwards"
|
||||||
|
|
@ -1423,6 +1449,8 @@ const (
|
||||||
TypeInputBackgroundPrevious = "inputBackgroundPrevious"
|
TypeInputBackgroundPrevious = "inputBackgroundPrevious"
|
||||||
TypeThemeSettings = "themeSettings"
|
TypeThemeSettings = "themeSettings"
|
||||||
TypeChatTheme = "chatTheme"
|
TypeChatTheme = "chatTheme"
|
||||||
|
TypeTimeZone = "timeZone"
|
||||||
|
TypeTimeZones = "timeZones"
|
||||||
TypeHashtags = "hashtags"
|
TypeHashtags = "hashtags"
|
||||||
TypeCanSendStoryResultOk = "canSendStoryResultOk"
|
TypeCanSendStoryResultOk = "canSendStoryResultOk"
|
||||||
TypeCanSendStoryResultPremiumNeeded = "canSendStoryResultPremiumNeeded"
|
TypeCanSendStoryResultPremiumNeeded = "canSendStoryResultPremiumNeeded"
|
||||||
|
|
@ -1750,6 +1778,8 @@ const (
|
||||||
TypeUpdateChatPermissions = "updateChatPermissions"
|
TypeUpdateChatPermissions = "updateChatPermissions"
|
||||||
TypeUpdateChatLastMessage = "updateChatLastMessage"
|
TypeUpdateChatLastMessage = "updateChatLastMessage"
|
||||||
TypeUpdateChatPosition = "updateChatPosition"
|
TypeUpdateChatPosition = "updateChatPosition"
|
||||||
|
TypeUpdateChatAddedToList = "updateChatAddedToList"
|
||||||
|
TypeUpdateChatRemovedFromList = "updateChatRemovedFromList"
|
||||||
TypeUpdateChatReadInbox = "updateChatReadInbox"
|
TypeUpdateChatReadInbox = "updateChatReadInbox"
|
||||||
TypeUpdateChatReadOutbox = "updateChatReadOutbox"
|
TypeUpdateChatReadOutbox = "updateChatReadOutbox"
|
||||||
TypeUpdateChatActionBar = "updateChatActionBar"
|
TypeUpdateChatActionBar = "updateChatActionBar"
|
||||||
|
|
@ -1777,6 +1807,10 @@ const (
|
||||||
TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount"
|
TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount"
|
||||||
TypeUpdateSavedMessagesTopic = "updateSavedMessagesTopic"
|
TypeUpdateSavedMessagesTopic = "updateSavedMessagesTopic"
|
||||||
TypeUpdateSavedMessagesTopicCount = "updateSavedMessagesTopicCount"
|
TypeUpdateSavedMessagesTopicCount = "updateSavedMessagesTopicCount"
|
||||||
|
TypeUpdateQuickReplyShortcut = "updateQuickReplyShortcut"
|
||||||
|
TypeUpdateQuickReplyShortcutDeleted = "updateQuickReplyShortcutDeleted"
|
||||||
|
TypeUpdateQuickReplyShortcuts = "updateQuickReplyShortcuts"
|
||||||
|
TypeUpdateQuickReplyShortcutMessages = "updateQuickReplyShortcutMessages"
|
||||||
TypeUpdateForumTopicInfo = "updateForumTopicInfo"
|
TypeUpdateForumTopicInfo = "updateForumTopicInfo"
|
||||||
TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings"
|
TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings"
|
||||||
TypeUpdateNotification = "updateNotification"
|
TypeUpdateNotification = "updateNotification"
|
||||||
|
|
@ -1935,6 +1969,11 @@ type UserType interface {
|
||||||
UserTypeType() string
|
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
|
// Describes type of a sticker, which was used to create a chat photo
|
||||||
type ChatPhotoStickerType interface {
|
type ChatPhotoStickerType interface {
|
||||||
ChatPhotoStickerTypeType() string
|
ChatPhotoStickerTypeType() string
|
||||||
|
|
@ -5632,6 +5671,328 @@ func (*ChatLocation) GetType() string {
|
||||||
return TypeChatLocation
|
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
|
// Information about the sticker, which was used to create the chat photo
|
||||||
type ChatPhotoStickerTypeRegularOrMask struct {
|
type ChatPhotoStickerTypeRegularOrMask struct {
|
||||||
meta
|
meta
|
||||||
|
|
@ -6941,6 +7302,8 @@ type UserFullInfo struct {
|
||||||
PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"`
|
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
|
// 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"`
|
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
|
// For bots, information about the bot; may be null if the user isn't a bot
|
||||||
BotInfo *BotInfo `json:"bot_info"`
|
BotInfo *BotInfo `json:"bot_info"`
|
||||||
}
|
}
|
||||||
|
|
@ -6978,6 +7341,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error {
|
||||||
Bio *FormattedText `json:"bio"`
|
Bio *FormattedText `json:"bio"`
|
||||||
PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"`
|
PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"`
|
||||||
GroupInCommonCount int32 `json:"group_in_common_count"`
|
GroupInCommonCount int32 `json:"group_in_common_count"`
|
||||||
|
BusinessInfo *BusinessInfo `json:"business_info"`
|
||||||
BotInfo *BotInfo `json:"bot_info"`
|
BotInfo *BotInfo `json:"bot_info"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7000,6 +7364,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error {
|
||||||
userFullInfo.Bio = tmp.Bio
|
userFullInfo.Bio = tmp.Bio
|
||||||
userFullInfo.PremiumGiftOptions = tmp.PremiumGiftOptions
|
userFullInfo.PremiumGiftOptions = tmp.PremiumGiftOptions
|
||||||
userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount
|
userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount
|
||||||
|
userFullInfo.BusinessInfo = tmp.BusinessInfo
|
||||||
userFullInfo.BotInfo = tmp.BotInfo
|
userFullInfo.BotInfo = tmp.BotInfo
|
||||||
|
|
||||||
fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList)
|
fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList)
|
||||||
|
|
@ -11138,6 +11503,8 @@ type ChatFolder struct {
|
||||||
Title string `json:"title"`
|
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
|
// 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"`
|
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
|
// True, if at least one link has been created for the folder
|
||||||
IsShareable bool `json:"is_shareable"`
|
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
|
// 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"`
|
Title string `json:"title"`
|
||||||
// The chosen or default icon for the chat folder
|
// The chosen or default icon for the chat folder
|
||||||
Icon *ChatFolderIcon `json:"icon"`
|
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
|
// True, if at least one link has been created for the folder
|
||||||
IsShareable bool `json:"is_shareable"`
|
IsShareable bool `json:"is_shareable"`
|
||||||
// True, if the chat folder has invite links created by the current user
|
// 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"`
|
LastMessage *Message `json:"last_message"`
|
||||||
// Positions of the chat in chat lists
|
// Positions of the chat in chat lists
|
||||||
Positions []*ChatPosition `json:"positions"`
|
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
|
// 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"`
|
MessageSenderId MessageSender `json:"message_sender_id"`
|
||||||
// Block list to which the chat is added; may be null if none
|
// 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"`
|
Permissions *ChatPermissions `json:"permissions"`
|
||||||
LastMessage *Message `json:"last_message"`
|
LastMessage *Message `json:"last_message"`
|
||||||
Positions []*ChatPosition `json:"positions"`
|
Positions []*ChatPosition `json:"positions"`
|
||||||
|
ChatLists []json.RawMessage `json:"chat_lists"`
|
||||||
MessageSenderId json.RawMessage `json:"message_sender_id"`
|
MessageSenderId json.RawMessage `json:"message_sender_id"`
|
||||||
BlockList json.RawMessage `json:"block_list"`
|
BlockList json.RawMessage `json:"block_list"`
|
||||||
HasProtectedContent bool `json:"has_protected_content"`
|
HasProtectedContent bool `json:"has_protected_content"`
|
||||||
|
|
@ -11959,6 +12331,9 @@ func (chat *Chat) UnmarshalJSON(data []byte) error {
|
||||||
fieldType, _ := UnmarshalChatType(tmp.Type)
|
fieldType, _ := UnmarshalChatType(tmp.Type)
|
||||||
chat.Type = fieldType
|
chat.Type = fieldType
|
||||||
|
|
||||||
|
fieldChatLists, _ := UnmarshalListOfChatList(tmp.ChatLists)
|
||||||
|
chat.ChatLists = fieldChatLists
|
||||||
|
|
||||||
fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId)
|
fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId)
|
||||||
chat.MessageSenderId = fieldMessageSenderId
|
chat.MessageSenderId = fieldMessageSenderId
|
||||||
|
|
||||||
|
|
@ -25691,6 +26066,107 @@ func (*StoryInteractions) GetType() string {
|
||||||
return TypeStoryInteractions
|
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
|
// Contains a public forward as a message
|
||||||
type PublicForwardMessage struct {
|
type PublicForwardMessage struct {
|
||||||
meta
|
meta
|
||||||
|
|
@ -34229,6 +34705,56 @@ func (*ChatTheme) GetType() string {
|
||||||
return TypeChatTheme
|
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
|
// Contains a list of hashtags
|
||||||
type Hashtags struct {
|
type Hashtags struct {
|
||||||
meta
|
meta
|
||||||
|
|
@ -43713,6 +44239,102 @@ func (*UpdateChatPosition) UpdateType() string {
|
||||||
return TypeUpdateChatPosition
|
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
|
// Incoming messages were read or the number of unread messages has been changed
|
||||||
type UpdateChatReadInbox struct {
|
type UpdateChatReadInbox struct {
|
||||||
meta
|
meta
|
||||||
|
|
@ -44467,6 +45089,8 @@ type UpdateChatFolders struct {
|
||||||
ChatFolders []*ChatFolderInfo `json:"chat_folders"`
|
ChatFolders []*ChatFolderInfo `json:"chat_folders"`
|
||||||
// Position of the main chat list among chat folders, 0-based
|
// Position of the main chat list among chat folders, 0-based
|
||||||
MainChatListPosition int32 `json:"main_chat_list_position"`
|
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) {
|
func (entity *UpdateChatFolders) MarshalJSON() ([]byte, error) {
|
||||||
|
|
@ -44572,6 +45196,116 @@ func (*UpdateSavedMessagesTopicCount) UpdateType() string {
|
||||||
return TypeUpdateSavedMessagesTopicCount
|
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
|
// Basic information about a topic in a forum chat was changed
|
||||||
type UpdateForumTopicInfo struct {
|
type UpdateForumTopicInfo struct {
|
||||||
meta
|
meta
|
||||||
|
|
|
||||||
|
|
@ -508,6 +508,43 @@ func UnmarshalListOfUserType(dataList []json.RawMessage) ([]UserType, error) {
|
||||||
return list, nil
|
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) {
|
func UnmarshalChatPhotoStickerType(data json.RawMessage) (ChatPhotoStickerType, error) {
|
||||||
var meta meta
|
var meta meta
|
||||||
|
|
||||||
|
|
@ -6627,6 +6664,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
|
||||||
case TypeUpdateChatPosition:
|
case TypeUpdateChatPosition:
|
||||||
return UnmarshalUpdateChatPosition(data)
|
return UnmarshalUpdateChatPosition(data)
|
||||||
|
|
||||||
|
case TypeUpdateChatAddedToList:
|
||||||
|
return UnmarshalUpdateChatAddedToList(data)
|
||||||
|
|
||||||
|
case TypeUpdateChatRemovedFromList:
|
||||||
|
return UnmarshalUpdateChatRemovedFromList(data)
|
||||||
|
|
||||||
case TypeUpdateChatReadInbox:
|
case TypeUpdateChatReadInbox:
|
||||||
return UnmarshalUpdateChatReadInbox(data)
|
return UnmarshalUpdateChatReadInbox(data)
|
||||||
|
|
||||||
|
|
@ -6708,6 +6751,18 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
|
||||||
case TypeUpdateSavedMessagesTopicCount:
|
case TypeUpdateSavedMessagesTopicCount:
|
||||||
return UnmarshalUpdateSavedMessagesTopicCount(data)
|
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:
|
case TypeUpdateForumTopicInfo:
|
||||||
return UnmarshalUpdateForumTopicInfo(data)
|
return UnmarshalUpdateForumTopicInfo(data)
|
||||||
|
|
||||||
|
|
@ -7802,6 +7857,94 @@ func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) {
|
||||||
return &resp, err
|
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) {
|
func UnmarshalChatPhotoStickerTypeRegularOrMask(data json.RawMessage) (*ChatPhotoStickerTypeRegularOrMask, error) {
|
||||||
var resp ChatPhotoStickerTypeRegularOrMask
|
var resp ChatPhotoStickerTypeRegularOrMask
|
||||||
|
|
||||||
|
|
@ -12498,6 +12641,22 @@ func UnmarshalStoryInteractions(data json.RawMessage) (*StoryInteractions, error
|
||||||
return &resp, err
|
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) {
|
func UnmarshalPublicForwardMessage(data json.RawMessage) (*PublicForwardMessage, error) {
|
||||||
var resp PublicForwardMessage
|
var resp PublicForwardMessage
|
||||||
|
|
||||||
|
|
@ -14578,6 +14737,22 @@ func UnmarshalChatTheme(data json.RawMessage) (*ChatTheme, error) {
|
||||||
return &resp, err
|
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) {
|
func UnmarshalHashtags(data json.RawMessage) (*Hashtags, error) {
|
||||||
var resp Hashtags
|
var resp Hashtags
|
||||||
|
|
||||||
|
|
@ -17194,6 +17369,22 @@ func UnmarshalUpdateChatPosition(data json.RawMessage) (*UpdateChatPosition, err
|
||||||
return &resp, 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) {
|
func UnmarshalUpdateChatReadInbox(data json.RawMessage) (*UpdateChatReadInbox, error) {
|
||||||
var resp UpdateChatReadInbox
|
var resp UpdateChatReadInbox
|
||||||
|
|
||||||
|
|
@ -17410,6 +17601,38 @@ func UnmarshalUpdateSavedMessagesTopicCount(data json.RawMessage) (*UpdateSavedM
|
||||||
return &resp, err
|
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) {
|
func UnmarshalUpdateForumTopicInfo(data json.RawMessage) (*UpdateForumTopicInfo, error) {
|
||||||
var resp UpdateForumTopicInfo
|
var resp UpdateForumTopicInfo
|
||||||
|
|
||||||
|
|
@ -18484,6 +18707,39 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
||||||
case TypeChatLocation:
|
case TypeChatLocation:
|
||||||
return UnmarshalChatLocation(data)
|
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:
|
case TypeChatPhotoStickerTypeRegularOrMask:
|
||||||
return UnmarshalChatPhotoStickerTypeRegularOrMask(data)
|
return UnmarshalChatPhotoStickerTypeRegularOrMask(data)
|
||||||
|
|
||||||
|
|
@ -20245,6 +20501,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
||||||
case TypeStoryInteractions:
|
case TypeStoryInteractions:
|
||||||
return UnmarshalStoryInteractions(data)
|
return UnmarshalStoryInteractions(data)
|
||||||
|
|
||||||
|
case TypeQuickReplyMessage:
|
||||||
|
return UnmarshalQuickReplyMessage(data)
|
||||||
|
|
||||||
|
case TypeQuickReplyShortcut:
|
||||||
|
return UnmarshalQuickReplyShortcut(data)
|
||||||
|
|
||||||
case TypePublicForwardMessage:
|
case TypePublicForwardMessage:
|
||||||
return UnmarshalPublicForwardMessage(data)
|
return UnmarshalPublicForwardMessage(data)
|
||||||
|
|
||||||
|
|
@ -21025,6 +21287,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
||||||
case TypeChatTheme:
|
case TypeChatTheme:
|
||||||
return UnmarshalChatTheme(data)
|
return UnmarshalChatTheme(data)
|
||||||
|
|
||||||
|
case TypeTimeZone:
|
||||||
|
return UnmarshalTimeZone(data)
|
||||||
|
|
||||||
|
case TypeTimeZones:
|
||||||
|
return UnmarshalTimeZones(data)
|
||||||
|
|
||||||
case TypeHashtags:
|
case TypeHashtags:
|
||||||
return UnmarshalHashtags(data)
|
return UnmarshalHashtags(data)
|
||||||
|
|
||||||
|
|
@ -22006,6 +22274,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
||||||
case TypeUpdateChatPosition:
|
case TypeUpdateChatPosition:
|
||||||
return UnmarshalUpdateChatPosition(data)
|
return UnmarshalUpdateChatPosition(data)
|
||||||
|
|
||||||
|
case TypeUpdateChatAddedToList:
|
||||||
|
return UnmarshalUpdateChatAddedToList(data)
|
||||||
|
|
||||||
|
case TypeUpdateChatRemovedFromList:
|
||||||
|
return UnmarshalUpdateChatRemovedFromList(data)
|
||||||
|
|
||||||
case TypeUpdateChatReadInbox:
|
case TypeUpdateChatReadInbox:
|
||||||
return UnmarshalUpdateChatReadInbox(data)
|
return UnmarshalUpdateChatReadInbox(data)
|
||||||
|
|
||||||
|
|
@ -22087,6 +22361,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
||||||
case TypeUpdateSavedMessagesTopicCount:
|
case TypeUpdateSavedMessagesTopicCount:
|
||||||
return UnmarshalUpdateSavedMessagesTopicCount(data)
|
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:
|
case TypeUpdateForumTopicInfo:
|
||||||
return UnmarshalUpdateForumTopicInfo(data)
|
return UnmarshalUpdateForumTopicInfo(data)
|
||||||
|
|
||||||
|
|
|
||||||
196
data/td_api.tl
196
data/td_api.tl
|
|
@ -577,6 +577,67 @@ botMenuButton text:string url:string = BotMenuButton;
|
||||||
chatLocation location:location address:string = ChatLocation;
|
chatLocation location:location address:string = ChatLocation;
|
||||||
|
|
||||||
|
|
||||||
|
//@class BusinessAwayMessageSchedule @description Describes conditions for sending of away messages by a Telegram Business account
|
||||||
|
|
||||||
|
//@description Send away messages always
|
||||||
|
businessAwayMessageScheduleAlways = BusinessAwayMessageSchedule;
|
||||||
|
|
||||||
|
//@description Send away messages outside of the business opening hours
|
||||||
|
businessAwayMessageScheduleOutsideOfOpeningHours = BusinessAwayMessageSchedule;
|
||||||
|
|
||||||
|
//@description Send away messages only in the specified time span
|
||||||
|
//@start_date Point in time (Unix timestamp) when the away messages will start to be sent
|
||||||
|
//@end_date Point in time (Unix timestamp) when the away messages will stop to be sent
|
||||||
|
businessAwayMessageScheduleCustom start_date:int32 end_date:int32 = BusinessAwayMessageSchedule;
|
||||||
|
|
||||||
|
|
||||||
|
//@description Represents a location of a business @location The location; may be null if not specified @address Location address; 1-96 characters
|
||||||
|
businessLocation location:location address:string = BusinessLocation;
|
||||||
|
|
||||||
|
//@description Describes private chats chosen for automatic interaction with a business
|
||||||
|
//@chat_ids Identifiers of selected private chats
|
||||||
|
//@select_existing_chats True, if all existing private chats are selected
|
||||||
|
//@select_new_chats True, if all new private chats are selected
|
||||||
|
//@select_contacts True, if all private chats with contacts are selected
|
||||||
|
//@select_non_contacts True, if all private chats with non-contacts are selected
|
||||||
|
//@exclude_selected If true, then all private chats except the selected are chosen. Otherwise, only the selected chats are chosen
|
||||||
|
businessRecipients chat_ids:vector<int53> select_existing_chats:Bool select_new_chats:Bool select_contacts:Bool select_non_contacts:Bool exclude_selected:Bool = BusinessRecipients;
|
||||||
|
|
||||||
|
//@description Describes settings for messages that are automatically sent by a Telegram Business account when it is away
|
||||||
|
//@shortcut_id Unique quick reply shortcut identifier for the away messages
|
||||||
|
//@recipients Chosen recipients of the away messages
|
||||||
|
//@schedule Settings used to check whether the current user is away
|
||||||
|
//@offline_only True, if the messages must not be sent if the account was online in the last 10 minutes
|
||||||
|
businessAwayMessageSettings shortcut_id:int32 recipients:businessRecipients schedule:BusinessAwayMessageSchedule offline_only:Bool = BusinessAwayMessageSettings;
|
||||||
|
|
||||||
|
//@description Describes settings for greeting messages that are automatically sent by a Telegram Business account as response to incoming messages in an inactive private chat
|
||||||
|
//@shortcut_id Unique quick reply shortcut identifier for the greeting messages
|
||||||
|
//@recipients Chosen recipients of the greeting messages
|
||||||
|
//@inactivity_days The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28
|
||||||
|
businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients inactivity_days:int32 = BusinessGreetingMessageSettings;
|
||||||
|
|
||||||
|
//@description Describes a bot connected to a business account
|
||||||
|
//@bot_user_id User identifier of the bot
|
||||||
|
//@recipients Private chats that will be accessible to the bot
|
||||||
|
//@can_reply True, if the bot can send messages to the private chats; false otherwise
|
||||||
|
businessConnectedBot bot_user_id:int53 recipients:businessRecipients can_reply:Bool = BusinessConnectedBot;
|
||||||
|
|
||||||
|
//@description Describes an interval of time when the business is open
|
||||||
|
//@start_minute The first minute of the interval since start of the week; 0-7*24*60
|
||||||
|
//@end_minute The first minute after the end of the interval since start of the week; 1-8*24*60
|
||||||
|
businessOpeningHoursInterval start_minute:int32 end_minute:int32 = BusinessOpeningHoursInterval;
|
||||||
|
|
||||||
|
//@description Describes opening hours of a business @time_zone_id Unique time zone identifier @opening_hours Intervals of the time when the business is open
|
||||||
|
businessOpeningHours time_zone_id:string opening_hours:vector<businessOpeningHoursInterval> = BusinessOpeningHours;
|
||||||
|
|
||||||
|
//@description Contains information about a Telegram Business account
|
||||||
|
//@location Location of the business; may be null if none
|
||||||
|
//@opening_hours 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
|
||||||
|
//@greeting_message_settings The greeting message; may be null if none or the Business account is not of the current user
|
||||||
|
//@away_message_settings The away message; may be null if none or the Business account is not of the current user
|
||||||
|
businessInfo location:businessLocation opening_hours:businessOpeningHours greeting_message_settings:businessGreetingMessageSettings away_message_settings:businessAwayMessageSettings = BusinessInfo;
|
||||||
|
|
||||||
|
|
||||||
//@class ChatPhotoStickerType @description Describes type of a sticker, which was used to create a chat photo
|
//@class ChatPhotoStickerType @description Describes type of a sticker, which was used to create a chat photo
|
||||||
|
|
||||||
//@description Information about the sticker, which was used to create the chat photo
|
//@description Information about the sticker, which was used to create the chat photo
|
||||||
|
|
@ -852,8 +913,9 @@ botInfo short_description:string description:string photo:photo animation:animat
|
||||||
//@bio A short user bio; may be null for bots
|
//@bio A short user bio; may be null for bots
|
||||||
//@premium_gift_options The list of available options for gifting Telegram Premium to the user
|
//@premium_gift_options The list of available options for gifting Telegram Premium to the user
|
||||||
//@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user
|
//@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user
|
||||||
|
//@business_info Information about business settings for Telegram Business accounts; may be null if none
|
||||||
//@bot_info For bots, information about the bot; may be null if the user isn't a bot
|
//@bot_info For bots, information about the bot; may be null if the user isn't a bot
|
||||||
userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_pinned_stories:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText premium_gift_options:vector<premiumPaymentOption> group_in_common_count:int32 bot_info:botInfo = UserFullInfo;
|
userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_pinned_stories:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText premium_gift_options:vector<premiumPaymentOption> group_in_common_count:int32 business_info:businessInfo bot_info:botInfo = UserFullInfo;
|
||||||
|
|
||||||
//@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers
|
//@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers
|
||||||
users total_count:int32 user_ids:vector<int53> = Users;
|
users total_count:int32 user_ids:vector<int53> = Users;
|
||||||
|
|
@ -1567,6 +1629,7 @@ chatFolderIcon name:string = ChatFolderIcon;
|
||||||
//@description Represents a folder for user chats
|
//@description Represents a folder for user chats
|
||||||
//@title The title of the folder; 1-12 characters without line feeds
|
//@title The title of the folder; 1-12 characters without line feeds
|
||||||
//@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder
|
//@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder
|
||||||
|
//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled
|
||||||
//@is_shareable True, if at least one link has been created for the folder
|
//@is_shareable True, if at least one link has been created for the folder
|
||||||
//@pinned_chat_ids 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
|
//@pinned_chat_ids 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
|
||||||
//@included_chat_ids The chat identifiers of always included 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
|
//@included_chat_ids The chat identifiers of always included 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
|
||||||
|
|
@ -1579,15 +1642,16 @@ chatFolderIcon name:string = ChatFolderIcon;
|
||||||
//@include_bots True, if bots need to be included
|
//@include_bots True, if bots need to be included
|
||||||
//@include_groups True, if basic groups and supergroups need to be included
|
//@include_groups True, if basic groups and supergroups need to be included
|
||||||
//@include_channels True, if channels need to be included
|
//@include_channels True, if channels need to be included
|
||||||
chatFolder title:string icon:chatFolderIcon is_shareable:Bool pinned_chat_ids:vector<int53> included_chat_ids:vector<int53> excluded_chat_ids:vector<int53> exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFolder;
|
chatFolder title:string icon:chatFolderIcon color_id:int32 is_shareable:Bool pinned_chat_ids:vector<int53> included_chat_ids:vector<int53> excluded_chat_ids:vector<int53> exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFolder;
|
||||||
|
|
||||||
//@description Contains basic information about a chat folder
|
//@description Contains basic information about a chat folder
|
||||||
//@id Unique chat folder identifier
|
//@id Unique chat folder identifier
|
||||||
//@title The title of the folder; 1-12 characters without line feeds
|
//@title The title of the folder; 1-12 characters without line feeds
|
||||||
//@icon The chosen or default icon for the chat folder
|
//@icon The chosen or default icon for the chat folder
|
||||||
|
//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled
|
||||||
//@is_shareable True, if at least one link has been created for the folder
|
//@is_shareable True, if at least one link has been created for the folder
|
||||||
//@has_my_invite_links True, if the chat folder has invite links created by the current user
|
//@has_my_invite_links True, if the chat folder has invite links created by the current user
|
||||||
chatFolderInfo id:int32 title:string icon:chatFolderIcon is_shareable:Bool has_my_invite_links:Bool = ChatFolderInfo;
|
chatFolderInfo id:int32 title:string icon:chatFolderIcon color_id:int32 is_shareable:Bool has_my_invite_links:Bool = ChatFolderInfo;
|
||||||
|
|
||||||
//@description Contains a chat folder invite link
|
//@description Contains a chat folder invite link
|
||||||
//@invite_link The chat folder invite link
|
//@invite_link The chat folder invite link
|
||||||
|
|
@ -1687,6 +1751,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa
|
||||||
//@permissions Actions that non-administrator chat members are allowed to take in the chat
|
//@permissions Actions that non-administrator chat members are allowed to take in the chat
|
||||||
//@last_message Last message in the chat; may be null if none or unknown
|
//@last_message Last message in the chat; may be null if none or unknown
|
||||||
//@positions Positions of the chat in chat lists
|
//@positions Positions of the chat in chat lists
|
||||||
|
//@chat_lists 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
|
||||||
//@message_sender_id 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
|
//@message_sender_id 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
|
||||||
//@block_list Block list to which the chat is added; may be null if none
|
//@block_list Block list to which the chat is added; may be null if none
|
||||||
//@has_protected_content True, if chat content can't be saved locally, forwarded, or copied
|
//@has_protected_content True, if chat content can't be saved locally, forwarded, or copied
|
||||||
|
|
@ -1715,7 +1780,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa
|
||||||
//@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
|
//@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
|
||||||
//@draft_message A draft of a message in the chat; may be null if none
|
//@draft_message A draft of a message in the chat; may be null if none
|
||||||
//@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used
|
//@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used
|
||||||
chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector<chatPosition> message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat;
|
chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector<chatPosition> chat_lists:vector<ChatList> message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat;
|
||||||
|
|
||||||
//@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers
|
//@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers
|
||||||
chats total_count:int32 chat_ids:vector<int53> = Chats;
|
chats total_count:int32 chat_ids:vector<int53> = Chats;
|
||||||
|
|
@ -3718,6 +3783,25 @@ storyInteraction actor_id:MessageSender interaction_date:int32 block_list:BlockL
|
||||||
storyInteractions total_count:int32 total_forward_count:int32 total_reaction_count:int32 interactions:vector<storyInteraction> next_offset:string = StoryInteractions;
|
storyInteractions total_count:int32 total_forward_count:int32 total_reaction_count:int32 interactions:vector<storyInteraction> next_offset:string = StoryInteractions;
|
||||||
|
|
||||||
|
|
||||||
|
//@description Describes a message that can be used for quick reply
|
||||||
|
//@id Unique message identifier among all quick replies
|
||||||
|
//@sending_state The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent
|
||||||
|
//@can_be_edited True, if the message can be edited
|
||||||
|
//@reply_to_message_id Information about the identifier of the quick reply message to which the message replies
|
||||||
|
//@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent
|
||||||
|
//@media_album_id Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums
|
||||||
|
//@content Content of the message
|
||||||
|
//@reply_markup Inline keyboard reply markup for the message; may be null if none
|
||||||
|
quickReplyMessage id:int53 sending_state:MessageSendingState can_be_edited:Bool reply_to_message_id:int53 via_bot_user_id:int53 media_album_id:int64 content:MessageContent reply_markup:ReplyMarkup = QuickReplyMessage;
|
||||||
|
|
||||||
|
//@description Describes a shortcut that can be used for a quick reply
|
||||||
|
//@id Unique shortcut identifier
|
||||||
|
//@name The name of the shortcut that can be used to use the shortcut
|
||||||
|
//@first_message The first shortcut message
|
||||||
|
//@message_count The total number of messages in the shortcut
|
||||||
|
quickReplyShortcut id:int32 name:string first_message:quickReplyMessage message_count:int32 = QuickReplyShortcut;
|
||||||
|
|
||||||
|
|
||||||
//@class PublicForward @description Describes a public forward or repost of a story
|
//@class PublicForward @description Describes a public forward or repost of a story
|
||||||
|
|
||||||
//@description Contains a public forward as a message @message Information about the message
|
//@description Contains a public forward as a message @message Information about the message
|
||||||
|
|
@ -5027,6 +5111,16 @@ themeSettings accent_color:int32 background:background outgoing_message_fill:Bac
|
||||||
chatTheme name:string light_settings:themeSettings dark_settings:themeSettings = ChatTheme;
|
chatTheme name:string light_settings:themeSettings dark_settings:themeSettings = ChatTheme;
|
||||||
|
|
||||||
|
|
||||||
|
//@description Describes a time zone
|
||||||
|
//@id Unique time zone identifier
|
||||||
|
//@name Time zone name
|
||||||
|
//@utc_time_offset Current UTC time offset for the time zone
|
||||||
|
timeZone id:string name:string utc_time_offset:int32 = TimeZone;
|
||||||
|
|
||||||
|
//@description Contains a list of time zones @time_zones A list of time zones
|
||||||
|
timeZones time_zones:vector<timeZone> = TimeZones;
|
||||||
|
|
||||||
|
|
||||||
//@description Contains a list of hashtags @hashtags A list of hashtags
|
//@description Contains a list of hashtags @hashtags A list of hashtags
|
||||||
hashtags hashtags:vector<string> = Hashtags;
|
hashtags hashtags:vector<string> = Hashtags;
|
||||||
|
|
||||||
|
|
@ -6456,6 +6550,12 @@ updateChatLastMessage chat_id:int53 last_message:message positions:vector<chatPo
|
||||||
//@position New chat position. If new order is 0, then the chat needs to be removed from the list
|
//@position New chat position. If new order is 0, then the chat needs to be removed from the list
|
||||||
updateChatPosition chat_id:int53 position:chatPosition = Update;
|
updateChatPosition chat_id:int53 position:chatPosition = Update;
|
||||||
|
|
||||||
|
//@description A chat was added to a chat list @chat_id Chat identifier @chat_list The chat list to which the chat was added
|
||||||
|
updateChatAddedToList chat_id:int53 chat_list:ChatList = Update;
|
||||||
|
|
||||||
|
//@description A chat was removed from a chat list @chat_id Chat identifier @chat_list The chat list from which the chat was removed
|
||||||
|
updateChatRemovedFromList chat_id:int53 chat_list:ChatList = Update;
|
||||||
|
|
||||||
//@description Incoming messages were read or the number of unread messages has been changed @chat_id Chat identifier @last_read_inbox_message_id Identifier of the last read incoming message @unread_count The number of unread messages left in the chat
|
//@description Incoming messages were read or the number of unread messages has been changed @chat_id Chat identifier @last_read_inbox_message_id Identifier of the last read incoming message @unread_count The number of unread messages left in the chat
|
||||||
updateChatReadInbox chat_id:int53 last_read_inbox_message_id:int53 unread_count:int32 = Update;
|
updateChatReadInbox chat_id:int53 last_read_inbox_message_id:int53 unread_count:int32 = Update;
|
||||||
|
|
||||||
|
|
@ -6532,8 +6632,11 @@ updateChatBlockList chat_id:int53 block_list:BlockList = Update;
|
||||||
//@description A chat's has_scheduled_messages field has changed @chat_id Chat identifier @has_scheduled_messages New value of has_scheduled_messages
|
//@description A chat's has_scheduled_messages field has changed @chat_id Chat identifier @has_scheduled_messages New value of has_scheduled_messages
|
||||||
updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Update;
|
updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Update;
|
||||||
|
|
||||||
//@description The list of chat folders or a chat folder has changed @chat_folders The new list of chat folders @main_chat_list_position Position of the main chat list among chat folders, 0-based
|
//@description The list of chat folders or a chat folder has changed
|
||||||
updateChatFolders chat_folders:vector<chatFolderInfo> main_chat_list_position:int32 = Update;
|
//@chat_folders The new list of chat folders
|
||||||
|
//@main_chat_list_position Position of the main chat list among chat folders, 0-based
|
||||||
|
//@are_tags_enabled True, if folder tags are enabled
|
||||||
|
updateChatFolders chat_folders:vector<chatFolderInfo> main_chat_list_position:int32 are_tags_enabled:Bool = Update;
|
||||||
|
|
||||||
//@description The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats.
|
//@description The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats.
|
||||||
//-There is no guarantee that it is sent just after the number of online users has changed
|
//-There is no guarantee that it is sent just after the number of online users has changed
|
||||||
|
|
@ -6548,6 +6651,21 @@ updateSavedMessagesTopic topic:savedMessagesTopic = Update;
|
||||||
//@description Number of Saved Messages topics has changed @topic_count Approximate total number of Saved Messages topics
|
//@description Number of Saved Messages topics has changed @topic_count Approximate total number of Saved Messages topics
|
||||||
updateSavedMessagesTopicCount topic_count:int32 = Update;
|
updateSavedMessagesTopicCount topic_count:int32 = Update;
|
||||||
|
|
||||||
|
//@description 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
|
||||||
|
//@shortcut New data about the shortcut
|
||||||
|
updateQuickReplyShortcut shortcut:quickReplyShortcut = Update;
|
||||||
|
|
||||||
|
//@description A quick reply shortcut and all its messages were deleted @shortcut_id The identifier of the deleted shortcut
|
||||||
|
updateQuickReplyShortcutDeleted shortcut_id:int32 = Update;
|
||||||
|
|
||||||
|
//@description The list of quick reply shortcuts has changed @shortcut_ids The new list of identifiers of quick reply shortcuts
|
||||||
|
updateQuickReplyShortcuts shortcut_ids:vector<int32> = Update;
|
||||||
|
|
||||||
|
//@description The list of quick reply shortcut messages has changed
|
||||||
|
//@shortcut_id The identifier of the shortcut
|
||||||
|
//@messages The new list of quick reply messages for the shortcut in order from the first to the last sent
|
||||||
|
updateQuickReplyShortcutMessages shortcut_id:int32 messages:vector<quickReplyMessage> = Update;
|
||||||
|
|
||||||
//@description Basic information about a topic in a forum chat was changed @chat_id Chat identifier @info New information about the topic
|
//@description Basic information about a topic in a forum chat was changed @chat_id Chat identifier @info New information about the topic
|
||||||
updateForumTopicInfo chat_id:int53 info:forumTopicInfo = Update;
|
updateForumTopicInfo chat_id:int53 info:forumTopicInfo = Update;
|
||||||
|
|
||||||
|
|
@ -7571,6 +7689,12 @@ sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to:Inpu
|
||||||
//@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false
|
//@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false
|
||||||
forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector<int53> options:messageSendOptions send_copy:Bool remove_caption:Bool = Messages;
|
forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector<int53> options:messageSendOptions send_copy:Bool remove_caption:Bool = Messages;
|
||||||
|
|
||||||
|
//@description Sends messages from a quick reply shortcut. Requires Telegram Business subscription
|
||||||
|
//@chat_id Identifier of the chat to which to send messages. The chat must be a private chat with a regular user
|
||||||
|
//@shortcut_id Unique identifier of the quick reply shortcut
|
||||||
|
//@sending_id Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates
|
||||||
|
sendQuickReplyShortcutMessages chat_id:int53 shortcut_id:int32 sending_id:int32 = Messages;
|
||||||
|
|
||||||
//@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed.
|
//@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed.
|
||||||
//-If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message
|
//-If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message
|
||||||
//@chat_id Identifier of the chat to send messages
|
//@chat_id Identifier of the chat to send messages
|
||||||
|
|
@ -7678,6 +7802,31 @@ editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup =
|
||||||
editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok;
|
editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok;
|
||||||
|
|
||||||
|
|
||||||
|
//@description Checks validness of a name for a quick reply shortcut. Can be called synchronously @name The name of the shortcut; 1-32 characters
|
||||||
|
checkQuickReplyShortcutName name:string = Ok;
|
||||||
|
|
||||||
|
//@description Loads quick reply shortcuts created by the current user. The loaded topics will be sent through updateQuickReplyShortcuts
|
||||||
|
loadQuickReplyShortcuts = Ok;
|
||||||
|
|
||||||
|
//@description Changes name of a quick reply shortcut @shortcut_id Unique identifier of the quick reply shortcut @name New name for the shortcut. Use checkQuickReplyShortcutName to check its validness
|
||||||
|
setQuickReplyShortcutName shortcut_id:int32 name:string = Ok;
|
||||||
|
|
||||||
|
//@description Deletes a quick reply shortcut @shortcut_id Unique identifier of the quick reply shortcut
|
||||||
|
deleteQuickReplyShortcut shortcut_id:int32 = Ok;
|
||||||
|
|
||||||
|
//@description Changes the order of quick reply shortcuts @shortcut_ids The new order of quick reply shortcuts
|
||||||
|
reorderQuickReplyShortcuts shortcut_ids:vector<int32> = Ok;
|
||||||
|
|
||||||
|
//@description Loads quick reply messages that can be sent by a given quick reply shortcut. The loaded messages will be sent through updateQuickReplyShortcutMessages
|
||||||
|
//@shortcut_id Unique identifier of the quick reply shortcut
|
||||||
|
loadQuickReplyShortcutMessages shortcut_id:int32 = Ok;
|
||||||
|
|
||||||
|
//@description Deletes specified quick reply messages
|
||||||
|
//@shortcut_id Unique identifier of the quick reply shortcut to which the messages belong
|
||||||
|
//@message_ids Unique identifiers of the messages
|
||||||
|
deleteQuickReplyShortcutMessages shortcut_id:int32 message_ids:vector<int53> = Ok;
|
||||||
|
|
||||||
|
|
||||||
//@description Returns list of custom emojis, which can be used as forum topic icon by all users
|
//@description Returns list of custom emojis, which can be used as forum topic icon by all users
|
||||||
getForumTopicDefaultIcons = Stickers;
|
getForumTopicDefaultIcons = Stickers;
|
||||||
|
|
||||||
|
|
@ -8141,6 +8290,9 @@ getChatFolderChatCount folder:chatFolder = Count;
|
||||||
//@description Changes the order of chat folders @chat_folder_ids Identifiers of chat folders in the new correct order @main_chat_list_position Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users
|
//@description Changes the order of chat folders @chat_folder_ids Identifiers of chat folders in the new correct order @main_chat_list_position Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users
|
||||||
reorderChatFolders chat_folder_ids:vector<int32> main_chat_list_position:int32 = Ok;
|
reorderChatFolders chat_folder_ids:vector<int32> main_chat_list_position:int32 = Ok;
|
||||||
|
|
||||||
|
//@description Toggles whether chat folder tags are enabled @are_tags_enabled Pass true to enable folder tags; pass false to disable them
|
||||||
|
toggleChatFolderTags are_tags_enabled:Bool = Ok;
|
||||||
|
|
||||||
//@description Returns recommended chat folders for the current user
|
//@description Returns recommended chat folders for the current user
|
||||||
getRecommendedChatFolders = RecommendedChatFolders;
|
getRecommendedChatFolders = RecommendedChatFolders;
|
||||||
|
|
||||||
|
|
@ -9115,7 +9267,7 @@ reorderInstalledStickerSets sticker_type:StickerType sticker_set_ids:vector<int6
|
||||||
getRecentStickers is_attached:Bool = Stickers;
|
getRecentStickers is_attached:Bool = Stickers;
|
||||||
|
|
||||||
//@description 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.
|
//@description 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
|
//-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
|
||||||
//@is_attached Pass true to add the sticker to the list of stickers recently attached to photo or video files; pass false to add the sticker to the list of recently sent stickers
|
//@is_attached Pass true to add the sticker to the list of stickers recently attached to photo or video files; pass false to add the sticker to the list of recently sent stickers
|
||||||
//@sticker Sticker file to add
|
//@sticker Sticker file to add
|
||||||
addRecentSticker is_attached:Bool sticker:InputFile = Stickers;
|
addRecentSticker is_attached:Bool sticker:InputFile = Stickers;
|
||||||
|
|
@ -9130,7 +9282,7 @@ clearRecentStickers is_attached:Bool = Ok;
|
||||||
getFavoriteStickers = Stickers;
|
getFavoriteStickers = Stickers;
|
||||||
|
|
||||||
//@description 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.
|
//@description 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
|
//-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
|
||||||
//@sticker Sticker file to add
|
//@sticker Sticker file to add
|
||||||
addFavoriteSticker sticker:InputFile = Ok;
|
addFavoriteSticker sticker:InputFile = Ok;
|
||||||
|
|
||||||
|
|
@ -9242,9 +9394,21 @@ reorderActiveUsernames usernames:vector<string> = Ok;
|
||||||
//@description Changes the emoji status of the current user; for Telegram Premium users only @emoji_status New emoji status; pass null to switch to the default badge
|
//@description Changes the emoji status of the current user; for Telegram Premium users only @emoji_status New emoji status; pass null to switch to the default badge
|
||||||
setEmojiStatus emoji_status:emojiStatus = Ok;
|
setEmojiStatus emoji_status:emojiStatus = Ok;
|
||||||
|
|
||||||
//@description 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 @location The new location of the user
|
//@description 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 @location The new location of the user
|
||||||
setLocation location:location = Ok;
|
setLocation location:location = Ok;
|
||||||
|
|
||||||
|
//@description Changes the business location of the current user. Requires Telegram Business subscription @location The new location of the business; pass null to remove the location
|
||||||
|
setBusinessLocation location:businessLocation = Ok;
|
||||||
|
|
||||||
|
//@description Changes the business opening hours of the current user. Requires Telegram Business subscription @opening_hours The new opening hours of the business; pass null to remove the opening hours
|
||||||
|
setBusinessOpeningHours opening_hours:businessOpeningHours = Ok;
|
||||||
|
|
||||||
|
//@description Changes the business greeting message settings of the current user. Requires Telegram Business subscription @greeting_message_settings The new settings for the greeting message of the business; pass null to disable the greeting message
|
||||||
|
setBusinessGreetingMessageSettings greeting_message_settings:businessGreetingMessageSettings = Ok;
|
||||||
|
|
||||||
|
//@description Changes the business away message settings of the current user. Requires Telegram Business subscription @away_message_settings The new settings for the away message of the business; pass null to disable the away message
|
||||||
|
setBusinessAwayMessageSettings away_message_settings:businessAwayMessageSettings = Ok;
|
||||||
|
|
||||||
//@description Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code
|
//@description Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code
|
||||||
//@phone_number The new phone number of the user in international format
|
//@phone_number The new phone number of the user in international format
|
||||||
//@settings Settings for the authentication of the user's phone number; pass null to use default settings
|
//@settings Settings for the authentication of the user's phone number; pass null to use default settings
|
||||||
|
|
@ -9257,6 +9421,16 @@ resendChangePhoneNumberCode = AuthenticationCodeInfo;
|
||||||
checkChangePhoneNumberCode code:string = Ok;
|
checkChangePhoneNumberCode code:string = Ok;
|
||||||
|
|
||||||
|
|
||||||
|
//@description Returns the business bot that is connected to the current user account. Returns a 404 error if there is no connected bot
|
||||||
|
getBusinessConnectedBot = BusinessConnectedBot;
|
||||||
|
|
||||||
|
//@description Adds or changes business bot that is connected to the current user account @bot Connection settings for the bot
|
||||||
|
setBusinessConnectedBot bot:businessConnectedBot = Ok;
|
||||||
|
|
||||||
|
//@description Deletes the business bot that is connected to the current user account @bot_user_id Unique user identifier for the bot
|
||||||
|
deleteBusinessConnectedBot bot_user_id:int53 = Ok;
|
||||||
|
|
||||||
|
|
||||||
//@description Returns an HTTPS link, which can be used to get information about the current user
|
//@description Returns an HTTPS link, which can be used to get information about the current user
|
||||||
getUserLink = UserLink;
|
getUserLink = UserLink;
|
||||||
|
|
||||||
|
|
@ -9477,6 +9651,10 @@ closeSecretChat secret_chat_id:int32 = Ok;
|
||||||
getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filters:chatEventLogFilters user_ids:vector<int53> = ChatEvents;
|
getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filters:chatEventLogFilters user_ids:vector<int53> = ChatEvents;
|
||||||
|
|
||||||
|
|
||||||
|
//@description Returns the list of supported time zones
|
||||||
|
getTimeZones = TimeZones;
|
||||||
|
|
||||||
|
|
||||||
//@description Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy
|
//@description Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy
|
||||||
//@input_invoice The invoice
|
//@input_invoice The invoice
|
||||||
//@theme Preferred payment form theme; pass null to use the default theme
|
//@theme Preferred payment form theme; pass null to use the default theme
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue