Can commands interact with each other and, if so, how?

Hello! I was setting up some commands for a friend of mine and wanted to have two commands interact.
Command 1 was along the lines of "@user@ did a thing! This has been done @cnt@ times now!"
I wanted Command 2 to pull the @cnt@ variable from command 1 and then reset that number after it was used. Can this be done?

We just added command aliases to the Nightbot beta, which will allow you to reset command counts using another command. Unfortunately it’s not possible to retrieve the count from a separate command (this might be possible in the future, since we have some plans for even more extensive variables).

To add the hug counting command:

!commands add !hug /me hugged $(user)! This has been done $(count) times now!

To add the reset counter command:

!commands add !resethugs -a=!commands edit !hug \-c=0

So, !hug would result in:

nightbot hugged night! This has been done 1 times now!

and !resethugs would result in:

nightbot: Night -> The command "!hug" has been edited successfully.

Thanks for the help! Would it be possible as of whatever version is currently available to make nightbot say something specific when the command is reset?
I wanted the reset command’s message to piggyback off of the first command’s message.

Unfortunately that’s not a possibility at this time, sorry. The solution provided utilizes command aliases, which just allows you to call a separate command within a command with custom parameters.

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