So this has been an annoyance for a while now for myself and my scripts' users. Sometimes when I try to whisper a message to a player using the "who" property of a message object, it doesn't work and gives them a console log error like this: {"who":"error","type":"error","content":"Unable to find a player or character with name: L337HaxX0rGM"} This is usually because they've set their in-game name to something that is not their canonical Roll20 username, but not always. Other times it has been because they might have special characters in their names. Other times it has done this for reasons I could not diagnose while trying to help these users. In my scripts, I've been able to use a work-around suggested by Aaron a long time ago that works something like this: /**
* @private
* Whispers a Marching Order message to someone.
*/
function _whisper(who, msg) {
sendChat('Its A Trap! script', '/w "' + _fixWho(who) + '" ' + msg);
} /**
* Fixes msg.who.
* @param {string} who
* @return {string}
*/
function _fixWho(who) {
return who.replace(/\(GM\)/, '').trim();
} The "who" argument in the above functions is expected to come from the chat:message object's "who" property. Sadly this workaround doesn't always work. Please fix message.who so that it can be used to whisper back to the user.