12345678910111213141516171819202122232425262728293031 |
- var irc = require('./irc');
- var events = {
- 'netSynced': [],
- 'botMessage': [],
- 'channelMessage': [],
- 'channelNotice': [],
- 'botNotice': [],
- 'serverDelete': [],
- 'channelCreate': [],
- 'userCreate': [],
- 'serverCreate': [],
- 'uplinkLost': [],
- 'userDelete': [],
- 'doEvent': function(event, args){
- if(event in events){
- for(var i=0; i<events[event].length; i++){
- args = events[event][i](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);
|