diff options
author | Wim <wim@42.be> | 2016-11-06 00:46:32 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2016-11-06 00:46:32 +0100 |
commit | a3dd0f1345fae3d7828ed0c82d6a7c4b610d0983 (patch) | |
tree | 7db0a8d15e4390b9c2bb0581cad8d2e551a29b23 /vendor/github.com/42wim/go-gitter/gitter.go | |
parent | 37873acfcd328e7c9eaf2e69148de05b8d00a428 (diff) | |
download | matterbridge-msglm-a3dd0f1345fae3d7828ed0c82d6a7c4b610d0983.tar.gz matterbridge-msglm-a3dd0f1345fae3d7828ed0c82d6a7c4b610d0983.tar.bz2 matterbridge-msglm-a3dd0f1345fae3d7828ed0c82d6a7c4b610d0983.zip |
Add support for using avatars from discord,slack and gitter in slack
Diffstat (limited to 'vendor/github.com/42wim/go-gitter/gitter.go')
-rw-r--r-- | vendor/github.com/42wim/go-gitter/gitter.go | 18 |
1 files changed, 18 insertions, 0 deletions
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) { |