abrom / rocketchat-ruby

Ruby wrapper for RocketChat v1 REST API
MIT License
33 stars 24 forks source link

Add channels members API #33

Closed alinavancea closed 3 years ago

alinavancea commented 3 years ago

Hello!

Thank you for building this ruby wrapper for RocketChat πŸ™‡β€β™€οΈ I've being using it successfully for a personal project.

I'd like to add the following method to the channels API.

I would need some help to add my contribution to this project if possible. I need a bit of guidance, on how I could do this.

I have cloned the gem and have the changes on a branch together with tests. I'm not able to push and create a new branch, I don't have the rights.

Could you please help me and guide me what is the process so I could contribute?

Thank you! πŸ™

Above I added a summary of the changes I'd like to add.

Summary

Add API to receive the members of a given channel

API docs

Proposal

      def members(room_id: nil, name: nil, offset: nil, count: nil,  sort: nil, fields: nil, query: {})
        response = session.request_json(
          "/api/v1/channels.members",
          body: build_list_body(offset, count, sort, fields, query).merge(room_params(room_id, name))
        )

        response['members'].map { |hash| RocketChat::User.new hash } if response['success']
      end
abrom commented 3 years ago

hi @alinavancea

Any contributions are welcome. First step will be to fork the repo (rather than simply cloning it). Make the changes in your fork, push them back to Github, then create a pull request from that.

Your proposal sounds fine and it looks like you're on the right track.

alinavancea commented 3 years ago

@abrom Thank you for your quick reply and for the guidance πŸ™‡β€β™€οΈ

I have forked the repo and open a pull request