Skip to content

Instantly share code, notes, and snippets.

@goblinHordes
Last active December 28, 2015 01:59
Show Gist options
  • Save goblinHordes/7424756 to your computer and use it in GitHub Desktop.
Save goblinHordes/7424756 to your computer and use it in GitHub Desktop.
apicmd.r20.js - Roll20 API hooks for apicmd
apicmd.on('apicmd', '[options] info',
[['-e', '--echo', 'echos the remaining arguments back to chat']],
function (msg, argv){
if(argv.opts.echo){
sendChat('API', '/desc ' + argv.args.join(' '));
return;
};
});
on('chat:message', function(msg) {
if(msg.type == 'api'){
apicmd.call(msg)
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment