Created
June 25, 2012 17:34
-
-
Save flores/2990059 to your computer and use it in GitHub Desktop.
opsangeles-bot @cwebberOps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var Client = require('irc').Client; | |
// configuration | |
// irc. server names, guys to auto-op, etc | |
var botname = "opsangeles-bot"; | |
var server = "chat.freenode.com"; | |
var channel = [ "#opsangeles" ]; | |
var opusers = [ | |
"lolcatstevens", | |
"alrs", | |
"cwebber", | |
"blovett", | |
"goodwill", | |
"llakey", | |
"jsnby", | |
"retr0h", | |
"up_the_irons", | |
"solarce", | |
"s0larce" | |
]; | |
// set up the irc clients | |
var irc = new Client( | |
server, | |
botname, | |
{ channels: channel } | |
); | |
irc.on('join', function(to, nick) { | |
if ( opusers.indexOf( nick ) >= 0 ) { | |
irc.send('mode', to, '+o', nick); | |
} | |
}); | |
/* placeholder for bot interaction | |
irc.on('message', function (nick, to, text) { | |
}); | |
*/ | |
irc.on('error', function(text) { | |
console.log(text); | |
}); |
You should throw this into a repo anyway. Then we can all add to it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@cwebberOps really just node-irc and no router or tweet/email notifications as with Snake-Eyes