nwitch-custom-commands
nwitch (and slate-irc) plugin that allows you to define responses for any command.
05:34 <KenanY> !foo05:34 <nwitch> KenanY: bar05:35 <KenanY> !baz05:35 <nwitch> KenanY: foobar
Example
As a nwitch plugin (using config.toml
):
[plugins.nwitch-custom-commands]foo = "bar"baz = "foobar"
Or through nwitch's API:
var Nwitch = ;var customCommands = ;var nwitch =irc:address: 'irc.freenode.org'port: 6667;nwitch;
Technically, all nwitch plugins are just slate-irc plugins, so you could also use this as a slate-irc plugin:
var net = ;var irc = ;var customCommands = ;var stream = net;var client = ;client;
Installation
$ npm install nwitch-custom-commands
API
var customCommands = ;
customCommands(opts)
Given an Object opts
, registers a new command for each key-value in obj
.
The value of each key is the output for a command matching the key.