RocketChat / Rocket.Chat.Go.SDK

Go SDK for REST API and Realtime api
MIT License
60 stars 58 forks source link

Adding function to get group and channel members #73

Open srrathi opened 1 year ago

srrathi commented 1 year ago

Problem Function to get group members already exist in https://github.com/RocketChat/Rocket.Chat.Go.SDK/blob/master/rest/group.go#L45 but the problem with this is it's only for fetching group members. We cannot get channel members through as it have different rest endpoint.

Solution I'm thinking of to make this function a more generalised function to fetch both group and channel members and we can differentiate between them through type of the room and according to the type it will fetch members from the respected endpoint and just return the members.

Discuss @geekgonecrazy Should I make it a common function as I said to get both group and channel members or made separate functions for both group and channel in their respective file and call them individually while using according to the type of room ?

geekgonecrazy commented 1 year ago

I think current design separates between the two, I think the api endpoints is separate as well. Might should follow so those looking at docs for api methods can translate easily