Skip to content

$(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.

!command add !hug $(sender) gives $(touser) a big warm hug!
Example chat
ViewerName:!hug @CoolStreamer
partner badgemoderator badgeStreamElements:ViewerName gives @CoolStreamer a big warm hug!
ViewerName:!hug
partner badgemoderator badgeStreamElements:ViewerName gives ViewerName 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:

  1. Without input: It displays the display name of the user who triggered the command.
  2. 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.
!command add !shoutout Hey everyone, check out $(touser)'s channel! They're awesome!
Example chat
moderator badgeModUser:!shoutout CoolStreamer
partner badgemoderator badgeStreamElements:Hey everyone, check out CoolStreamer's channel! They're awesome!
moderator badgeModUser:!shoutout
partner badgemoderator badgeStreamElements:Hey everyone, check out ModUser's channel! They're awesome!

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.
  • $(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.