Rocket.Chat.Go.SDK icon indicating copy to clipboard operation
Rocket.Chat.Go.SDK copied to clipboard

Add methods to expand coverage of `channels` endpoints

Open evanofslack opened this issue 2 years ago • 5 comments

This PR adds methods and tests to cover the following endpoints:

  • [x] channels.create
  • [x] channels.invite
  • [x] channels.join
  • [x] channels.members
  • [x] users.info

The method for users.info was required to retrieve user IDs for testing of channels.invite.

Additionally, this PR moves groups methods out of the channels file and into a new file.

evanofslack avatar Jul 09 '22 04:07 evanofslack

@evanofslack just curious to know is there any specific reason to return slice of User addresses in GetChannelMembers function ?

srrathi avatar Aug 10 '22 19:08 srrathi

@evanofslack just curious to know is there any specific reason to return slice of User addresses in GetChannelMembers function ?

@srrathi The function's intent is to return a slice of models.User, not user addresses.

func (c *Client) GetChannelMembers(channel *models.Channel) ([]*models.User, error) 

evanofslack avatar Aug 18 '22 22:08 evanofslack

@evanofslack just curious to know is there any specific reason to return slice of User addresses in GetChannelMembers function ?

@srrathi The function's intent is to return a slice of models.User, not user addresses.

func (c *Client) GetChannelMembers(channel *models.Channel) ([]*models.User, error) 

I'm sorry by addresses I mean Pointer. It is returning a slice of models.User pointer. Is there any specific reason for it.

srrathi avatar Aug 19 '22 08:08 srrathi

@srrathi Only reasoning is that other methods tend to accept pointers and it is easy to dereference if necessary.

evanofslack avatar Aug 29 '22 21:08 evanofslack

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: evanofslack
:x: evan slack


evan slack seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jan 20 '23 13:01 CLAassistant