registerPlugin({
name: 'No Other Bot!',
version: '1.0',
description: 'This script will kick other people when join the channel',
author: 'UnwishingMoon <[email protected]>',
vars: {
clientUids: {
title: 'Comma-separated list of client-ids that the bot should kick',
type: 'string'
},
channel: {
title: 'Id of the channel',
type: 'channel'
}
}
}, function(sinusbot, config, info) {
log('Loading...');
var author = info.author.split(',');
if(author.length == 1){
author = author[0];
author = author.replace(/<.*>/gi, '').trim();
} else {
author = author.map(function(e){
return e.replace(/<.*>/gi, '').trim();
});
author = author.join(' & ');
}
log(info.name + ' v' + info.version + ' by ' + author + ' for SinusBot v0.9.9-50e8ba1 (and above)');
if (!config.clientUids) {
log('Invalid clientUids');
return;
}
var channelid = parseInt(config.channel, 10);
var uids = config.clientUids.split(',');
sinusbot.on('clientMove', function(ev) {
if (ev.newChannel == channelid) {
var i = uids.length;
while(i--) {
if (uids[i] == ev.clientUid) {
move(ev.clientId, ev.oldChannel);
chatPrivate(ev.clientId, 'Bot vietati in questo Canale!');
//kickChannel(ev.clientId, 'Bot vietati in questo Canale!'); (instead of the two lines above if you just want to kick the client from the channel)
return;
}
}
}
});
log('Loaded');
});