Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. registerPlugin({
  2.   name: 'Info Channel',
  3.   version: '1.0',
  4.   description: 'Info Channel',
  5.   author: 'Henry_Vorragend aka Red_Romeo',
  6.   engines: '>= 0.9.16',
  7.   vars: [
  8.     {
  9.       name: 'infoUsers',
  10.       title: 'Support Server Groups',
  11.       type: 'array',
  12.       vars: [
  13.         {name: 'uid',title: 'User UID',type: 'string'},
  14.         {name: 'name',title: 'User Name',type: 'string'},
  15.         {
  16.           name: 'infoChannels',
  17.           title: 'Support Channels',
  18.           type: 'array',
  19.           vars: [
  20.             {name: 'id',title: 'Channel',type: 'channel'}
  21.           ]
  22.         }
  23.       ]
  24.     }
  25.   ]
  26. }, function(sinusbot, config) {
  27.   var event = require('event');
  28.   var backend = require('backend');
  29.  
  30.   event.on('clientMove', function(ev) {
  31.     if(ev.toChannel != null){
  32.       if(config.infoUsers != null){
  33.         config.infoUsers.forEach(function(infoUser) {
  34.           var client = backend.getClientByUID(infoUser.uid);
  35.           if(client != null && infoUser.infoChannels != null){
  36.             infoUser.infoChannels.forEach(function(infoChannel) {
  37.               if(ev.toChannel.id() == infoChannel.id){
  38.                 client.chat("[b][color=blue][InfoChannel][/color] [color=green]" + client.name() + "[/color] wartet in [color=green]" + ev.toChannel.name() + "[/color][/b]");
  39.               }
  40.             });
  41.           }
  42.         });
  43.       }
  44.     }
  45.   });
  46. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement