This version is outdated by a newer approved version.DiffThis version (2021/01/03 22:20) is a draft.
Approvals: 0/1

This is an old revision of the document!


On this page you will find all the variables that are currently available to use in your custom commands.
Currently, there are over 80 different 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 cost to execute the custom command. 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@]. Yes
@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. Yes
@slabspoints@[check|@user@] Command to get the points on the Stream Labs platform. Yes
@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. Yes
@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. Yes
@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@ Returns everything that has been entered after the command No
@target@[x] Returns what has been entered at a specific location after the command. x is the position (starting at 1) of the word you would like to return. No
@target@[x|y] Returns what has been entered after the command between a specific range. x is the starting position and y is the ending position. The first position is always 1 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@[operator|x|y] Returns a number depending on the operator used and the numbers (x and y) provided. Operators that can be used are; + (Addition: x + y), - (Subtraction: x - y), *(Multiplication: x * y), / (Division: x / y), % (Percentage: x% of y), mod (Modulus: remainder of x / y) 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. Can also add if_discord if_chat or if_whisper to the the command as well. So @exec@[5,if_discord,!botdisord] @exec@[5,if_chat,!botchat] this can then run a different command if its trigger buy someone in twitch chat or discord. 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]. Please see LookupInfo Variables for more information. 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@[index|separator|search string] Like @target@ except returns the position based on the separating character (| cannot be used for the separating character in any instance). Example: @token@[3|,|one,two,three] would return three. Yes
@stream@ Return the streamer username that is currently connected to Deepbot (Not the Bot Name) No
@streamid@ Return the user ID of the streamer account currently connected to Deepbot (Not the Bot Name) No
@queuepos[Queue Position|Queue Number] Returns the viewer's username that is currently in the queue position stated. If no viewer is currently in that position, this will return blank No
@queuepos[Username|Queue Number] Returns the provided viewer's position in the specified queue. No
@queuewait@[Queue Position|Queue Number] Returns the current wait time of the viewer that is current at the stated queue position. No
@queuewait@[Username|Queue Number] Returns the provided viewer's current wait time in the specified queue. No
@toppoints@[X] Returns a list of the viewers that hold the most amount of points/currency in your channel. X can be a number between 1 and 14. No
@topranks@[X] Returns a list of the viewers that hold the highest ranks in your channel. X can be a number between 1 and 14. No

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 the discord channels you have set in the “Broadcast Channels” text box 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 channel=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

@LookupInfo@ is an example of a custom variable that can return multiple pieces of information about a viewer. In order to facilitate this, the use of additional variables are required.
These can be found in the below table.
For example, to return the battletag the user that triggered the command has set up you would put @lookupinfo@[@l_btag@,@user@] into the custom message box.

Variable Description Lookupinfo Example
@l_btag@ Show the battle tag for the user. @lookupinfo@[@l_btag@,@user@]
@l_followdate@ Displays the date the user followed the channel. @lookupinfo@[@l_followdate,@user@]
@l_hours@ Total number of hours the user has been watching the stream. @lookupinfo@[@l_hours,@user@]
@l_lastseen@ Shows when the user was last seen talking in the channel. @lookupinfo@[@l_lastseen@,@user@]
@l_user@ Displays the username of the person who executed the command. @lookupinfo@[@l_user@,@user@]
@l_intpoints@ Pulls points without the thousands separator. @lookupinfo@[@l_intpoints@,@user@]
@l_joindate@ Displays the date the user joined the channel. @lookupinfo@[@l_joindate@,@user@]
@l_streamrank@ Displays the user's stream rank. @lookupinfo@[@l_streamrank@,@user@]
@l_hrstolevelup@ Number of hours until the user reaches the next stream rank. @lookupinfo@[@l_hrstolevelup@,@user@]
@l_pointstolevelup@ Number of points until the user reaches the next stream rank. @lookupinfo@[@l_pointstolevelup@,@user@]
@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] @lookupinfo@[@l_userclass@,@user@]
@l_nextrank@ Shows the next stream rank. @lookupinfo@[@l_nextrank@,@user@]
@l_viprank@ Displays the VIP rank of the user. @lookupinfo@[@l_viprank@,@user@]

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]]