Skip to content
This repository has been archived by the owner on Jul 3, 2021. It is now read-only.

[actions] moderateBanUser

Thedark1337 edited this page Aug 31, 2016 · 10 revisions

moderateBanUser(userID[, reason[, duration[, callback]]])

Bans an user from the room. The bot needs to have bouncer permission or higher.


Parameters

userID number

The user's ID.

reason int (optional)

Reason for ban.

  • 1: Spamming or trolling (default)
  • 2: Verbal abuse or offensive language
  • 3: Playing offensive videos/songs
  • 4: Repeatedly playing inappropriate genre(s)
  • 5: Negative attitude
duration string (optional)

Duration of ban.

  • h or PlugAPI.BAN.HOUR: Hour
  • d or PlugAPI.BAN.DAY : Day
  • f or PlugAPI.BAN.PERMA : Forever (default)
callback function (optional)

Callback function to be called with data from server.


Returns

true if request queued; otherwise false


Example

// Require PlugAPI
var PlugAPI = require('plugapi');
// Ban user forever for spamming or trolling
bot.moderateBanUser('xxxxxxxxxxxxxxxxxxxxxxxx');
// Ban user for a day for negative attitude
bot.moderateBanUser('xxxxxxxxxxxxxxxxxxxxxxxx', 4, PlugAPI.BAN.DAY);
Clone this wiki locally