Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Help] How do I whisper the person who called the api script?

1530472801

Edited 1530472854
Ambitosis
Marketplace Creator
IE sendChat(script_name,  PROBLEM   + '<div style="'+style+'">'+title+contents+'</div>', null, {noarchive:true}); The problem is.. well, where the PROBLEM is. I need the script to send a chat message to the player that called the API. It's from a token action macro, so it's guaranteed to have a correct and reliable selection as well (if that helps things), but trying to do '/w @{selected|character_name}' returns an error.
1530474510
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
you'll need to grab the player's id from the chat message that triggered the API script and then convert that into their display name. See the wiki for more details on the message object.
1530475744
Ambitosis
Marketplace Creator
Thanks, got it.