Force NightBot to not interpret a variable in a command

Hello, I’m making a command !mmr that stores broadcaster’s MMR and shows it to viewers. It supposed to be changeable by broadcaster and moderators.

For this, I made two commands, first one !mmrset.
Message:

edit !mmr Solo MMR is: $(query) (updated $(countup $(time Europe/Moscow “lll”) Europe/Moscow) ago).

Alias:

!commands

The second one is the !mmr itself.
Message:

Solo MMR is: 1234 (updated 29 seconds ago).

The problem is, that the CountUp variable being calculated at the moment I call command !mmrset - so the time “29 seconds” is static - but I need it to be evaluated every time someone calls !mmr.

I wonder if it possible to force NightBot to ignore variable CountUp in the !mmrset command, making it to set the !mmr command to something like

Solo MMR is: 1234 (updated $(countup Oct 2, 2016 10:37 PM Europe/Moscow) seconds ago).

I.e. with evaluated $(time), but not evaluated $(countup).

The best tip I can give you is it have another command to keep the time.

For example:

An uptime command that manually starts with another command.

Command to see uptime:
!commands add !uptime -a=__uptime_ x

Command to set uptime:
!commands add -a=!commands edit !uptime $(time US/Mountain "MM DD YYYY h:mm:ss a") US/Mountain

Command aliased to format everything:
!commands add __uptime_ $(channel) has been live for: $(countup $(query))

!start changes !uptime to the date format and saves it, and when !uptime is used it aliases to __uptime_ which passes the date format.

You can probably rework this to accomplish what your after. Hope this helps.

Truth be told, it’s not currently possible unless you have a fixed input size (i.e. you’re expecting a number). You would need to make $(time) output in ISO8601 format as well.

Here’s a working example:

!commands add !mmr -a=.mmrbackend 1234 2016-10-03T02:01:22+00:00
!commands add .mmrbackend Solo MMR is: $(1) (updated $(countup $(2) Europe/Moscow) ago)
!commands add !mmrset -a=!commands edit !mmr \-a=.mmrbackend $(1) $(time Etc/UTC "YYYY-MM-DDTHH:mm:ssZ")

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