$(touser)
- Syntax
$(touser)- Arguments
- None
The $(touser) variable displays the first word typed after a command, falling back to the sender’s name — handy for shoutouts and any command aimed at a specific user.
Use it
Section titled “Use it”!command add !hug $(sender) gives $(touser) a big warm hug!Note how the @ prefix is passed through exactly as typed, and how $(touser) falls back to the sender’s name when no word is given.
The $(touser) variable can be used in two ways:
- Without input: It displays the display name of the user who triggered the command.
- With input: It displays the first word provided after the command, exactly as typed. Only leading
/and.characters are removed; an@prefix is kept as-is.
Examples
Section titled “Examples”Mentioning a specific user
Section titled “Mentioning a specific user”!command add !shoutout Hey everyone, check out $(touser)'s channel! They're awesome!Parameters
Section titled “Parameters”The $(touser) variable itself takes no parameters — it reads the first word following the command:
- word: The first word typed after the command. If provided, this word will be displayed instead of the command user’s name.
Related Variables
Section titled “Related Variables”$(sender): Always displays the name of the user who triggered the command.- Argument tokens (
$(1),$(1:)): Access the words after the command directly, with optional fallbacks and validators.
Q: What happens if I use $(touser) with multiple words after it?
A: Only the first word after the command will be used. Any additional words will be ignored.