On top of the chat commands that the Xsolla chatbot offers out of the box, you can also set up your own !commands in your Twitch channel.
You can add new custom commands to your chatbot from the Commands page. Alternatively, you and your moderators can also use the !set and !unset commands in your Twitch chat to quickly edit your custom commands.
For example, if you wanted an easy way to link people to your social media, you could create the command !socials with the message “Follow the stream on X at https://x.com/Xsolla.”
We also support some $variables, which you can use to make more advanced commands, such as shout-outs.
User-based variables
$user
You can create commands that accept a username when you run them. Within your command's message, you can use the $user variable to refer to this.
For example, if you frequently co-stream with someone else, you could create a moderator-only command called !costream with the message “We're streaming with $user today. Give them a follow!”
Then, if you run !costream @Xsolla, the chatbot will say “We're streaming with @Xsolla today. Give them a follow!”
This variable will always prefix the username with an @ symbol, even if you don't. So, in this example, !costream Xsolla would give exactly the same response.
$sender
The $sender variable will always refer to the name of the user who ran the command.
$title, $game, $url
These variables allow you to include information on a Twitch channel.
- $title refers to the title of the Twitch channel's stream.
- $game refers to the name of the game that the Twitch channel is playing.
- $url refers to the link to the Twitch channel.
For example, let's say we want to create a shout-out command. You can create a command called !so with the message “Go follow $user! They're playing $game over at $url.”
If you now run !so @Xsolla, the chatbot will say “Go follow @Xsolla! They're playing Minecraft over at https://twitch.tv/Xsolla”.
The Twitch channel that this information is fetched from depends on what variables precede it. Here, we used $user, so we accepted the username with the command. But, you could have used $sender to fetch the Twitch channel belonging to whoever ran the command, or you could have used no variable at all to fetch the streamer's channel.
Command counts
$count
The variable $count refers to the number of times that this command has been run.
For example, let's say you wanted a moderator-only chat command to count how many times the streamer has failed this level in the game.
You could create a command !deaths with the content “We've failed this level $count times!.”
Then, every time a moderator runs that command, the chatbot would announce that the streamer has failed the level 0 times, then 1 times, then 2 times, and so on.
If you want to reset the counter to zero, a moderator can run !reset deaths.
Custom arguments
$arg1, $arg2, $arg3, …
You can make more advanced commands that accept extra arguments whenever they're run.
Any extra arguments are represented by the variables $arg1, $arg2, $arg3, and so on. Each argument goes after your !command, separated with spaces.
For example, let's say you're playing a game with two teams, and want a fast way to announce in chat what the current scores are.
You might configure a moderator-only command called !scores, with the message “Red has $arg1 points, and Blue has $arg2 points. $arg3 is in the lead!”
If a moderator were to run this command with !scores 3 5 Blue, the chat bot will say “Red has 3 points, and Blue has 5 points. Blue is in the lead!”
$args
To ignore spaces and simply refer to everything after the !command, you can use the $args variable.
For example, let's say you defined a moderator-only command !giveaway with the message “This week, we're giving away $args. Follow us on Twitter and don't miss out!”
If you then ran !giveaway headphones, a mouse, and a webcam, the chatbot would say “This week, we're giving away headphones, a mouse, and a webcam. Follow us on Twitter and don't miss out!”
More things to try
- By default, the chatbot will start each response with your username. You can disable this by unticking "Start with @username" when you create your custom command in the dashboard.
- You can mix and match variables as you please.
For example, you could define !raid to be "We're raiding $user! We'll do a points giveaway if we get at least $arg2 raiders there".
You can then run !raid Xsolla 30 for the chatbot to say "We're raiding @Xsolla! We'll do a points giveaway if we get at least 30 raiders there".
- You can also make images and sounds pop up on your stream whenever someone runs a particular command. To find out more, read about overlay triggers.