One thing I noticed
js code:
$.addEventListener("ChatWndReceiveMessage", function (chatWnd, origin, message, msgKind) {
if (msgKind === 1)
{
$.triggerCommand($(chatWnd), $(chatWnd.Contacts).GetContact(origin), message.split(' ')[0].toUpperCase(), message.split(' ').slice(1).join(' '), message, true);
}
});
You cannot obtain the Contact object by passing the origin parameter to the GetContact function.