Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- registerPlugin({
- name: 'Mineplex Moderation',
- version: '1.0',
- description: 'This is for moderating the Mineplex Teamspeak',
- author: 'Block2Block',
- vars: {
- blacklisted: {
- title: 'Comma-separated list of blacklisted words',
- type: 'string'
- },
- whitelisted: {
- title: 'Comma-separated list of whitelisted websites',
- type: 'string'
- }
- }
- }, function(sinusbot, config, info) {
- var blacklist = config.blacklisted.split(',').map(function(e) { return e.trim() });
- var whitelist = config.whitelisted.split(',').map(function(e) { return e.trim() });
- var inappropriateName = 0;
- var inappropriateChannelName = 0;
- var warnInappropriateName = 0;
- var warnInappropriateChannelName = 0;
- var kickVulgarity = 0;
- var name;
- var clientId;
- var channelId;
- function checkName(clientId,name){
- for (i in blacklist){
- if (name.toLowerCase().indexOf(blacklist[i]) >= 0){
- banByClientId(clientId, 43200, "Inappropriate Nickname [Bot Moderation] [Warned]")
- sinusbot.log("[Mineplex Moderation] " + name + " has been banned for an inappropriate nickname.");
- inappropriateName++;
- return;
- } else{
- return;
- }
- }
- };
- function checkChannelName(channelId,name){
- for (i in blacklist){
- if (name.toLowerCase().indexOf(blacklist[i]) >= 0) {
- for (var i=0;i<=channelId.clients.length;i++){
- privateChat(channelId.clients[i], "The channel you were in was deleted because it has an inappropriate name.");
- kickChannel(channelId.clients[i], "Inappropriate Channel Name [Bot Moderation]");
- }
- sinusbot.log("[MP Bot Moderation] Channel " + name + " has been deleted as it's name is inappropriate.")
- inappropriateChannelName++;
- channelDelete(channelId);
- return;
- } else {
- return;
- }
- }
- }
- //Inappropriate Nicknames
- sinusbot.on('nick', function(ev){
- for (i in blacklist){
- if (ev.client.nick.toLowerCase().indexOf(blacklist[i]) >= 0){
- poke(ev.clientId, "[b]WARNING:[/b] Please change your nickname to something appropriate or you will be banned!");
- sinusbot.log("[Mineplex Moderation] " + name + " has been warned for an inappropriate nickname.");
- warnInappropriateName++;
- setTimeout(function() { checkName(ev.clientId, ev.client.nick.toLowerCase());}, 60000);
- break;
- } else {
- return;
- }
- }
- });
- sinusbot.on('clientMove', function(ev){
- for (i in blacklist){
- if (ev.client.nick.toLowerCase().indexOf(blacklist[i]) >= 0){
- poke(ev.clientId, "[b]WARNING:[/b] Please change your nickname to something appropriate or you will be banned!");
- sinusbot.log("[Mineplex Moderation] " + name + " has been warned for an inappropriate nickname.");
- warnInappropriateName++;
- setTimeout(function() { checkName(ev.clientId, ev.client.nick.toLowerCase());}, 60000);
- break;
- } else {
- return;
- }
- }
- });
- //Inappropriate Channel Names
- sinusbot.on('channelCreate', function(ev){
- for (i in blacklist) {
- if (ev.name.toLowerCase().indexOf(blacklist[i]) >= 0){
- poke(ev.clientId, "[b]WARNING:[/b]Please change your channel name to something appropriate or the channel will be deleted!");
- log("[Mineplex Moderation] People in the channel " + ev.channel.name + " have been warned for an inappropriate nickname.");
- warnInappropriateChannelName++;
- setTimeout(function() { checkChannelName(ev.channel, ev.channel.name.toLowerCase());}, 60000);
- break;
- }
- }
- });
- sinusbot.on('channelUpdate', function(ev){
- for (i in blacklist) {
- if (ev.name.toLowerCase().indexOf(blacklist[i]) >= 0){
- for (var i=0;i<=ev.channel.clients.length;i++) {
- poke(ev.channel.clients[i], "[b]WARNING:[/b]Please change your channel name to something appropriate or the channel will be deleted!");
- }
- log("[Mineplex Moderation] People in the channel " + ev.channel.name + " have been warned for an inappropriate channel name.");
- warnInappropriateChannelName++;
- setTimeout(function() { checkChannelName(ev.channel, ev.channel.name.toLowerCase()); }, 60000);
- break;
- }
- }
- });
- //Chat Moderation
- sinusbot.on('channelChat', function(ev){
- });
- sinusbot.on('chat', function(ev){
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment