From 908ed5555f8a3d37cd057035b2792d66c8b7838a Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Sat, 13 Oct 2018 12:35:57 +0200 Subject: [APIv4] add getChannelMembersTimezone (#9286) * add getChannelMembersTimezone * update per feedback review * add delimeter to error --- model/client4.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'model/client4.go') diff --git a/model/client4.go b/model/client4.go index 903687ece..6a613b6b3 100644 --- a/model/client4.go +++ b/model/client4.go @@ -1746,6 +1746,17 @@ func (c *Client4) GetChannelStats(channelId string, etag string) (*ChannelStats, } } +// GetChannelMembersTimezones gets a list of timezones for a channel. +func (c *Client4) GetChannelMembersTimezones(channelId string) ([]string, *Response) { + r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/timezones", "") + if err != nil { + return nil, BuildErrorResponse(r, err) + } + + defer closeBody(r) + return ArrayFromJson(r.Body), BuildResponse(r) +} + // GetPinnedPosts gets a list of pinned posts. func (c *Client4) GetPinnedPosts(channelId string, etag string) (*PostList, *Response) { if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/pinned", etag); err != nil { -- cgit v1.2.3-1-g7c22