Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- registerPlugin({
- name: 'Welcome and Move',
- vars: [
- {
- name: 'group',
- title: 'Gruppe',
- type: 'string'
- },
- {
- name: 'channel',
- title: 'Channel',
- type: 'channel'
- },
- {
- name: 'text',
- title: 'Text',
- type: 'multiline'
- },
- {
- name: 'modgroups',
- title: 'Moderatoren-Gruppen',
- type: 'strings'
- },
- {
- name: 'modnotification',
- title: 'Moderatoren-Benachrichtigung',
- type: 'string'
- }
- ]
- }, function(sinusbot, config) {
- config.group = config.group || '';
- config.channel = config.channel || '';
- config.text = config.text || '';
- sinusbot.on('clientMove', function(e) {
- if (e.oldChannel == 0) {
- if (e.client.groups) {
- e.client.groups.forEach(function(g) {
- if (g.i+'' == config.group+'') { // Make sure we're using strings for both
- sinusbot.chatPrivate(e.client.id, config.text);
- sinusbot.move(e.client.id, config.channel);
- // Find mods...
- var notify = (config.modnotification || '').replace('%n', e.client.nick);
- var chans = sinusbot.getChannels() || [];
- chans.forEach(function(chan) {
- if (!chan.clients) return;
- chan.clients.forEach(function(client) {
- if (client.g) {
- client.g.forEach(function(group) {
- if (config.modgroups.indexOf(group.i+'') >= 0) {
- sinusbot.chatPrivate(client.id, notify);
- }
- });
- }
- });
- });
- return;
- }
- });
- }
- }
- });
- });
Add Comment
Please, Sign In to add comment