Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var config = {
- channels: ["#bitcoinbot", "#fsociety"],
- server: "irc.freenode.net",
- botName: "bitcoinbot"
- };
- var responses = [
- "If you want know your networks hacked, you send bitcoin.",
- "If you want hack networks as like equation group, you send bitcoin.",
- "If you want reverse, write many words, make big name for self, get many customers, you send bitcoin.",
- "If want to know what we take, you send bitcoin."
- ];
- function random (low, high) {
- return Math.floor(Math.random() * (high - low) + low);
- }
- // Get the lib
- var irc = require("irc");
- // Create the bot name
- var bot = new irc.Client(config.server, config.botName, {
- userName: 'bitcoinbot',
- realName: 'nodeJS IRC client bitcoinbot',
- channels: config.channels,
- password: "",
- sasl:true
- });
- // Listen for any message, PM said user when he posts
- bot.addListener("message", function(from, to, text, message) {
- if(text.indexOf("bitcoin") > -1) {
- var resId = random(0,responses.length);
- // console.log(resId);
- bot.say(to, responses[resId]);
- }
- });
- bot.addListener('error', function(message) {
- console.log('error: ', message);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement