Skip to content

Chat automation

Looomy command variables: a simple guide with examples

Learn command variables one example at a time: what to save, what a viewer types, and what Looomy replies. Copy variables directly from each explanation.

Colored tiles fit into a chat reply, showing how reusable pieces create personalized messages.

A variable is a placeholder in your command's reply. Write Hey $(user)!, and Looomy replaces $(user) with the name of the viewer who runs it.

Let's start with a greeting, then work through other useful replies. The small copy icon beside a variable copies just that variable, not the whole example.

Start with a greeting

Open Chatbot → Commands → Add Command. Set the name to !hello and the Chat message to Hey $(user), welcome to $(channel)!.

Here, $(user) is the viewer's name, and $(channel) is your channel name.

  • Viewer types: !hello
  • Looomy replies: Hey Maya, welcome to Aaveg Plays!

That reply assumes Maya runs the command on Aaveg Plays. Another viewer gets their own name—there is no need to create a greeting for each person.

Save and enable the command. With monitoring running and your bot set up, try it in live chat. These examples are commands you create yourself; they are not built in. Keep the exact name you saved: hello and !hello are different triggers.

For permissions, cooldowns, characters and effects, see the command setup guide.

Give someone a shout-out

Use $(touser) when the reply should name someone mentioned after the command.

  • Command: !so
  • Chat message: Shout-out to $(touser)! Thanks for being here.
  • Viewer types: !so @Priya
  • Looomy replies: Shout-out to Priya! Thanks for being here.

It takes the first word after the command and removes a leading @. If the viewer only types !so, it uses their own name instead. It does not look up a channel or create a clickable mention.

Repeat a viewer's question

Use $(query) for everything the viewer writes after the command name.

  • Command: !question
  • Chat message: Question for the stream: $(query)
  • Viewer types: !question which microphone do you use?
  • Looomy replies: Question for the stream: which microphone do you use?

The command name is not part of the query. If nothing follows it, the query is empty. This repeats the question; it does not generate an answer.

Take individual words instead

For a matchup, use $(1) for the first word and $(2) for the second.

  • Command: !match
  • Chat message: Today's matchup: $(1) versus $(2)!
  • Viewer types: !match cats pandas
  • Looomy replies: Today's matchup: cats versus pandas!

The same pattern continues through $(9) for the ninth word. These are word positions, not nine different commands. Missing words become empty. Spaces separate words; quotation marks do not keep a multiword name together. Unlike $(touser), numbered variables keep a leading @.

Count how often a command runs

Use $(count) to include that command's usage count.

  • Command: !hype
  • Chat message: Chat has brought the hype $(count) times!
  • Viewer types: !hype
  • Looomy replies, when the count is 42: Chat has brought the hype 42 times!

This counts uses, not unique viewers or game wins. In a follow-up chain, it belongs to the command the viewer originally triggered.

Show how long you have been live

Use $(uptime) for the elapsed time since the current stream started.

  • Command: !uptime
  • Chat message: We have been live for $(uptime).
  • Viewer types: !uptime
  • Example reply: We have been live for 1 hour 24 minutes.

The duration changes as your stream continues. If the stream's start time is unavailable, the reply contains [uptime unavailable].

Show your local time

Use $(time Asia/Kolkata "h:mm A") to show a clock in a chosen timezone.

  • Command: !time
  • Chat message: Time here: $(time Asia/Kolkata "h:mm A") IST
  • Viewer types: !time
  • Example reply: Time here: 8:30 PM IST

Replace Asia/Kolkata with your timezone, such as Europe/London, and change or remove the IST label. The format h:mm A gives a 12-hour clock; HH:mm gives a 24-hour clock. Keep the format inside straight double quotes. More options are in the Moment date-format reference.

Without a timezone, $(time) uses UTC. Without a format, it uses a longer date-and-time display.

Count down to an event

Use $(countdown 2030-01-01T00:00:00Z), replacing the sample date with your event's date and time.

  • Command: !launch
  • Chat message: Launch in $(countdown 2030-01-01T00:00:00Z)!
  • Viewer types: !launch
  • Example reply, one day before the event: Launch in 1 day!

Z means UTC. You can use an explicit offset instead, such as 2030-01-01T20:00:00+05:30. Include one so the time is unambiguous. The reply is calculated when the command runs; an old message does not keep ticking.

Count time since a milestone

Use $(countup 2025-01-01T00:00:00Z) with a past date instead. For example, a !anniversary command with Our community has been going for $(countup 2025-01-01T00:00:00Z). can show time since your first stream.

A countdown whose date has passed, or a countup whose date is still ahead, returns 0 seconds.

Pick a random answer

Use $(random cozy|chaotic|legendary) to choose between options separated by |.

  • Command: !vibe
  • Chat message: Today's vibe is $(random cozy|chaotic|legendary).
  • Viewer types: !vibe
  • One possible reply: Today's vibe is cozy.

Replace those words with your own choices. Each run chooses again; repeats are possible.

Pick a number instead

For a die roll, use $(random 1 6). A !roll command with the message You rolled $(random 1 6)! returns a whole number from 1 through 6, including both ends—for example, You rolled 4!

Use $(querystring) to make the viewer's text safe for a URL parameter.

The %20 represents the space. This creates a search link, not a summary of results. Use the variable for a parameter's value, not for an entire URL. You can also supply fixed text, as in $(querystring blue panda).

Check a viewer's role

Use $(userlevel) to show the viewer's permission level.

  • Command: !myrole
  • Chat message: Your role is $(userlevel).
  • A moderator types: !myrole
  • Looomy replies: Your role is moderator.

Possible values are owner, moderator, regular, subscriber and everyone. Channel membership is represented as subscriber.

IDs and the command name

Most replies need names, not IDs. For troubleshooting or integrations, you can also use:

  • $(userid): the viewer's YouTube channel ID.
  • $(channelid): your YouTube channel ID.
  • $(chatid): the current live chat ID.
  • $(command): the primary trigger, even if a viewer used an alias. A follow-up chain keeps the original trigger.

For example, a moderator-only !chatid command with Live chat ID: $(chatid) replies with that chat's ID. Keep diagnostic replies restricted if they are not useful to your audience.

Advanced: fetch a status from your own service

Use $(urlfetch https://your-api.example/status) only if you have a public HTTPS endpoint that returns short plain text. Replace the placeholder URL before saving.

  • Command: !status
  • Chat message: Server status: $(urlfetch https://your-api.example/status)
  • Viewer types: !status
  • If your endpoint returns Online: Server status: Online

This does not summarize a webpage or extract a field from JSON. Private and local addresses are blocked. Never put passwords, access tokens or other secrets in a command or its URL. Failed requests can return [urlfetch error]; excessive use can return [urlfetch rate limited].

Older imported commands may call this $(customapi https://your-api.example/status). It is an alias for the same feature.

Advanced: calculate a value

Use $(eval 7 * 24) for a small JavaScript expression.

  • Command: !week
  • Chat message: There are $(eval 7 * 24) hours in a week.
  • Viewer types: !week
  • Looomy replies: There are 168 hours in a week.

Evaluation runs in an isolated, bounded and rate-limited environment without browser or server APIs. Other command variables are not substituted into executable code, so do not nest them inside $(eval ...). Invalid expressions can return [eval error].

If a variable does not work

Check the spelling and required arguments. For example, $(countdown) needs a date, while $(user) does not take extra arguments. Replace sample dates, options and URLs, but keep the variable name inside $() unchanged.

These examples are for viewer-triggered commands. Timers have no viewer, so viewer names, IDs, roles and command counts are unavailable there. Plain timer messages also have no command trigger or arguments. A command-backed timer can use its configured command and input, but still has no viewer identity.

Start with one reply, test it with and without extra input, then add the next. Keep replies short enough to allow for longer viewer names and messages.