Moderation Tools

Last Edit: Mar 03 2020

Flag

Any user is allowed to flag a message or a user.


const flag = await client.flagMessage(messageResponse.message.id);
                    

$flag = $client->flagMessage('message-id', ['user_id' => 'user-id']);
                    

await client.flagMessage("messageID");
                    

Mute

Any user is allowed to mute another user. Mutes are stored at user level and returned with the rest of the user information when setUser is called.


// client-side mute
const mute = await client.muteUser('eviluser');

// server-side mute requires the id of the user creating the mute as well
const mute = await client.muteUser('eviluser', 'user_id');
                    

// server-side mute requires the id of the user creating the mute as well
$mute = $client->muteUser('evil-user', 'user-id');
                    

await client.muteUser("eviluser");

await client.unmuteUser("eviluser");
                    

After muting a user; messages will still be delivered via web-socket. Implementing business logic such as hiding messages from muted users or display them differently is left to the developer to implement.

Messages from muted users are not delivered via push (APN/Firebase)

Ban

Users can be banned from an app entirely or from a channel. When a user is banned, it will be not allowed to post messages until the ban is removed or expired. In most cases only admins or moderators are allowed to ban other users from a channel.

Name Type Description Default Optional
timeout number The timeout in minutes until the ban is automatically expired. no limit
reason string The reason that the ban was created.
Banning a user from all channels can only be done using server-side auth.

// ban a user for 60 minutes from all channel
let data = await client.banUser('eviluser', {
    timeout: 60,
    reason: 'Banned for one hour',
});

// ban a user from the livestream:fortnite channel
data = await channel.banUser('eviluser', {
    reason: 'Profanity is not allowed here',
});

// remove ban from channel
data = await channel.unbanUser('eviluser');

// remove global ban
data = await authClient.unbanUser('eviluser');
                    

# ban a user for 60 minutes from all channel
client.ban_user("eviluser", timeout=60, reason="Banned for one hour")

# ban a user from the livestream:fortnite channel
channel.ban_user("eviluser", reason="Profanity is not allowed here")

# remove ban from channel
channel.unban_user("eviluser")

# remove global ban
client.unban_user("eviluser")
                    

client.banUser(userId, channel, reason, timeout, new CompletableCallback() {
    @Override
    public void onSuccess(CompletableResponse response) {
        
    }

    @Override
    public void onError(String errMsg, int errCode) {

    }
});
                    

channel.ban(user: user, timeoutInMinutes: timeout, reason: reason)
    .subscribe()
    .disposed(by: disposeBag)
                    

client.banUser(userId, channel, reason, timeout, object : CompletableCallback {
    override fun onSuccess(response: CompletableResponse) {

    }

    override fun onError(errMsg: String, errCode: Int) {

    }
})
                    

// ban a user for 60 minutes from all channel
$ban = $client->banUser('evil-user', [
    'timeout' => 60,
    'reason' => 'Banned for one hour',
    'user_id' => 'user-id'
]);


// ban a user from the livestream:fortnite channel
$ban = $channel->banUser('evil-user', [
    'reason' => 'Banned for one hour',
    'user_id' => 'user-id'
]);

// remove ban from channel
$unban = $channel->unbanUser('evil-user');

// remove global ban
$unban = $client->unbanUser('evil-user');
                    

Automod

For livestream and gaming channel types Automod is enabled by default. There are three options for moderation:

  • disabled
  • simple (blocks messages that contain a list of profane words)
  • ai (uses an AI-based classification system to detect various types of bad content)

You can configure the thresholds for the AI-based system by specifying a value between 0 and 1 for the following types of bad content. As an example, if you set the value for Spam to 0.7 it will block any message that seems very likely to be spam. On the other hand, if you set a value of 0.3 it will be very sensitive and block anything that remotely looks like spam.

  • Spam: Unsolicited messages – typically used as clickbait for financial gain from bot messages.
  • Toxic: Not a constructive comment, or in general not nice. E.g. "This is dumb" would be classified highly as toxic and only slightly obscene.
  • SevereToxic: Worst of the worst. Typically insulting, obscene, and/or degrading. E.g. "What a mother******* piece of crap those ****heads are for blocking us!".
  • Obscene: Generally reserved for inappropriate words. Typically offensive to accepted standards of morality.
  • Threat: A direct threat to another user. E.g. "I will spit on you" would classified highly as toxic and a threat but only slightly obscene.
  • Insult: Insulting another user. E.g. "You are dumb" would be classified as toxic and insulting, yet only moderately obscene.
  • IdentityHate: Degradation of a protected class.
AI-based moderation is a premium feature. Please contact sales to discuss your options.