Merge pull request #306 from Moonlington/develop
BREAKING add Around parameter to ChannelMessages, fixes #293
This commit is contained in:
commit
53842f8dfc
1 changed files with 5 additions and 1 deletions
|
@ -1210,7 +1210,8 @@ func (s *Session) ChannelTyping(channelID string) (err error) {
|
||||||
// limit : The number messages that can be returned. (max 100)
|
// limit : The number messages that can be returned. (max 100)
|
||||||
// beforeID : If provided all messages returned will be before given ID.
|
// beforeID : If provided all messages returned will be before given ID.
|
||||||
// afterID : If provided all messages returned will be after 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) {
|
// aroundID : If provided all messages returned will be around given ID.
|
||||||
|
func (s *Session) ChannelMessages(channelID string, limit int, beforeID, afterID, aroundID string) (st []*Message, err error) {
|
||||||
|
|
||||||
uri := EndpointChannelMessages(channelID)
|
uri := EndpointChannelMessages(channelID)
|
||||||
|
|
||||||
|
@ -1224,6 +1225,9 @@ func (s *Session) ChannelMessages(channelID string, limit int, beforeID, afterID
|
||||||
if beforeID != "" {
|
if beforeID != "" {
|
||||||
v.Set("before", beforeID)
|
v.Set("before", beforeID)
|
||||||
}
|
}
|
||||||
|
if aroundID != "" {
|
||||||
|
v.Set("around", aroundID)
|
||||||
|
}
|
||||||
if len(v) > 0 {
|
if len(v) > 0 {
|
||||||
uri = fmt.Sprintf("%s?%s", uri, v.Encode())
|
uri = fmt.Sprintf("%s?%s", uri, v.Encode())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue