123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- var irc = require('./irc');
- var events = {
- 'botMessage': [],
- 'botNotice': [],
- 'channelMessage': [],
- 'channelNotice': [],
- 'channelModes': [],
- 'channelListMode': [],
- 'channelStatusMode': [],
- 'channelJoin': [],
- 'channelLeave': [],
- 'channelMetadata': [],
- 'channelCreate': [],
- 'netSynced': [],
-
- 'newTagMessage': [],
- 'serverDelete': [],
- 'serverCreate': [],
- 'serverDesc': [],
- 'uplinkLost': [],
- 'userDelete': [],
- 'userCreate': [],
- 'userVHost': [],
- 'userVIdent': [],
- 'userRealname': [],
- 'userNick': [],
- 'userUmode': [],
- 'userMetadata': [],
- 'doEvent': function(event){
- var args = new Array(arguments.length - 1);
- for(var i=1; i<arguments.length; i++){
- args[i-1] = arguments[i];
- }
- if(event in events){
- for(var i=0; i<events[event].length; i++){
- args = events[event][i].apply(null, args);
- }
- } else {
- console.log('Called unknown event '+event);
- }
- return args;
- }
- };
- irc.setEvents(events);
- irc.setConnection('localhost', 6667, 'unrealircd');
- var myUser = irc.makeUser('TestServ', 'pirc', 'serwisy.pirc.pl', 'Użytkownik testowy');
- var myChannel = irc.getChannel('#test');
- myChannel.joinUser(myUser);
- /*
- setTimeout(function(){
- irc.uplink.changeUmodes(myUser, { 'NOCTCPMESSAGES': true, 'BOT': false }); // setting umodes test
- }, 10000);
- */
|