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

Ban and unban a user

Copy link

Operators of an open or group channel can remove any users that behave inappropriately in the channel using the ban feature. A banned user is immediately kicked out of the channel, but allowed to participate in the channel again after the time specified in the seconds property has passed. Operators can ban and unban users using the following code.

channel.BanUser(inUserId: "USER_ID", inSeconds: 1000, inDescription: "description", inError =>
{
    if (inError != null)
    {
        return; // Handle error.
    }
});

channel.UnbanUser(inUserId: "USER_ID", inError =>
{
    if (inError != null)
    {
        return; // Handle error.
    }
});