Can a command that accepts a variable be used to edit another command?

I’ve been trying to make a command edit another command and use the variable I pass to the first command to determine the 2nd commands text. So far all I’ve managed to do is convince nightbot to repeat the initial command without the changes being made.

My current attempt:
!bc - The current Battle Class is less than 1.9k
!setbc - !editcom !bc The current Battle Class is less than $(1)

Any assistance would be appreciated. ^^

You can do this easily in the beta using aliases: Can commands interact with each other and, if so, how?

In the above link, the reset command sets to 0, but you can easily replace the 0 with $(1)

Mmm, I’ve tried this too, still can’t get it to work

!editbc: !commands edit !bc The current battleclass is $(1)
Result: Nightbot: !commands edit !bc The current battleclass is 10k

!editbc: !commands edit !bc -a=The current battleclass is $(1)
Result: Nightbot: !commands edit !bc -a=The current battleclass is 10k\

!editbc: !commands edit !bc -a=The current battleclass is \c=$(1)
Result: Nightbot: !commands edit !bc -a=The current battleclass is under -c=10k

The commands you’re using are not correct. Try the following:

!commands add !bc The current Battle Class is less than 1.9k

!commands add !setbc -ul=moderator -a=!commands edit !bc The current Battle Class is less than $(1)
1 Like

mrrm doesn’t seem to work… When I try typing exactly what you suggested I got:
!commands add !setbc -ul=moderator -a=!commands edit !bc The current Battle Class is less than $(1)
Nightbot: the_urgist -> The bot commands for this channel are available at http://nightbot.tv/commands/the_urgist

When I edited the command via the console to be !commands edit !bc The current Battle Class is less than $(1) it was accepted, however running the command !setbc 4.5k results in:
Nightbot: !commands edit !bc The current Battle Class is less than 4.5k

You should copy and paste the commands I gave you into your channel’s chat. You should not paste them into the control panel. I have already verified that these commands function, so if it’s not working then you’re inputting something improperly.

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