Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var irc = require('irc'),
- fs = require('fs'),
- date_object = '';
- var client = new irc.Client('irc.opera.com', 'gloo_bot', {channels: ['#opera-fr']});
- client.addListener('message', function(from, to, message) {
- fs.open('irc.log', 'a', function(e, id) {
- date_object = new Date();
- fs.write(id, '< ' + date_object.toLocaleString() + ' >' + ' ' + from + ' : ' + message + '\n', null, 'utf-8', function(){
- fs.close(id, function(){});
- });
- });
- if(message.toLowerCase() == 'bonsoir')
- {
- client.say('#opera-fr', 'Bonsoir ' + from);
- }
- if(message.toLowerCase() == "!ping")
- {
- client.say('#opera-fr', "POOOOOOOOOOONG !!");
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment