Skip to content

Instantly share code, notes, and snippets.

@Musinux
Created May 30, 2017 15:16
Show Gist options
  • Save Musinux/176e9ebfb42daaad34d387dff9302363 to your computer and use it in GitHub Desktop.
Save Musinux/176e9ebfb42daaad34d387dff9302363 to your computer and use it in GitHub Desktop.
#!/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