An !uptime Command Using Emotes

Hello! Is there any way to make a command that does the same thing as !uptime (shows the uptime of the stream), but instead of using the numerals 0-9, has Nightbot replace each number with an emote? My intent is to make a !puptime command that gives the uptime, but displays the time with dog emotes. For example, if RalpherZ was 0, FrankerZ was 1, and OhMyDog was 2 and the stream has been up for 1 hour and 20 minutes, NightBot would respond to !puptime with "The stream has been live for FrankerZ hours and OhMyDog RalpherZ minutes.
How would I go about implementing this? I’m not versed in custom Nightbot commands at all, so please excuse my ignorance!

@chrismas95

There are 10 numbers from 0 to 9, so there is an array of 10 emote names at the beginning of the code that looks like this:

a=[`RalpherZ`,`FrankerZ`,`OhMyDog`,`emote4`,`emote5`,`emote6`,`emote7`,`emote8`,`emote9`,`emote10`];

What follows is the command setup you can copy and paste into chat. Look for the array I mentioned above. I’ve already set the names of the first 3 emotes to RalpherZ, FrankerZ, and OhMyDog. All you have to do is replace the rest of the emote names before adding the command.

!addcom -cd=5 !puptime $(eval a=[`RalpherZ`,`FrankerZ`,`OhMyDog`,`emote4`,`emote5`,`emote6`,`emote7`,`emote8`,`emote9`,`emote10`];b=`$(twitch $(channel) "The stream has been live for {{uptimeLength}}.")`.split(``);for(i=0;i<b.length;i++){c=parseInt(b[i]);if(Number.isInteger(c)){b[i]=` ${a[c]} `;}}b.join(``);)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.