/ SDKs / Unity
SDKs
Chat SDKs Unity v4
Chat SDKs Unity
Chat SDKs
Unity
Version 4

Register and remove operators

Copy link

Operators are users who can delete any messages and view all messages in an open or group channel without any filtering or throttling. Operators can moderate channels by muting or banning users as well as freezing channels.

You can register users as an operator by providing their user IDs as shown below.

channel.AddOperators(new List<string> { USER_ID_1, USER_ID_2 }, inError =>
{
    if (inError != null)
        return; //Handle error.

    // The users are successfully registered as operators of the channel.
});

If you want to remove the users from being operators but allow them to stay in the channel, use the following code.

channel.RemoveOperators(new List<string> { USER_ID_1, USER_ID_2 }, inError =>
{
    if (inError != null)
        return; //Handle error.

    // The specified operators are removed.
    // You can notify the users of the role change through a prompt.
});

You can also remove all operators in a channel at once by using the following code.

channel.RemoveAllOperators(inError =>
{
    if (inError != null)
        return; //Handle error.

    // All operators are removed.
    // You can notify the users of the role change through a prompt.
});