$(uptime)
- Syntax
$(uptime [username])- Arguments
- Optional
The $(uptime) variable displays how long a channel’s current stream has been live.
Use it
Section titled “Use it”!command add !uptime The stream has been live for $(uptime)To use the $(uptime) variable, simply include it in a custom command or message. You can optionally specify a username to check the uptime for a particular streamer.
$(uptime [username])Output
Section titled “Output”The duration is written out in full words: secs, mins, hours, days — for example 2 hours 15 mins or 45 mins. When the channel is offline, the variable outputs <not live> instead.
Examples
Section titled “Examples”Check uptime for a specific streamer:
!command add !shroud shroud has been live for $(uptime shroud)Parameters
Section titled “Parameters”username(optional): The name of the streamer whose uptime you want to check. If omitted, the variable will default to the current stream’s uptime. Cross-channel lookups are supported on Twitch.
Related Variables
Section titled “Related Variables”$(game): Displays the current game being played on the stream$(title): Shows the current stream title
Q: Will $(uptime) work for offline channels?
A: No, the $(uptime) variable only works for currently live streams. For offline channels, it outputs <not live>.
Q: Can I customize the uptime format?
A: The default format spells out the units, e.g. “2 hours 15 mins”. While you can’t directly change this format within the variable, you can create custom commands that parse and reformat the output as needed.