Subbing inline rolls is the only thing you should have to do. Would look something like this ( completely untested ) example: on('ready',function(){
"use strict";
const processInlinerolls = (msg) => {
if(_.has(msg,'inlinerolls')){
return _.chain(msg.inlinerolls)
.reduce(function(m,v,k){
var ti=_.reduce(v.results.rolls,function(m2,v2){
if(_.has(v2,'table')){
m2.push(_.reduce(v2.results,function(m3,v3){
m3.push(v3.tableItem.name);
return m3;
},[]).join(', '));
}
return m2;
},[]).join(', ');
m['$[['+k+']]']= (ti.length && ti) || v.results.total || 0;
return m;
},{})
.reduce(function(m,v,k){
return m.replace(k,v);
},msg.content)
.value();
} else {
return msg.content;
}
};
on('chat:message',function(msg){
if('api' !== msg.type || !playerIsGM(msg.playerid) ){
return;
}
let args = processInlinerolls(msg.content).split(/\s+/);
let ids = ((msg.selected && _.pluck(msg.selected,'_id')) || []);
switch(args.shift()){
case '!delay': {
let amount = parseInt(args.shift());
if(!_.isNaN(amount)){
_.delay(()=>sendChat('',`${args.join(' ')} --ids ${ids.join('')}`), amount);
}
}
break;
}
});
});