1.1.0 • Published 10 years ago
nwitch-lmgtfy v1.1.0
nwitch-lmgtfy
nwitch (and slate-irc) plugin for lmgtfy.
05:34 <KenanY> !lmgtfy how do i javascript
05:34 <nwitch> KenanY: http://lmgtfy.com/?q=how+do+i+javascript
Example
As a nwitch plugin (using config.toml
):
[plugins]
nwitch-lmgtfy = true
Or through nwitch's API:
var Nwitch = require('nwitch');
var lmgtfy = require('nwitch-lmgtfy');
var nwitch = new Nwitch({
irc: {
address: 'irc.freenode.org',
port: 6667
}
});
nwitch.use(lmgtfy());
Technically, all nwitch plugins are just slate-irc plugins, so you could also use this as a slate-irc plugin:
var net = require('net');
var irc = require('slate-irc');
var lmgtfy = require('nwitch-lmgtfy');
var stream = net.connect({
port: 6667,
host: 'irc.freenode.org'
});
var client = irc(stream);
client.use(lmgtfy());
Installation
$ npm install nwitch-lmgtfy
API
var lmgtfy = require('nwitch-lmgtfy');
lmgtfy()
Returns a function that accepts an instance of slate-irc.