Trying to setup a custom way to edit command

I am a mod and I was watching a streamer who was playing a tournament and after every game they would edit there !match command by using !x and say they where going into the 5th game they would do !x 5/7 and then nightbot would say this is match 5/7. I was wondering how to set this up

Hey @Riot_FC!

This is relatively easy, all you need a command to edit the command that displays which match you’re at, so:

!addcom !match This is match 0/7

!addcom !setmatch -ul=mod -a=!editcom !match This is match $(query)

When you call !setmatch 5/7, this will edit !match’s content to say “This is match 5/7”

Now if you want something a bit more automated, let’s say you always have 7 matches, you can make it so you only need to call the editing command without specifying the match number you’re in, so no more !setmatch 5/7, you have two options, the first without a reset:

!addcom !setmatch -ul=mod -a=!editcom !match $(eval `This is match ${$(count) % 7 + 1}/7`)

The match value will go from 1/7 to 7/7 and loop around.

Or with a reset at 0/7:

!addcom !setmatch -ul=mod -a=!editcom !match $(eval `This is match ${$(count) % 8}/7`)

The match value will go from 0/7 to 7/7 and loop around.

You may need to call !setmatch a few times to get it to 1/7 or 0/7 first, alternatively you can edit the $(count) value in the dashboard to 7 or 8 respectively.

If you wish to understand how I picked the seemingly “magic numbers,” I suggest reading on the remainder operator.

1 Like

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