Restore sendChatScreenshotTakenNotification

This commit is contained in:
c0re100 2023-08-30 03:53:53 +08:00
parent 0b8a2f54dd
commit 26f72d96ce
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1579 additions and 1550 deletions

View file

@ -1736,7 +1736,7 @@ type GetTopChatsRequest struct {
Limit int32 `json:"limit"`
}
// Returns a list of frequently used chats. Supported only if the chat info database is enabled
// Returns a list of frequently used chats
func (client *Client) GetTopChats(req *GetTopChatsRequest) (*Chats, error) {
result, err := client.Send(Request{
meta: meta{
@ -3327,6 +3327,32 @@ func (client *Client) ResendMessages(req *ResendMessagesRequest) (*Messages, err
return UnmarshalMessages(result.Data)
}
type SendChatScreenshotTakenNotificationRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
}
// Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats
func (client *Client) SendChatScreenshotTakenNotification(req *SendChatScreenshotTakenNotificationRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "sendChatScreenshotTakenNotification",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type AddLocalMessageRequest struct {
// Target chat
ChatId int64 `json:"chat_id"`

File diff suppressed because it is too large Load diff

View file

@ -2869,6 +2869,182 @@ func UnmarshalListOfEmojiCategoryType(dataList []json.RawMessage) ([]EmojiCatego
return list, nil
}
func UnmarshalStoryAreaType(data json.RawMessage) (StoryAreaType, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeStoryAreaTypeLocation:
return UnmarshalStoryAreaTypeLocation(data)
case TypeStoryAreaTypeVenue:
return UnmarshalStoryAreaTypeVenue(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfStoryAreaType(dataList []json.RawMessage) ([]StoryAreaType, error) {
list := []StoryAreaType{}
for _, data := range dataList {
entity, err := UnmarshalStoryAreaType(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeInputStoryAreaTypeLocation:
return UnmarshalInputStoryAreaTypeLocation(data)
case TypeInputStoryAreaTypeFoundVenue:
return UnmarshalInputStoryAreaTypeFoundVenue(data)
case TypeInputStoryAreaTypePreviousVenue:
return UnmarshalInputStoryAreaTypePreviousVenue(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfInputStoryAreaType(dataList []json.RawMessage) ([]InputStoryAreaType, error) {
list := []InputStoryAreaType{}
for _, data := range dataList {
entity, err := UnmarshalInputStoryAreaType(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeStoryContentPhoto:
return UnmarshalStoryContentPhoto(data)
case TypeStoryContentVideo:
return UnmarshalStoryContentVideo(data)
case TypeStoryContentUnsupported:
return UnmarshalStoryContentUnsupported(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfStoryContent(dataList []json.RawMessage) ([]StoryContent, error) {
list := []StoryContent{}
for _, data := range dataList {
entity, err := UnmarshalStoryContent(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalInputStoryContent(data json.RawMessage) (InputStoryContent, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeInputStoryContentPhoto:
return UnmarshalInputStoryContentPhoto(data)
case TypeInputStoryContentVideo:
return UnmarshalInputStoryContentVideo(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfInputStoryContent(dataList []json.RawMessage) ([]InputStoryContent, error) {
list := []InputStoryContent{}
for _, data := range dataList {
entity, err := UnmarshalInputStoryContent(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalStoryList(data json.RawMessage) (StoryList, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeStoryListMain:
return UnmarshalStoryListMain(data)
case TypeStoryListArchive:
return UnmarshalStoryListArchive(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfStoryList(dataList []json.RawMessage) ([]StoryList, error) {
list := []StoryList{}
for _, data := range dataList {
entity, err := UnmarshalStoryList(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalCallDiscardReason(data json.RawMessage) (CallDiscardReason, error) {
var meta meta
@ -5034,182 +5210,6 @@ func UnmarshalListOfInternalLinkType(dataList []json.RawMessage) ([]InternalLink
return list, nil
}
func UnmarshalStoryAreaType(data json.RawMessage) (StoryAreaType, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeStoryAreaTypeLocation:
return UnmarshalStoryAreaTypeLocation(data)
case TypeStoryAreaTypeVenue:
return UnmarshalStoryAreaTypeVenue(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfStoryAreaType(dataList []json.RawMessage) ([]StoryAreaType, error) {
list := []StoryAreaType{}
for _, data := range dataList {
entity, err := UnmarshalStoryAreaType(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeInputStoryAreaTypeLocation:
return UnmarshalInputStoryAreaTypeLocation(data)
case TypeInputStoryAreaTypeFoundVenue:
return UnmarshalInputStoryAreaTypeFoundVenue(data)
case TypeInputStoryAreaTypePreviousVenue:
return UnmarshalInputStoryAreaTypePreviousVenue(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfInputStoryAreaType(dataList []json.RawMessage) ([]InputStoryAreaType, error) {
list := []InputStoryAreaType{}
for _, data := range dataList {
entity, err := UnmarshalInputStoryAreaType(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeStoryContentPhoto:
return UnmarshalStoryContentPhoto(data)
case TypeStoryContentVideo:
return UnmarshalStoryContentVideo(data)
case TypeStoryContentUnsupported:
return UnmarshalStoryContentUnsupported(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfStoryContent(dataList []json.RawMessage) ([]StoryContent, error) {
list := []StoryContent{}
for _, data := range dataList {
entity, err := UnmarshalStoryContent(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalInputStoryContent(data json.RawMessage) (InputStoryContent, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeInputStoryContentPhoto:
return UnmarshalInputStoryContentPhoto(data)
case TypeInputStoryContentVideo:
return UnmarshalInputStoryContentVideo(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfInputStoryContent(dataList []json.RawMessage) ([]InputStoryContent, error) {
list := []InputStoryContent{}
for _, data := range dataList {
entity, err := UnmarshalInputStoryContent(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalStoryList(data json.RawMessage) (StoryList, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeStoryListMain:
return UnmarshalStoryListMain(data)
case TypeStoryListArchive:
return UnmarshalStoryListArchive(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfStoryList(dataList []json.RawMessage) ([]StoryList, error) {
list := []StoryList{}
for _, data := range dataList {
entity, err := UnmarshalStoryList(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalBlockList(data json.RawMessage) (BlockList, error) {
var meta meta
@ -11087,6 +11087,198 @@ func UnmarshalEmojiCategoryTypeChatPhoto(data json.RawMessage) (*EmojiCategoryTy
return &resp, err
}
func UnmarshalStoryViewer(data json.RawMessage) (*StoryViewer, error) {
var resp StoryViewer
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryViewers(data json.RawMessage) (*StoryViewers, error) {
var resp StoryViewers
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryAreaPosition(data json.RawMessage) (*StoryAreaPosition, error) {
var resp StoryAreaPosition
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryAreaTypeLocation(data json.RawMessage) (*StoryAreaTypeLocation, error) {
var resp StoryAreaTypeLocation
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryAreaTypeVenue(data json.RawMessage) (*StoryAreaTypeVenue, error) {
var resp StoryAreaTypeVenue
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) {
var resp StoryArea
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryAreaTypeLocation(data json.RawMessage) (*InputStoryAreaTypeLocation, error) {
var resp InputStoryAreaTypeLocation
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryAreaTypeFoundVenue(data json.RawMessage) (*InputStoryAreaTypeFoundVenue, error) {
var resp InputStoryAreaTypeFoundVenue
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryAreaTypePreviousVenue(data json.RawMessage) (*InputStoryAreaTypePreviousVenue, error) {
var resp InputStoryAreaTypePreviousVenue
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) {
var resp InputStoryArea
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryAreas(data json.RawMessage) (*InputStoryAreas, error) {
var resp InputStoryAreas
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryVideo(data json.RawMessage) (*StoryVideo, error) {
var resp StoryVideo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryContentPhoto(data json.RawMessage) (*StoryContentPhoto, error) {
var resp StoryContentPhoto
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryContentVideo(data json.RawMessage) (*StoryContentVideo, error) {
var resp StoryContentVideo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryContentUnsupported(data json.RawMessage) (*StoryContentUnsupported, error) {
var resp StoryContentUnsupported
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryContentPhoto(data json.RawMessage) (*InputStoryContentPhoto, error) {
var resp InputStoryContentPhoto
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryContentVideo(data json.RawMessage) (*InputStoryContentVideo, error) {
var resp InputStoryContentVideo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryListMain(data json.RawMessage) (*StoryListMain, error) {
var resp StoryListMain
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryListArchive(data json.RawMessage) (*StoryListArchive, error) {
var resp StoryListArchive
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryInteractionInfo(data json.RawMessage) (*StoryInteractionInfo, error) {
var resp StoryInteractionInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStory(data json.RawMessage) (*Story, error) {
var resp Story
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStories(data json.RawMessage) (*Stories, error) {
var resp Stories
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryInfo(data json.RawMessage) (*StoryInfo, error) {
var resp StoryInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatActiveStories(data json.RawMessage) (*ChatActiveStories, error) {
var resp ChatActiveStories
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalCallDiscardReasonEmpty(data json.RawMessage) (*CallDiscardReasonEmpty, error) {
var resp CallDiscardReasonEmpty
@ -14287,198 +14479,6 @@ func UnmarshalMessageLinkInfo(data json.RawMessage) (*MessageLinkInfo, error) {
return &resp, err
}
func UnmarshalStoryViewer(data json.RawMessage) (*StoryViewer, error) {
var resp StoryViewer
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryViewers(data json.RawMessage) (*StoryViewers, error) {
var resp StoryViewers
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryAreaPosition(data json.RawMessage) (*StoryAreaPosition, error) {
var resp StoryAreaPosition
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryAreaTypeLocation(data json.RawMessage) (*StoryAreaTypeLocation, error) {
var resp StoryAreaTypeLocation
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryAreaTypeVenue(data json.RawMessage) (*StoryAreaTypeVenue, error) {
var resp StoryAreaTypeVenue
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) {
var resp StoryArea
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryAreaTypeLocation(data json.RawMessage) (*InputStoryAreaTypeLocation, error) {
var resp InputStoryAreaTypeLocation
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryAreaTypeFoundVenue(data json.RawMessage) (*InputStoryAreaTypeFoundVenue, error) {
var resp InputStoryAreaTypeFoundVenue
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryAreaTypePreviousVenue(data json.RawMessage) (*InputStoryAreaTypePreviousVenue, error) {
var resp InputStoryAreaTypePreviousVenue
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) {
var resp InputStoryArea
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryAreas(data json.RawMessage) (*InputStoryAreas, error) {
var resp InputStoryAreas
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryVideo(data json.RawMessage) (*StoryVideo, error) {
var resp StoryVideo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryContentPhoto(data json.RawMessage) (*StoryContentPhoto, error) {
var resp StoryContentPhoto
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryContentVideo(data json.RawMessage) (*StoryContentVideo, error) {
var resp StoryContentVideo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryContentUnsupported(data json.RawMessage) (*StoryContentUnsupported, error) {
var resp StoryContentUnsupported
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryContentPhoto(data json.RawMessage) (*InputStoryContentPhoto, error) {
var resp InputStoryContentPhoto
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryContentVideo(data json.RawMessage) (*InputStoryContentVideo, error) {
var resp InputStoryContentVideo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryListMain(data json.RawMessage) (*StoryListMain, error) {
var resp StoryListMain
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryListArchive(data json.RawMessage) (*StoryListArchive, error) {
var resp StoryListArchive
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryInteractionInfo(data json.RawMessage) (*StoryInteractionInfo, error) {
var resp StoryInteractionInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStory(data json.RawMessage) (*Story, error) {
var resp Story
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStories(data json.RawMessage) (*Stories, error) {
var resp Stories
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryInfo(data json.RawMessage) (*StoryInfo, error) {
var resp StoryInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatActiveStories(data json.RawMessage) (*ChatActiveStories, error) {
var resp ChatActiveStories
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalBlockListMain(data json.RawMessage) (*BlockListMain, error) {
var resp BlockListMain
@ -18182,6 +18182,78 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeEmojiCategoryTypeChatPhoto:
return UnmarshalEmojiCategoryTypeChatPhoto(data)
case TypeStoryViewer:
return UnmarshalStoryViewer(data)
case TypeStoryViewers:
return UnmarshalStoryViewers(data)
case TypeStoryAreaPosition:
return UnmarshalStoryAreaPosition(data)
case TypeStoryAreaTypeLocation:
return UnmarshalStoryAreaTypeLocation(data)
case TypeStoryAreaTypeVenue:
return UnmarshalStoryAreaTypeVenue(data)
case TypeStoryArea:
return UnmarshalStoryArea(data)
case TypeInputStoryAreaTypeLocation:
return UnmarshalInputStoryAreaTypeLocation(data)
case TypeInputStoryAreaTypeFoundVenue:
return UnmarshalInputStoryAreaTypeFoundVenue(data)
case TypeInputStoryAreaTypePreviousVenue:
return UnmarshalInputStoryAreaTypePreviousVenue(data)
case TypeInputStoryArea:
return UnmarshalInputStoryArea(data)
case TypeInputStoryAreas:
return UnmarshalInputStoryAreas(data)
case TypeStoryVideo:
return UnmarshalStoryVideo(data)
case TypeStoryContentPhoto:
return UnmarshalStoryContentPhoto(data)
case TypeStoryContentVideo:
return UnmarshalStoryContentVideo(data)
case TypeStoryContentUnsupported:
return UnmarshalStoryContentUnsupported(data)
case TypeInputStoryContentPhoto:
return UnmarshalInputStoryContentPhoto(data)
case TypeInputStoryContentVideo:
return UnmarshalInputStoryContentVideo(data)
case TypeStoryListMain:
return UnmarshalStoryListMain(data)
case TypeStoryListArchive:
return UnmarshalStoryListArchive(data)
case TypeStoryInteractionInfo:
return UnmarshalStoryInteractionInfo(data)
case TypeStory:
return UnmarshalStory(data)
case TypeStories:
return UnmarshalStories(data)
case TypeStoryInfo:
return UnmarshalStoryInfo(data)
case TypeChatActiveStories:
return UnmarshalChatActiveStories(data)
case TypeCallDiscardReasonEmpty:
return UnmarshalCallDiscardReasonEmpty(data)
@ -19382,78 +19454,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageLinkInfo:
return UnmarshalMessageLinkInfo(data)
case TypeStoryViewer:
return UnmarshalStoryViewer(data)
case TypeStoryViewers:
return UnmarshalStoryViewers(data)
case TypeStoryAreaPosition:
return UnmarshalStoryAreaPosition(data)
case TypeStoryAreaTypeLocation:
return UnmarshalStoryAreaTypeLocation(data)
case TypeStoryAreaTypeVenue:
return UnmarshalStoryAreaTypeVenue(data)
case TypeStoryArea:
return UnmarshalStoryArea(data)
case TypeInputStoryAreaTypeLocation:
return UnmarshalInputStoryAreaTypeLocation(data)
case TypeInputStoryAreaTypeFoundVenue:
return UnmarshalInputStoryAreaTypeFoundVenue(data)
case TypeInputStoryAreaTypePreviousVenue:
return UnmarshalInputStoryAreaTypePreviousVenue(data)
case TypeInputStoryArea:
return UnmarshalInputStoryArea(data)
case TypeInputStoryAreas:
return UnmarshalInputStoryAreas(data)
case TypeStoryVideo:
return UnmarshalStoryVideo(data)
case TypeStoryContentPhoto:
return UnmarshalStoryContentPhoto(data)
case TypeStoryContentVideo:
return UnmarshalStoryContentVideo(data)
case TypeStoryContentUnsupported:
return UnmarshalStoryContentUnsupported(data)
case TypeInputStoryContentPhoto:
return UnmarshalInputStoryContentPhoto(data)
case TypeInputStoryContentVideo:
return UnmarshalInputStoryContentVideo(data)
case TypeStoryListMain:
return UnmarshalStoryListMain(data)
case TypeStoryListArchive:
return UnmarshalStoryListArchive(data)
case TypeStoryInteractionInfo:
return UnmarshalStoryInteractionInfo(data)
case TypeStory:
return UnmarshalStory(data)
case TypeStories:
return UnmarshalStories(data)
case TypeStoryInfo:
return UnmarshalStoryInfo(data)
case TypeChatActiveStories:
return UnmarshalChatActiveStories(data)
case TypeBlockListMain:
return UnmarshalBlockListMain(data)

View file

@ -1320,7 +1320,7 @@ notificationSettingsScopeChannelChats = NotificationSettingsScope;
//@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead
//@show_preview True, if message content must be displayed in notifications
//@use_default_mute_stories If true, mute_stories is ignored and the value for the relevant type of chat is used instead
//@mute_stories True, if story notifications are received without sound
//@mute_stories True, if story notifications are disabled for the chat
//@use_default_story_sound If true, the value for the relevant type of chat is used instead of story_sound_id
//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled
//@use_default_show_story_sender If true, show_story_sender is ignored and the value for the relevant type of chat is used instead
@ -1335,8 +1335,8 @@ chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_so
//@mute_for Time left before notifications will be unmuted, in seconds
//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled
//@show_preview True, if message content must be displayed in notifications
//@use_default_mute_stories If true, mute_stories is ignored and stories are unmuted only for the first 5 chats from topChatCategoryUsers
//@mute_stories True, if story notifications are received without sound
//@use_default_mute_stories If true, mute_stories is ignored and story notifications are received only for the first 5 chats from topChatCategoryUsers
//@mute_stories True, if story notifications are disabled for the chat
//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled
//@show_story_sender True, if the sender of stories must be displayed in notifications
//@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message
@ -3153,6 +3153,159 @@ emojiCategoryTypeEmojiStatus = EmojiCategoryType;
emojiCategoryTypeChatPhoto = EmojiCategoryType;
//@description Represents a viewer of a story
//@user_id User identifier of the viewer
//@view_date Approximate point in time (Unix timestamp) when the story was viewed
//@block_list Block list to which the user is added; may be null if none
//@chosen_reaction_type Type of the reaction that was chosen by the user; may be null if none
storyViewer user_id:int53 view_date:int32 block_list:BlockList chosen_reaction_type:ReactionType = StoryViewer;
//@description Represents a list of story viewers
//@total_count Approximate total number of story viewers found
//@viewers List of story viewers
//@next_offset The offset for the next request. If empty, there are no more results
storyViewers total_count:int32 viewers:vector<storyViewer> next_offset:string = StoryViewers;
//@description Describes position of a clickable rectangle area on a story media
//@x_percentage The abscissa of the rectangle's center, as a percentage of the media width
//@y_percentage The ordinate of the rectangle's center, as a percentage of the media height
//@width_percentage The width of the rectangle, as a percentage of the media width
//@height_percentage The ordinate of the rectangle's center, as a percentage of the media height
//@rotation_angle Clockwise rotation angle of the rectangle, in degrees; 0-360
storyAreaPosition x_percentage:double y_percentage:double width_percentage:double height_percentage:double rotation_angle:double = StoryAreaPosition;
//@class StoryAreaType @description Describes type of a clickable rectangle area on a story media
//@description An area pointing to a location @location The location
storyAreaTypeLocation location:location = StoryAreaType;
//@description An area pointing to a venue @venue Information about the venue
storyAreaTypeVenue venue:venue = StoryAreaType;
//@description Describes a clickable rectangle area on a story media @position Position of the area @type Type of the area
storyArea position:storyAreaPosition type:StoryAreaType = StoryArea;
//@class InputStoryAreaType @description Describes type of a clickable rectangle area on a story media to be added
//@description An area pointing to a location @location The location
inputStoryAreaTypeLocation location:location = InputStoryAreaType;
//@description An area pointing to a venue found by the bot getOption("venue_search_bot_username")
//@query_id Identifier of the inline query, used to found the venue
//@result_id Identifier of the inline query result
inputStoryAreaTypeFoundVenue query_id:int64 result_id:string = InputStoryAreaType;
//@description An area pointing to a venue already added to the story
//@venue_provider Provider of the venue
//@venue_id Identifier of the venue in the provider database
inputStoryAreaTypePreviousVenue venue_provider:string venue_id:string = InputStoryAreaType;
//@description Describes a clickable rectangle area on a story media to be added @position Position of the area @type Type of the area
inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryArea;
//@description Contains a list of story areas to be added @areas List of 0-10 input story areas
inputStoryAreas areas:vector<inputStoryArea> = InputStoryAreas;
//@description Describes a video file sent in a story
//@duration Duration of the video, in seconds
//@width Video width
//@height Video height
//@has_stickers True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets
//@is_animation True, if the video has no sound
//@minithumbnail Video minithumbnail; may be null
//@thumbnail Video thumbnail in JPEG or MPEG4 format; may be null
//@preload_prefix_size Size of file prefix, which is supposed to be preloaded, in bytes
//@video File containing the video
storyVideo duration:double width:int32 height:int32 has_stickers:Bool is_animation:Bool minithumbnail:minithumbnail thumbnail:thumbnail preload_prefix_size:int32 video:file = StoryVideo;
//@class StoryContent @description Contains the content of a story
//@description A photo story @photo The photo
storyContentPhoto photo:photo = StoryContent;
//@description A video story @video The video in MPEG4 format @alternative_video Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null
storyContentVideo video:storyVideo alternative_video:storyVideo = StoryContent;
//@description A story content that is not supported in the current TDLib version
storyContentUnsupported = StoryContent;
//@class InputStoryContent @description The content of a story to send
//@description A photo story
//@photo Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920
//@added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable
inputStoryContentPhoto photo:InputFile added_sticker_file_ids:vector<int32> = InputStoryContent;
//@description A video story
//@video Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second
//@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable
//@duration Precise duration of the video, in seconds; 0-60
//@is_animation True, if the video has no sound
inputStoryContentVideo video:InputFile added_sticker_file_ids:vector<int32> duration:double is_animation:Bool = InputStoryContent;
//@class StoryList @description Describes a list of stories
//@description The list of stories, shown in the main chat list and folder chat lists
storyListMain = StoryList;
//@description The list of stories, shown in the Arvhive chat list
storyListArchive = StoryList;
//@description Contains information about interactions with a story
//@view_count Number of times the story was viewed
//@reaction_count Number of reactions added to the story
//@recent_viewer_user_ids Identifiers of at most 3 recent viewers of the story
storyInteractionInfo view_count:int32 reaction_count:int32 recent_viewer_user_ids:vector<int53> = StoryInteractionInfo;
//@description Represents a story
//@id Unique story identifier among stories of the given sender
//@sender_chat_id Identifier of the chat that posted the story
//@date Point in time (Unix timestamp) when the story was published
//@is_being_sent True, if the story is being sent by the current user
//@is_being_edited True, if the story is being edited by the current user
//@is_edited True, if the story was edited
//@is_pinned True, if the story is saved in the sender's profile and will be available there after expiration
//@is_visible_only_for_self True, if the story is visible only for the current user
//@can_be_forwarded True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden
//@can_be_replied True, if the story can be replied in the chat with the story sender
//@can_get_viewers True, if users viewed the story can be received through getStoryViewers
//@has_expired_viewers True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago
//@interaction_info Information about interactions with the story; may be null if the story isn't owned or there were no interactions
//@chosen_reaction_type Type of the chosen reaction; may be null if none
//@privacy_settings Privacy rules affecting story visibility; may be approximate for non-owned stories
//@content Content of the story
//@areas Clickable areas to be shown on the story content
//@caption Caption of the story
story id:int32 sender_chat_id:int53 date:int32 is_being_sent:Bool is_being_edited:Bool is_edited:Bool is_pinned:Bool is_visible_only_for_self:Bool can_be_forwarded:Bool can_be_replied:Bool can_get_viewers:Bool has_expired_viewers:Bool interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector<storyArea> caption:formattedText = Story;
//@description Represents a list of stories @total_count Approximate total number of stories found @stories The list of stories
stories total_count:int32 stories:vector<story> = Stories;
//@description Contains basic information about a story
//@story_id Unique story identifier among stories of the given sender
//@date Point in time (Unix timestamp) when the story was published
//@is_for_close_friends True, if the story is available only to close friends
storyInfo story_id:int32 date:int32 is_for_close_friends:Bool = StoryInfo;
//@description Describes active stories posted by a chat
//@chat_id Identifier of the chat that posted the stories
//@list Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list
//@order A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order
//@max_read_story_id Identifier of the last read active story
//@stories Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers)
chatActiveStories chat_id:int53 list:StoryList order:int53 max_read_story_id:int32 stories:vector<storyInfo> = ChatActiveStories;
//@class CallDiscardReason @description Describes the reason why a call was discarded
//@description The call wasn't discarded, or the reason is unknown
@ -4961,159 +5114,6 @@ messageLink link:string is_public:Bool = MessageLink;
messageLinkInfo is_public:Bool chat_id:int53 message_thread_id:int53 message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo;
//@description Represents a viewer of a story
//@user_id User identifier of the viewer
//@view_date Approximate point in time (Unix timestamp) when the story was viewed
//@block_list Block list to which the user is added; may be null if none
//@chosen_reaction_type Type of the reaction that was chosen by the user; may be null if none
storyViewer user_id:int53 view_date:int32 block_list:BlockList chosen_reaction_type:ReactionType = StoryViewer;
//@description Represents a list of story viewers
//@total_count Approximate total number of story viewers found
//@viewers List of story viewers
//@next_offset The offset for the next request. If empty, there are no more results
storyViewers total_count:int32 viewers:vector<storyViewer> next_offset:string = StoryViewers;
//@description Describes position of a clickable rectangle area on a story media
//@x_percentage The abscissa of the rectangle's center, as a percentage of the media width
//@y_percentage The ordinate of the rectangle's center, as a percentage of the media height
//@width_percentage The width of the rectangle, as a percentage of the media width
//@height_percentage The ordinate of the rectangle's center, as a percentage of the media height
//@rotation_angle Clockwise rotation angle of the rectangle, in degrees; 0-360
storyAreaPosition x_percentage:double y_percentage:double width_percentage:double height_percentage:double rotation_angle:double = StoryAreaPosition;
//@class StoryAreaType @description Describes type of a clickable rectangle area on a story media
//@description An area pointing to a location @location The location
storyAreaTypeLocation location:location = StoryAreaType;
//@description An area pointing to a venue @venue Information about the venue
storyAreaTypeVenue venue:venue = StoryAreaType;
//@description Describes a clickable rectangle area on a story media @position Position of the area @type Type of the area
storyArea position:storyAreaPosition type:StoryAreaType = StoryArea;
//@class InputStoryAreaType @description Describes type of a clickable rectangle area on a story media to be added
//@description An area pointing to a location @location The location
inputStoryAreaTypeLocation location:location = InputStoryAreaType;
//@description An area pointing to a venue found by the bot getOption("venue_search_bot_username")
//@query_id Identifier of the inline query, used to found the venue
//@result_id Identifier of the inline query result
inputStoryAreaTypeFoundVenue query_id:int64 result_id:string = InputStoryAreaType;
//@description An area pointing to a venue already added to the story
//@venue_provider Provider of the venue
//@venue_id Identifier of the venue in the provider database
inputStoryAreaTypePreviousVenue venue_provider:string venue_id:string = InputStoryAreaType;
//@description Describes a clickable rectangle area on a story media to be added @position Position of the area @type Type of the area
inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryArea;
//@description Contains a list of story areas to be added @areas List of 0-10 input story areas
inputStoryAreas areas:vector<inputStoryArea> = InputStoryAreas;
//@description Describes a video file sent in a story
//@duration Duration of the video, in seconds
//@width Video width
//@height Video height
//@has_stickers True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets
//@is_animation True, if the video has no sound
//@minithumbnail Video minithumbnail; may be null
//@thumbnail Video thumbnail in JPEG or MPEG4 format; may be null
//@preload_prefix_size Size of file prefix, which is supposed to be preloaded, in bytes
//@video File containing the video
storyVideo duration:double width:int32 height:int32 has_stickers:Bool is_animation:Bool minithumbnail:minithumbnail thumbnail:thumbnail preload_prefix_size:int32 video:file = StoryVideo;
//@class StoryContent @description Contains the content of a story
//@description A photo story @photo The photo
storyContentPhoto photo:photo = StoryContent;
//@description A video story @video The video in MPEG4 format @alternative_video Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null
storyContentVideo video:storyVideo alternative_video:storyVideo = StoryContent;
//@description A story content that is not supported in the current TDLib version
storyContentUnsupported = StoryContent;
//@class InputStoryContent @description The content of a story to send
//@description A photo story
//@photo Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920
//@added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable
inputStoryContentPhoto photo:InputFile added_sticker_file_ids:vector<int32> = InputStoryContent;
//@description A video story
//@video Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second
//@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable
//@duration Precise duration of the video, in seconds; 0-60
//@is_animation True, if the video has no sound
inputStoryContentVideo video:InputFile added_sticker_file_ids:vector<int32> duration:double is_animation:Bool = InputStoryContent;
//@class StoryList @description Describes a list of stories
//@description The list of stories, shown in the main chat list and folder chat lists
storyListMain = StoryList;
//@description The list of stories, shown in the Arvhive chat list
storyListArchive = StoryList;
//@description Contains information about interactions with a story
//@view_count Number of times the story was viewed
//@reaction_count Number of reactions added to the story
//@recent_viewer_user_ids Identifiers of at most 3 recent viewers of the story
storyInteractionInfo view_count:int32 reaction_count:int32 recent_viewer_user_ids:vector<int53> = StoryInteractionInfo;
//@description Represents a story
//@id Unique story identifier among stories of the given sender
//@sender_chat_id Identifier of the chat that posted the story
//@date Point in time (Unix timestamp) when the story was published
//@is_being_sent True, if the story is being sent by the current user
//@is_being_edited True, if the story is being edited by the current user
//@is_edited True, if the story was edited
//@is_pinned True, if the story is saved in the sender's profile and will be available there after expiration
//@is_visible_only_for_self True, if the story is visible only for the current user
//@can_be_forwarded True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden
//@can_be_replied True, if the story can be replied in the chat with the story sender
//@can_get_viewers True, if users viewed the story can be received through getStoryViewers
//@has_expired_viewers True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago
//@interaction_info Information about interactions with the story; may be null if the story isn't owned or there were no interactions
//@chosen_reaction_type Type of the chosen reaction; may be null if none
//@privacy_settings Privacy rules affecting story visibility; may be approximate for non-owned stories
//@content Content of the story
//@areas Clickable areas to be shown on the story content
//@caption Caption of the story
story id:int32 sender_chat_id:int53 date:int32 is_being_sent:Bool is_being_edited:Bool is_edited:Bool is_pinned:Bool is_visible_only_for_self:Bool can_be_forwarded:Bool can_be_replied:Bool can_get_viewers:Bool has_expired_viewers:Bool interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector<storyArea> caption:formattedText = Story;
//@description Represents a list of stories @total_count Approximate total number of stories found @stories The list of stories
stories total_count:int32 stories:vector<story> = Stories;
//@description Contains basic information about a story
//@story_id Unique story identifier among stories of the given sender
//@date Point in time (Unix timestamp) when the story was published
//@is_for_close_friends True, if the story is available only to close friends
storyInfo story_id:int32 date:int32 is_for_close_friends:Bool = StoryInfo;
//@description Describes active stories posted by a chat
//@chat_id Identifier of the chat that posted the stories
//@list Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list
//@order A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order
//@max_read_story_id Identifier of the last read active story
//@stories Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers)
chatActiveStories chat_id:int53 list:StoryList order:int53 max_read_story_id:int32 stories:vector<storyInfo> = ChatActiveStories;
//@class BlockList @description Describes a type of a block list
//@description The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions
@ -6377,7 +6377,7 @@ searchChatsOnServer query:string limit:int32 = Chats;
//@location Current user location
searchChatsNearby location:location = ChatsNearby;
//@description Returns a list of frequently used chats. Supported only if the chat info database is enabled @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30
//@description Returns a list of frequently used chats @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30
getTopChats category:TopChatCategory limit:int32 = Chats;
//@description Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled @category Category of frequently used chats @chat_id Chat identifier
@ -6667,6 +6667,9 @@ forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message
//@message_ids Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order
resendMessages chat_id:int53 message_ids:vector<int53> = Messages;
//@description Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats @chat_id Chat identifier
sendChatScreenshotTakenNotification chat_id:int53 = Ok;
//@description Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message
//@chat_id Target chat
//@sender_id Identifier of the sender of the message