palindromed / Bot-HandOff

MIT License
103 stars 79 forks source link

Expose commands through API or backchannel events #17

Open microsoftly opened 7 years ago

microsoftly commented 7 years ago

Right now it looks like the only way to trigger these commands is via text. Would it be possible to get this functionality exposed as part of the API, either explicitly or via passing in functions that determine whether or not a command should be executed?

liliankasem commented 6 years ago

Definitely on the to do list when I have time; feel free to make a PR if you get this going. In the mean time, I did add a new function in the npm module (0.2.0) to trigger the handoff manually e.g.

bot.dialog('/disconnect', (session)=>{
    handoff.triggerHandoff(session);
}).triggerAction({
    matches:  /^agent/i,
});