Skip to content

Commit

Permalink
Merge branch 'dev-v2.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
SevereCloud committed Oct 26, 2020
2 parents 09b08ed + 706dfe6 commit 4bc7c59
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 17 deletions.
3 changes: 3 additions & 0 deletions api/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 15 additions & 2 deletions api/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,21 +515,34 @@ 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"`
ConversationMessageID int `json:"conversation_message_id"`
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.
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ package vksdk

// Module constants.
const (
Version = "2.5.0"
Version = "2.6.0"
API = "5.124"
)
1 change: 1 addition & 0 deletions object/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
31 changes: 17 additions & 14 deletions object/podcasts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions object/wall.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ const (
AttachmentTypeEvent = "event"
AttachmentTypeWall = "wall"
AttachmentTypeStory = "story"
AttachmentTypePodcast = "podcast"
)

// WallWallpostAttachment struct.
Expand All @@ -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.
Expand Down

0 comments on commit 4bc7c59

Please sign in to comment.