From c4c950207210734e54f1289406f2fe79ea72257d Mon Sep 17 00:00:00 2001 From: Floretta Date: Mon, 2 Jan 2017 22:49:03 +0100 Subject: [PATCH] added Around parameter to ChannelMessages --- restapi.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/restapi.go b/restapi.go index ea0650d..294c979 100644 --- a/restapi.go +++ b/restapi.go @@ -1210,7 +1210,7 @@ func (s *Session) ChannelTyping(channelID string) (err error) { // limit : The number messages that can be returned. (max 100) // beforeID : If provided all messages returned will be before given ID. // afterID : If provided all messages returned will be after given ID. -func (s *Session) ChannelMessages(channelID string, limit int, beforeID, afterID string) (st []*Message, err error) { +func (s *Session) ChannelMessages(channelID string, limit int, beforeID, afterID, aroundID string) (st []*Message, err error) { uri := EndpointChannelMessages(channelID) @@ -1224,6 +1224,9 @@ func (s *Session) ChannelMessages(channelID string, limit int, beforeID, afterID if beforeID != "" { v.Set("before", beforeID) } + if aroundID != "" { + v.Set("around", aroundID) + } if len(v) > 0 { uri = fmt.Sprintf("%s?%s", uri, v.Encode()) }