Changing Channel Members

Last Edit: Feb 02 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']);
                    
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.demote_moderators(["tommaso"]);
                    

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

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

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

hannel.AddModerators("thierry", "josh")
channel.DemoteModerators("tommaso")
                    

// 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
                    
These operations can only be performed server-side and up to 100 moderators can be added or removed at once.