A little problem with adding a $(countdown) to an existing command

Hello!
So I have a !nextstream command to let people know exactly when the next stream is gonna happen, and I figured if I add a mod-only !setstream command I can change the countdown without any hassle, so it would look like this:
Examples:
!commands add !setstream -ul=moderator -a=!commands edit !nextstream The next stream is planned in $(countdown $(query) US/Eastern)

!setstream July 4 2017 8 pm
!nextstream: The next stream is planned in 2 hours, x minutes, bla bla

The problem is that command is embedding the actual “countdown output” to the !nextstream command, instead of adding the variable itself, so !nextstream will give you a countdown reflecting the date you set with !setstream, but it will basically be frozen, because it only updated when you did !setstream date…

My question is: is there any way I can add the $(countdown) variable to an existing command without it baking the output outright? if that makes sense?

Thanks a ton in advance!

You would need to do some hacky text manipulation so Nightbot doesn’t parse it:

$(eval "$" + "(countdown")
1 Like

Oh cool! So something like this maybe?

!commands add !setstream -ul=moderator -a=!commands edit !nextstream The next stream is planned in $(eval “$” + “$(countdown $(query) US/Eastern)”)

If you remove the $ before the ( like in my example that should work.

1 Like

Oh that’s right, that was dumb of me, it’s what’s making the hack work in the first place.

Thanks so much @night!

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