diff --git a/api/errors.go b/api/errors.go index 044b3556..b41ff59e 100644 --- a/api/errors.go +++ b/api/errors.go @@ -290,6 +290,9 @@ const ( // Donut is disabled. ErrDonutDisabled ErrorType = 225 + // Reaction can not be applied to the object. + ErrReactionCantApplied ErrorType = 232 + // Access to poll denied. ErrPollsAccess ErrorType = 250 diff --git a/api/messages.go b/api/messages.go index 6cdba86c..b8399a35 100644 --- a/api/messages.go +++ b/api/messages.go @@ -515,6 +515,8 @@ func (vk *VK) MessagesSend(params Params) (response int, err error) { } // MessagesSendUserIDsResponse struct. +// +// TODO: v3 rename MessagesSendPeerIDsResponse - user_ids outdated. type MessagesSendUserIDsResponse []struct { PeerID int `json:"peer_id"` MessageID int `json:"message_id"` @@ -522,14 +524,25 @@ type MessagesSendUserIDsResponse []struct { Error Error `json:"error"` } +// MessagesSendPeerIDs sends a message. +// +// need peer_ids; +// +// https://vk.com/dev/messages.send +func (vk *VK) MessagesSendPeerIDs(params Params) (response MessagesSendUserIDsResponse, err error) { + err = vk.RequestUnmarshal("messages.send", &response, params) + return +} + // MessagesSendUserIDs sends a message. // // need user_ids or peer_ids; // // https://vk.com/dev/messages.send +// +// Deprecated: user_ids outdated, use MessagesSendPeerIDs. func (vk *VK) MessagesSendUserIDs(params Params) (response MessagesSendUserIDsResponse, err error) { - err = vk.RequestUnmarshal("messages.send", &response, params) - return + return vk.MessagesSendPeerIDs(params) } // MessagesSendMessageEventAnswer method. diff --git a/doc.go b/doc.go index fc7d9408..a6e446fa 100644 --- a/doc.go +++ b/doc.go @@ -7,6 +7,6 @@ package vksdk // Module constants. const ( - Version = "2.5.0" + Version = "2.6.0" API = "5.124" ) diff --git a/object/messages.go b/object/messages.go index 59dec72f..f36b2505 100644 --- a/object/messages.go +++ b/object/messages.go @@ -675,6 +675,7 @@ type MessagesMessageAttachment struct { Poll PollsPoll `json:"poll"` Call MessageCall `json:"call"` Story StoriesStory `json:"story"` + Podcast PodcastsEpisode `json:"podcast"` } // MessageCall struct. diff --git a/object/podcasts.go b/object/podcasts.go index 782b91c7..a332da43 100644 --- a/object/podcasts.go +++ b/object/podcasts.go @@ -14,20 +14,23 @@ type PodcastsCategory struct { // PodcastsEpisode struct. type PodcastsEpisode struct { - ID int `json:"id"` - OwnerID int `json:"owner_id"` - Artist string `json:"artist"` - Title string `json:"title"` - Duration int `json:"duration"` - Date int `json:"date"` - URL string `json:"url"` - LyricsID int `json:"lyrics_id"` - NoSearch int `json:"no_search"` - TrackCode string `json:"track_code"` - IsHq BaseBoolInt `json:"is_hq"` - IsFocusTrack BaseBoolInt `json:"is_focus_track"` - IsExplicit BaseBoolInt `json:"is_explicit"` - PodcastInfo PodcastsPodcastInfo `json:"podcast_info"` + ID int `json:"id"` + OwnerID int `json:"owner_id"` + Artist string `json:"artist"` + Title string `json:"title"` + Duration int `json:"duration"` + Date int `json:"date"` + URL string `json:"url"` + LyricsID int `json:"lyrics_id"` + NoSearch int `json:"no_search"` + TrackCode string `json:"track_code"` + IsHq BaseBoolInt `json:"is_hq"` + IsFocusTrack BaseBoolInt `json:"is_focus_track"` + IsExplicit BaseBoolInt `json:"is_explicit"` + ShortVideosAllowed BaseBoolInt `json:"short_videos_allowed"` + StoriesAllowed BaseBoolInt `json:"stories_allowed"` + StoriesCoverAllowed BaseBoolInt `json:"stories_cover_allowed"` + PodcastInfo PodcastsPodcastInfo `json:"podcast_info"` } // PodcastsPodcastInfo struct. diff --git a/object/wall.go b/object/wall.go index f34e6635..6a51d0f5 100644 --- a/object/wall.go +++ b/object/wall.go @@ -178,6 +178,7 @@ const ( AttachmentTypeEvent = "event" AttachmentTypeWall = "wall" AttachmentTypeStory = "story" + AttachmentTypePodcast = "podcast" ) // WallWallpostAttachment struct. @@ -200,6 +201,7 @@ type WallWallpostAttachment struct { PostedPhoto WallPostedPhoto `json:"posted_photo"` Type string `json:"type"` Video VideoVideo `json:"video"` + Podcast PodcastsEpisode `json:"podcast"` } // WallWallpostToID struct.