From a3dd0f1345fae3d7828ed0c82d6a7c4b610d0983 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 6 Nov 2016 00:46:32 +0100 Subject: Add support for using avatars from discord,slack and gitter in slack --- vendor/github.com/42wim/go-gitter/gitter.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'vendor') diff --git a/vendor/github.com/42wim/go-gitter/gitter.go b/vendor/github.com/42wim/go-gitter/gitter.go index af082881..2f9e9a51 100644 --- a/vendor/github.com/42wim/go-gitter/gitter.go +++ b/vendor/github.com/42wim/go-gitter/gitter.go @@ -125,6 +125,24 @@ func (gitter *Gitter) GetRooms() ([]Room, error) { return rooms, nil } +// GetUsersInRoom returns the users in the room with the passed id +func (gitter *Gitter) GetUsersInRoom(roomID string) ([]User, error) { + + var users []User + response, err := gitter.get(gitter.config.apiBaseURL + "rooms/" + roomID + "/users") + if err != nil { + gitter.log(err) + return nil, err + } + + err = json.Unmarshal(response, &users) + if err != nil { + gitter.log(err) + return nil, err + } + return users, nil +} + // GetRoom returns a room with the passed id func (gitter *Gitter) GetRoom(roomID string) (*Room, error) { -- cgit v1.2.3