Groups are RocketChat's private rooms.
N.B. groups.list, contrary to the other lists can only be used for listing
require 'rocketchat'
rocket_server = RocketChat::Server.new('http://your.server.address/')
session = rocket_server.login('username', 'password')
groups = session.groups.list(offset: 40)require 'rocketchat'
rocket_server = RocketChat::Server.new('http://your.server.address/')
session = rocket_server.login('username', 'password')
success = session.groups.add_all(room_id: 'ByehQjC44FwMeiLbX')Optional parameter for add_all is active_users_only (default false)
N.B. the addAll API endpoint requires the calling user to have the admin role
require 'rocketchat'
rocket_server = RocketChat::Server.new('http://your.server.address/')
session = rocket_server.login('username', 'password')
success = session.groups.add_owner(name: 'some_groupname', username: 'some_username')Either room_id (RocketChat's ID) or name can be used. The same applies to user_id and username.
To remove an owner from a group, the same options as an add_owner request can be used.
To add a moderator to a group, the same options as an add_owner request can be used.
To remove a moderator from a group, the same options as an add_owner request can be used.