Created
May 30, 2017 15:16
-
-
Save Musinux/176e9ebfb42daaad34d387dff9302363 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/local/bin/node | |
var irc = require('irc') | |
var me = 'me' | |
var channel = '#chann' | |
var dest = 'dest' | |
var data = '\x24\xb1\x04\x08' // 0x804b120 | |
var client = new irc.Client('irc.root-me.org', me, { | |
channels: [channel] | |
}) | |
client.addListener('registered', function (message) { | |
console.log('registered', message) | |
client.addListener('pm', function (from, to, message) { | |
console.log('message', message) | |
}) | |
client.addListener('error', function (message) { | |
console.log('error: ', message) | |
}) | |
setTimeout(function () { | |
console.log('emit') | |
client.conn.write('PRIVMSG ' + dest + ' ') | |
client.conn.write(Buffer.from(data, 'ascii')) | |
client.conn.write('\r\n') | |
}, 5000) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment