-
-
Save stevenleeg/6124832 to your computer and use it in GitHub Desktop.
This file contains 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 coffee | |
# install dependencies: npm install irc | |
irc = require 'irc' | |
server = 'hubbard.freenode.net' | |
nickServPassword = '' | |
nick = 'bongbot' | |
client = new irc.Client server, 'bongbot', | |
server: server | |
secure: true | |
port: 6697 | |
channels: ['#hackny'] | |
userName: 'bongbot' | |
realName: 'BongBot' | |
client.on 'connect', -> | |
console.log "connected to #{server}" | |
if nickServPassword | |
console.log 'identifying to NickServ' | |
client.say 'NickServ', 'identify ' + nickServPassword | |
client.on 'action', (from, channel, message) -> | |
if message.indexOf(nick) + nick.length == message.length | |
client.say channel, 'BOOOONNNGGGGGG' | |
client.on 'message', (from, channel, message) -> | |
if -1 !== message.indexOf nick | |
client.say channel, 'BONG' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment