Custom Stream Chat Commands

Stream chat bots like Nightbot and StreamElements can be a very powerful tool. You can set up commands so that the one command can do multiple things. This can keep your command list tidy such as only having one weather command instead of two.

Here are some useful commands, all are for Nightbot unless specified.

Weather

Have your current weather details or anywhere else in the world.

Command: !weather
Command use: !weather (location)

$(eval if(!`$(query)`){`$(weather Adelaide)`}else{`$(weather $(query))`})

Output

Weather for Adelaide: Conditions are Sunny with a temperature of 66F (19C). The wind is blowing from the SW at 9mph (14km/h) and the current humidity is 41%.

By default this command will grab the details for Adelaide, South Australia. Change to whatever location you like. You can also specify a more precise location if the default is not what you are after.

!weather Croydon will do Croydon in the United Kingdom.
!weather Croydon, SA will do the suburb Croydon in South Australia.
!weather Croydon, Vic will do the suburb Croydon in Victoria.

More info at https://docs.nightbot.tv/variables/weather 

Twitch Account Creation Date

Command: !created
Command use: !created (username)

By default the command will do your own Twitch account linked to Nightbot otherwise add a username and the details of that account will be the response.

$(eval if(!`$(query)`){`$(twitch $(channel) "The Twitch account {{displayName}} was created on {{createdAt}}.")`}else{`$(twitch $(touser) "The Twitch account {{displayName}} was created on {{createdAt}}.")`})

Output

The Twitch account Didz was created on Mon Jun 09 2014 18:12:29 GMT+0000 (Coordinated Universal Time).

Twitch Channel Statistics

Use this if you only want the statistics to work on your channel only.

Command: !stats

$(twitch "{{displayName}}")'s statistics: $(twitch $(channel) "{{viewers}} viewers, {{views}} views and {{followers}} followers").

If you want to query other channels use the following code.

$(eval if(!`$(query)`){`$(twitch "{{displayName}}")'s Twitch statistics: $(twitch $(channel) "{{viewers}} viewers, {{views}} views and {{followers}} followers")`}else{`$(twitch $(query) "{{displayName}}'s Twitch statistics: {{viewers}} viewers, {{views}} views and {{followers}} followers")`})

Output

!stats
Nightbot: Didz's statistics: 0 viewers, 490 views and 59 followers

!stats forgotten_vcr
Nightbot: FORGOTTEN_VCR's statistics: 292 viewers, 146,088 views and 12,027 followers

Twitch Multistream Link.

Command: !multi
Command use: !multi (username)

$(eval if(!`$(query)`){`Please enter 1 or more usernames after the command ( !multi username username username )`}else{`You can watch our stream at the same time right at this link!! https://www.multitwitch.tv/`+`$(query)`.split(' ').reduce((acc, e) => (!e) ? acc : acc += `/${e}` ,`$(channel)`)})

Time and Date

By default Nightbot returns the time in the American format. This command will display the time correctly for Australian streamers. 

Command: !time (also consider the alias !date)

It is currently $(time Australia/Adelaide "dddd [the] Do [of] MMMM YYYY [at] h:mm:ss A [in Adelaide, South Australia.]")

For StreamElements use this code and edit where necessary: 

It is currently ${customapi.https://decapi.me/misc/time?timezone=Australia/Adelaide&format=g:i%20A%20\o\n%20l%20jS%20F%20Y} in Adelaide, South Australia where ${user} is.

Output

Nightbot: It is currently Monday the 8th of November 2021 at 1:52:17 PM in Adelaide, South Australia.
StreamElements: It is currently 1:47 PM on Monday 8th November 2021 in Adelaide, South Australia where Didz is.

The time format used is: 

g:i A \o\n l jS F Y

https://decapi.me/misc/time?timezone=Australia/Adelaide&format=g:i A \o\n l jS F Y
https://decapi.me/misc/time?timezone=Australia/Adelaide&format=g:i%20A%20\o\n%20l%20jS%20F%20Y

See more information and get your time zone at https://docs.nightbot.tv/variables/time 

Twitch Stream Uptime

Command: !uptime

Stream uptime: $(twitch $(channel) "{{uptimeLength}}")

Steam Profile Details

Command: !steam
Command use: !steam (username)

$(eval if(!`$(query)`){`$(steam Badooleoo "{{name}} is {{status}}: {{gameName}} - {{profileUrl}}")`}else{`$(steam $(query) "{{name}} ({{realName}}) is {{status}}: {{gameName}} - {{profileUrl}}")`})

Output

Didz is Offline: [not playing a game] - https://steamcommunity.com/id/badooleoo/

Replace "Badooleoo" with your own Steam username. !steam will bring up your own details while !steam (username) can retrieve the details of any other Steam profile if they have made their profile public.

Xbox Live Profile Details

Command: !xbl (or use !xbox if you would like)
Command use: !xbl (gamertag)

$(eval if(!`$(query)`){`$(xbl badooleoo)`}else{`$(xbl $(1))`})

Output

Badooleoo has a gamerscore of 1460 and is currently offline. They were last active on 2021-02-04T17:36:08.313Z playing undefined.

Replace "badooleoo" with your own Xbox Live gamertag . !xbl will bring up your own details while !xbl (gamertag) can retrieve the details of any other Xbox Live profile if they have made their profile public.

YouTube Latest Video

Command: !ytlatest (or !youtubelatest)

$(twitch didz "{{displayName}}") latest YouTube video: $(urlfetch https://decapi.me/youtube/latest_video?user=badooleoo)

For StreamElements use

${user}'s latest YouTube video: ${customapi.https://decapi.me/youtube/latest_video?user=badooleoo}

Output

Didz's latest YouTube video: TVC - Harris Scarfe (1992) - https://youtu.be/Y0smBmvGkWQ

Replace "badooleoo' with your YouTube URL.

DuckDuckGo Search

Command: !ddg
Command use: !ddg (search term)

$(eval if(!`$(query)`){`Please enter your DuckDuckGo search ( !ddg <search> )`}else{r=["Too lazy to open a new tab? Here let me do it for you:","DuckDuckGo activated! Generating URL!","Let me make you a link so you can just click it and be over with it. Here you go:"];(r[ Math.floor(Math.random() * r.length) ])+"  https://duckduckgo.com/?q=$(querystring)"})

Output

!ddg

Please enter your search ( !search <search> )

!ddg The Internet

Let me make you a link so you can just click it and be over with it. Here you go: https://duckduckgo.com/?q=The%20Internet

Google Search

Command: !google
Command use: !google (search term)

$(eval if(!`$(query)`){`Please enter your search ( !google <search> )`}else{r=["Too lazy to open a new tab? Here let me do it for you:","Google Service Activated! Generating URL!","Let me make you a link so you can just click it and be over with it. Here you go:"];(r[ Math.floor(Math.random() * r.length) ])+" https://www.google.com/search?q=$(querystring)"})

Output

!ddg

Please enter your search ( !search <search> )

!ddg The Internet

Let me make you a link so you can just click it and be over with it. Here you go: https://www.google.com/search?q=The%20Internet