
Hello Community, I'm trying to get API script to excaute a macro when a function is called. I'm not sure how / if I can do this but this is what I'm trying to do: on("chat:message", function(msg_orig) {
if(msg_orig.type === "api") {
var msg=_.clone(msg_orig);
msg.content = msg.content.toLowerCase();
var schedule = msg.content.split(/\s+/);
switch (schedule[0]){
// This will excaute the #WorkTime
case '!workhours':
sendChat(msg.who, "#WorkTime");
break;
}
switch (schedule[0]){
case '!resthours':
sendChat(msg.who, "#RestTime");
break;
}
}
});
If anyone has any ideas, or links to the wiki i might have missed, I'd appreciate the assistance.