Disable command when offline

Asked May 2, 2023·3 replies·Last activity 3 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Can I set a custom command to be disabled when I'm offline on Twitch? My !song command would be it, here's the current messsage: $(user), $(lastfm erosbencee)

3 replies

Hey @Polar Cat !
Thanks for your reply. I saw that topic, but as I'm new to Nightbot it didn't make sense to me and I couldn't comment because it's closed.
Where do I have to paste that text? Here’s the current messsage for my !song command: $(user), $(lastfm erosbencee)
And why does it say "message when streaming" when the message is supposed to be sent when offline?
Please help me. Thank you in advance!

You just have to replace the MESSAGE_WHEN_STREAMING field with the response you want the bot to send when you're live, and when you're offline it'll respond saying the command is disabled, like this:

$(eval '$(twitch $(channel) "{{status}}")' === 'live' ? '$(user), $(lastfm erosbencee)' : 'This command is currently disabled.')

If you don't want any response when you're offline, you simply replace the message that says the command is disabled with a space:

$(eval '$(twitch $(channel) "{{status}}")' === 'live' ? '$(user), $(lastfm erosbencee)' : ' ')