Hello, I mod for a few streamers, and a couple of them have users that love to do the "uptime" command at 4 hours and 20 minutes into the stream. Is there a way that we can have the command say something different if the uptime is between 4:20:00 - 4:20:59 (I can come up with the verbiage later).
Custom response for the uptime command
3 replies
Hey @Chilly Ladybug!
Yes you can, you just need to use JavaScript!
$(eval t = '$(twitch $(channel) "{{uptimeLength}}")'; t.includes('4 hours 20 minutes') ? 'SPECIAL_MESSAGE' : t;)
If your SPECIAL_MESSAGE contains apostrophes (') you need to "escape" them by putting a backslash (\) before them, for example: That\'s cool!
Not sure why you get an error, but you can simply replace the very last t with `` YOUR_REGULAR_MESSAGE ${t} `, so according to your example: ` $(user) Streamer has been live for ${t} ``.
In context:
$(eval t = '$(twitch $(channel) "{{uptimeLength}}")'; t.includes('4 hours 20 minutes') ? 'SPECIAL_MESSAGE' : `$(user) Streamer has been live for ${t}`;)