12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- var irc = require('./irc');
- var events = {
- 'botMessage': [],
- 'botNotice': [],
- 'channelMessage': [],
- 'channelNotice': [],
- 'channelModes': [],
- 'channelListMode': [],
- 'channelStatusMode': [],
- 'channelJoin': [],
- 'channelLeave': [],
- 'channelMetadata': [],
- 'channelCreate': [],
- 'netSynced': [],
- 'serverDelete': [],
- 'serverCreate': [],
- 'serverDesc': [],
- 'uplinkLost': [],
- 'userDelete': [],
- 'userCreate': [],
- 'userVHost': [],
- 'userVIdent': [],
- 'userRealname': [],
- 'userNick': [],
- 'userUmode': [],
- 'userMetadata': [],
- '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);
|