This version is outdated by a newer approved version.DiffThis version (2020/09/25 22:07) is a draft.
Approvals: 0/1

This is an old revision of the document!


We are currently in the process of re-doing this page This is in an effort to both make it easier to maintain when new variables are added and also easier for you to navigate to what you require Please bare with us while this change is taking place. - Presidante

On this page you will find the list of all the custom command variables that can be added into your custom commands. VIP exclusive variables have been separated so that you are aware what variables require the VIP monthly subscription.

There are a couple of message flags you can add to the beginning of your commands which will force a command output to be sent to another location. I.e. command is executed in Twitch chat but the output needs to go to a Discord channel. These can be found below.

Message Flag Info
/chat This will force the message to post to Twitch chat no matter where the command source is from (Discord/Whisper/Chat)
/discord This will force the message to post to your Monitor Discord channel(s) you have set in Master Settings no matter where the command source is from (Discord/Whisper/Chat)
/w USERNAME This will whisper the specified user regardless of the command source (Discord/Whisper/Chat). Typically in commands this is used with /w @user@. This requires whisper integration to be turned on in Master Settings.
/discord=CHANNELNAME This will force the message to post to the discord server linked in Master Settings to the channel name specified no matter where the command source is from (Discord/Whisper/Chat)
\r\n This is used in the middle of a message to post everything after that on a new line in Twitch chat. Effectively the same as typing a message, pressing return and then typing another message
\! Overrides Deepbots default behaviour regarding triggering internal commands. This will cause deepbot to post the full message to Twitch chat. Useful for Deepbot to communicate with other bots that also use ! as a trigger


These are being checked to ensure that the “VIP Exclusive” tag is correct for each of the variables. Please bare with us

DeepBot allows you to use custom commands in the channel messages module that allow you to deliver dynamic content to your viewers.
Currently, there are over 100 custom command variables that you can use in your commands.
Please see the table below for the full list of variables available to you.
You can organise this list by either searching for the variable that you want or by clicking the header names to organise in ascending or descending order.
You can also search for a specific variable by using keywords. This will search all the columns for the containing that word.
Feel some more are needed? Request them over at our Twitter or Discord.

Variable Description Vip Exclusive?
@btag@ Returns the value held in the “Battle Tag” field when going to edit a viewer in the user database. Viewers can set this by running !btag name#xxxx. The x's represent a number in the Blizzard Battle tag. No
@cmdstatus@[!command] Checks if a custom command you have created is either enabled or disabled. Yes
@cost@ Tells the user how much it costed if the command was executed. No
@counter@ Counts the number of times a command has been executed successfully. The value that this pulls from the command can be reset in the custom command editor. No
@customapi@[InsertAPIURLHere] Use your own custom API. Include the brackets when making the command. (See the examples below.) No
@disablecmd@[!command] Disables a command. Yes
@discordinfo@[username] Assuming the viewer in question has linked their Discord account this variable retrieves the user's Discord name or ID. e.g.
@discordinfo@[expertsonline] or @discordinfo@[@user@,id]
Yes
@enablecmd@[!command] Enables a command. Yes
@escrow@ Gets the number of points the user has currently placed in bets, raffles, and mini-games. No
@followers@ Total number of users following the channel. No
@game@ Displays what is currently being streamed in the channel. No
@getcounter@[!command] Grabs the counter of a command. (E.g. for a death counter mods could use a mod only custom command !adddeath to add the death to the counter. Viewers could use !death which contains “@getcounter@[!adddeath]” to display what the counter for the !adddeath command is currently at. No
@hours@ Total number of hours the user has been watching the stream. No
@hrstolevelup@ Number of hours until the user reaches the next stream rank. No
@intpoints@ Pulls points without the thousands separator. No
@joindate@ The date the user first joined the channel. No
@mkdir@[pathname] Custom variable to allow 'custom logs' sub directories to be created, useful for initialising custom commands and games. e.g. @mkdir@[games/users/@user@]. No
@nextrank@ Shows the next stream rank. No
@points@ Displays the user's points. No
@pointsname@ Name of the channel currency. No
@pointstolevelup@ Number of points until the user reaches the next stream rank. No
@randomuser@ Picks a random user currently in the channel. No
@remotesound@[delay,url] Plays MP3 files hosted on websites. Delay is in seconds. No
@slabspoints@[check|@user@] Command to get the points on the Stream Labs platform. No
@slabspoints@[deposit|@user@|20|1] Command to deposit 20 points into the Stream Labs platform. The last parameter is the multiplier, e.g. use 0.99 to add a 1% transfer fee. Returns “Success” if the transfer is successful. No
@slabspoints@[withdraw|@user@|20|1] Command to withdraw 20 points from the Stream Labs platform. The last parameter is the multiplier, e.g. use 0.99 to add a 1% transfer fee. Returns “Success” if the transfer is successful. No
@setcounter@[!command|number] Sets the counter of a command. Useful if you need to manually edit the counter at a moment's notice No
@streamrank@ Displays the user's stream rank. No
@target@ Grabs anything after the initial command. First parameter of channel message. (E.g. Message : http://twitch.tv/@target@, "!twitch experts" will display http://twitch.tv/experts) No
@target@[1] Similar to @target@, but you can specify multiple targets and have them placed wherever you like. (E.g. @target@[1] hit @target@[2], “!hit Expertsonline RepentGamingTV” will give a message Expertsonline hit RepentGamingTV) No
@target@[1|20] Grabs an array of targets. (E.g. !name My name is Bob | @target@[1|4]) No
@time@ Displays the current time on the computer the bot is hosted using the 12-hour clock. No
@time24@ Displays the current time on the computer the bot is hosted using the 24-hour clock. No
@title@ Displays the current stream title. No
@uptime@ Shows the total amount of time the stream has been live (calculated by Twitch). No
@uptime2@ Similar to @uptime@, except the total time is self-computed by DeepBot, with grace period for crashes/disconnects. No
@user@ Displays the username of the person who executed the command. No
@userclass@ Displays the class of the user. In order of priority; [Streamer, DeepBot, VIP Gold, VIP Silver, VIP Bronze, Mod Level 2, Mod Level 1, Viewer] No
@viewers@ Current number of viewers watching the stream. No
@viprank@ Displays the VIP rank of the user. No
@calc@ Use operators to calculate mathematical equations. @calc@[op|num1|num2] , Available operations (+,-,*,/). E.g. @calc@[+|5|4]. Yes
@ctrt@ Generates a link to retweet a tweet. E.g. Support the stream by retweeting! @ctrt@[658476806278881281] Yes
@ctt@[InsertCustomTweet] This generates a link to tweet out a custom message specified. E.g. Support the stream by tweeting! @ctt@[Check out expertsonline @ http://twitch.tv/expertsonline playing @game@] Yes
@customjsonapi@[URL,field] Custom API support to get parts of a JSON object. For example to get the status for a channel using user input - @customjsonapi@[https://api.twitch.tv/kraken/channels/@target@[1],status] (Note Twitch API requests now require you to pass a Client ID along with your request. See https://blog.twitch.tv/client-id-required-for-kraken-api-calls-afbb8e95f843#.qvtr401fh for more info) Yes
@customjsonapi2@ Custom API support with GET/POST capability as well as custom headers.
Example GET
@customjsonapi2@[{ “url”: “https://postman-echo.com/get”, “method”: “GET”, “headers”: \[ “Content-Type: application/json” \], “path”: “data.args.foo1”, “showResult”: “true”}]
Example POST
@customjsonapi2@[{ “url”: “https://postman-echo.com/post”, “method”: “POST”, “payload”: { “args”: { “foo1”: “bar1”,“foo2”: “bar2”}}, “headers”: \[ “Content-Type: application/json” \], “path”: “data.args.foo1”, “showResult”: “false”}]
Yes
@datetime@[format] Formatted date/time output. Formatting Details : https://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx Yes
@datetime@[secs] Convert seconds to human friendly text Yes
@editpoints@ Silently edits users' points in chat. Only runs when the command that includes this variable has User (Elevated Access) selected. E.g. @editpoints@[@user@|10] Yes
@exec@ Chains one or more commands from a single command. E.g. @exec@[5,!bot] will run !bot after 5 seconds. Yes
@followdate@ Displays the date the user followed the channel. Yes
@if@[data||matchWith||matchedResult||FailResult] An if-then statement that compares data and gives a response if it matches or not. Yes
@if@[data||matchWith||matchedResult] Data is returned if match fails. Yes
@if@[operator||value1||value2||success||fail] Success if value1 operator value2 is true. Supported operators are: >, >=, <, and ⇐. (e.g. @if@[>||@rand@[0|100]||75||You win!||You die!] Yes
@isnumber@[number] Checks if the input is a number. Yes
@isnumber@[+|number] Checks if the input is a positive number. Use - to check for negative numbers. Yes
@isonline@[user] For checking if the user is currently in chat. Yes
@last5follows@ Displays the last 5 users who followed the stream. (Also works for timed messages) Yes
@last10follows@ Displays the last 10 users who followed the stream. (Also works for timed messages) Yes
@lastseen@ Shows when a user was last seen talking in the channel. Yes
@lookupinfo@[var,user] Displays info of a user. (Requires variable names to start with l_) e.g. @lookupinfo@[@l_points@,expertsonline] Yes
@l_btag@ Show the battle tag for the user. @lookupinfo@[@l_btag@,expertsonline] Yes
@l_followdate@ Displays the date the user followed the channel. Yes
@l_hours@ Total number of hours the user has been watching the stream. Yes
@l_lastseen@ Shows when the user was last seen talking in the channel. @lookupinfo@[@l_lastseen@,expertsonline] Yes
@l_user@ Displays the username of the person who executed the command. Yes
@l_intpoints@ Pulls points without the thousands separator. Yes
@l_joindate@ Displays the date the user joined the channel. Yes
@l_streamrank@ Displays the user's stream rank. Yes
@l_hrstolevelup@ Number of hours until the user reaches the next stream rank. Yes
@l_pointstolevelup@ Number of points until the user reaches the next stream rank. Yes
@l_userclass@ Displays the class of the user. In order of priority; [Streamer, DeepBot, VIP Gold, VIP Silver, VIP Bronze, Mod Level 2, Mod Level 1, Viewer] Yes
@l_nextrank@ Shows the next stream rank. Yes
@l_viprank@ Displays the VIP rank of the user. Yes
@rand@[min|max] Generates a random number between the minimum and maximum numbers specified. E.g. @rand@[1|100] Yes
@rand@[min|max|unique] “Unique” parameter to allow multiple random numbers to be generated in a single message Yes
@readfile@[PathToFile\Example.txt] Reads a line from an existing text file. (By default, it uses the custom logs folder in your DeepBot folder). E.g. @readfile@[followcount.txt] Yes
@readfile@[Line#,Example.txt] Reads a specific line from an existing text file. For example, @readfile@[4,users.txt] will read the fourth line. Use 'l' (L) instead of a number to read the last line. Yes
@replace@[String/Variable|To Replace|To Replace With] Searches a string or variable and performs a find/replace operation on it. For example, @replace@[@target@|@|] will search the @target@ variable for any @ symbols. If it finds any, it will remove them from the text. Another example of this is @replace@[@target@|_| ], which would replace any _ (underscores) with a space. E.g. @replace@[This_is_a_bot_test.|_| ] → This is a bot test. Yes
@savefile@[PathToFile\Example.txt,Example Line will be added] Creates a new text file or, if a text file with the same name already exists, it will overwrite the existing file. E.g. @savefile@[deathcounter.txt,The death counter is now at @counter@] Yes
@savelog@[PathToFile\Example.txt,Example Line will be added] Adds new lines to existing files. E.g. @savelog@[userqueue.txt,@user@ purchased a spot at @time@] You can also write the same text as the text sent to the channel by using @message@. E.g. @user@ has purchased a song! E.g. @savelog@[songpurchase.txt,@time@:@target@]) Yes
@sendstreamermsg@[message] Allow the bot to send messages as the streamer. Yes
@sound@[delay,file] Play a specified wav/mp3 file after a specified delay. Yes
@steam@[SteamCommunityID] Displays Steam ID and the game that person is currently playing. E.g. @steam@[expertsonline] (This goes off your Steam ID, so just use the last part after id/. E.g. http://steamcommunity.com/id/expertsonline) Yes
@subs@ Displays the total number of users subscribed to the channel. (This only works for partnered Twitch channels.) Yes
@tts@[message] This will play the message through text-to-speech. e.g. @tts@[Hello, from expertsonline] Yes
@unixtime@ Numeric time for use in if statements. (Number of seconds since January 1, 1970) Yes
@userinfo1@[username] Display info from the user in the user database e.g. @userinfo1@[@user@] Yes
@userinfo2@[username] Display info from the user in the user database e.g. @userinfo2@[@user@] Yes
@userinfo3@[username] Display info from the user in the user database e.g. @userinfo3@[@user@] Yes
@setuserinfo1@[username|new info] sets info1 for the user in the user database Yes
@setuserinfo2@[username|new info] sets info2 for the user in the user database Yes
@setuserinfo3@[username|new info] sets info3 for the user in the user database Yes
@weather@[city, country code] Checks the weather in any part of the world. E.g. @weather@[Rome, 00197] or @weather@[@target@[1], @target@[2]] Yes
@editvip@[user|vip_rank|+days] Add vip to a selected user. Ei. @editvip@[@target@|3|+30] Yes
@obs@[StartStreaming] Use this to make deepbot start your live stream in Obs with Obs remote Yes
@obs@[StopStreaming] Use this to make deepbot stop your live stream in Obs with Obs remote Yes
@raffleinfo@ Shows information about the users raffle entry status Yes
@readdb@ read from the key value store. e.g. @readdb@[slots.@user@] Yes
@savedb@ save to the key value store. e.g. @savedb@[5m|slots.@user@|50]. This saves the value 50 to key slots.@user@ with a 5 minute time to live. After 5 mins the value expires. TTL is a value in seconds, or you can use prefixes of m, h, d for minutes, hours, days. Yes
@cleardb@ to clear values from the key value store starting with the specified key. e.g. @cleardb@[slots.] will remove all values with the key starting with slots. Yes
@token@ parse strings like @target@ does with message parameters. e.g. @token@[3| |one two three] will return three. Arguments are word index|separator|search string Yes


Custom API Examples (These are free to use, however they aren't guaranteed to be working 100%):

You can find more API Examples Here.



Command Description Example(s)
!checkmeDisplays info of the user executing the command@user@ / VIP rank: @viprank@ / Stream rank: @streamrank@ / Next rank: @nextrank@ in @hrstolevelup@ hours / Hours watched: @hours@ / Joined stream: @joindate@ / Follow date: @followdate@
!currentfollowersGrab current number of total followersCurrent number of followers: @customapi@[http://customapi.deepbot.tv/totalfollows/expertsonline]
!deathcountAdd deaths to the counterDeath count: @counter@
!randomuserSelects a random user in the channelViewer: @randomuser@
!riggedUse @target@ or @user@Life ain't fair @user@, deal with it.
!slapUse @target@[1]@user@ slapped @target@[1] while @target@[2] watched.
!songrequestUse an alias for !requestsong!requestsong @target@
!startarenaUse an alias and @target@[1]!startarena @target@[1] @target@[2]
!steamGrabs Steam profile info@steam@[@target@]
!timeGrabs your local timeCurrent time: @time@ or @time24@
!titleGrabs the title of the stream and the game being played@title@ playing @game@
!uptimeDisplays the stream's uptimeCurrent uptime: @uptime@ or @uptime2@
!weatherDisplays the current weather for the location specified@weather@[@target@[1], @target@[2]]