Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create the configuration
- var config = {
- channels: ["#logtoipfs"],
- server: "irc.freenode.net",
- botName: "logtoipfs"
- };
- // Get the lib for IRC
- var irc = require("irc");
- // Get the lib for filesystem writing
- fs = require('fs');
- // Create the bot
- var bot = new irc.Client(config.server, config.botName, {
- channels: config.channels
- });
- // Listen for any message, write it to a file
- bot.addListener("message", function(from, to, text, message) {
- console.log(from + ' => ' + to + ': ' + text);
- fs.writeFile('ipfs.log', text);
- });
- // Write errors to the console
- bot.addListener('error', function(message) {
- console.log('error: ', message);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement