Changing Channel Members

Last Edit: Mar 03 2020

Adding & Removing Channel Members

Using the addMembers() method adds the given users as members, while removeMembers() removes them.

await channel.addMembers(['thierry', 'josh']);
await channel.removeMembers(['tommaso']);

await channel.addMembers(["thierry", "josh"]);
await channel.removeMembers(["tommaso"]);

$channel->addMembers(['thierry', 'jenny']);
$channel->removeMembers(['thierry', 'jenny']);

channelController.addMembers("thierry", "josh").enqueue { 
    val channel =
channelController.removeMembers("thierry", "josh").enqueue {
    val channel =
Note: You can only add/remove up to 100 members at once.

Adding & Removing Moderators to a Channel

Using the addModerators() method adds the given users as moderators (or updates their role to moderator if already members), while demoteModerators() removes the moderator status.

await channel.addModerators(['thierry', 'josh']);
await channel.demoteModerators(['tommaso']);

channel.add_moderators(["thierry", "josh"]);

channel.add_moderators(["thierry", "josh"]);

$channel->addModerators(['thierry', 'jenny']);
$channel->demoteModerators(['thierry', 'jenny']);

// at the moment we don't have a Java client for server side usage

// at the moment we don't have a Swift client for server side usage

await channel.AddModerators(new string[] { "thierry", "josh" });
await channel.DemoteModerators(new string[] { "tommaso" });

// Adding and Removing Moderators is only allowed server-side

newModerators := []string{"bob", "sue"}
err = channel.AddModerators("thierry", "josh")
err = channel.AddModerators(newModerators...)
err = channel.DemoteModerators(newModerators...)
These operations can only be performed server-side and up to 100 moderators can be added or removed at once.