4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 08:39:24 +00:00

Add support for using avatars from discord,slack and gitter in slack

This commit is contained in:
Wim
2016-11-06 00:46:32 +01:00
parent 37873acfcd
commit a3dd0f1345
5 changed files with 54 additions and 3 deletions

View File

@ -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) {