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

How to send whisper to player by id? (or other property on Player object)

1682104375

Edited 1682105655
I'm having a hard time tracking down the syntax for this, how does one send a whisper to a player by e.g. their id? And it doesn't have to id, I just want to whisper to a specific Player object, basically. There's a message I want to send directly to a player when they join the game. In this particular case it's for GM's only, so I can just do "/w gm", but I'd like to know how to do this in case I ever can't get away with just whispering to the GM. I thought about using "_displayname" from the joining player, but that doesn't seem to be guaranteed to be unique.
1682110303
timmaugh
Forum Champion
API Scripter
You can translate the ID into a name easily enough (Fetch will do it in your command line, or you can use Roll20 functions if you are coding a script, yourself). However, whispering is name-driven ... so having non-unique names will present a problem. You do have a workaround available, however. Follow these steps: 1) capture the id of the player who joined 2) assign them controlledby rights to a "Welcome" character (making sure *that* name is unique) 3) whisper to the "Welcome" character 4) remove their controlling rights to that character I'm guessing if you are capable of getting the _displayname of the character, you can also capture their ID, which is what you would need to begin the above process. Post back if you need help with any of the steps.
Ahh, I was hoping there was a "proper" way to uniquely address players with whispers, but that's fine if I have to use workarounds. These are mostly just scripts for my friends, so I can just say "don't do that" for non-unique names. But since it's possible, it was something I had to consider. Your workaround sounds pretty straightforward too, if I ever need it. Thanks!!