Custom edit command

Hi guys,
I saw a streamer who has a count of matches for tournaments and I want to make one similar but I can’t figure out how they did it. For example when someone types !match it comes up with Match 3/6 solo cash cup :FortOne :FortOne. And if a mod types !m Match 4/6 solo cash cup it update !match to say Match 4/6 solo cash cup :FortOne :FortOne. Does anyone know how to do this?

Not 100% sure but sounds like he’s using a CustomAPI, which is where Nightbot sends and/or receives data from a website. I MAY be wrong but I don’t think NB itself can “save” text data for later use.

Basically “a” way it can be done is that the !m command sends the text data to the website and the !match command retrieves that same data any time until it is updated again.

If anyone knows of a way that NB itself saves data then please correct me !

Yes i think ur correct. Tim for ChatGPT to write some code XD

UGH @ “ChatGPT to write some code” :rofl:

to do this u just need to alias a mod command to the !command command… like for your example it would be…

edit !match $(query) :FortOne :FortOne

in the !m command and aliased to !command

1 Like

So it would edit the other command and store the data in that ?

yup, it sure would… actually blew my mind when i first learned this way of using nightbot XD

i first saw it for a count command, where the mod command had $(count) in it and the everybody command was edited to be able to show the count without increasing it

1 Like

Well I certainly hadn’t thought of it !! Nice :slight_smile: :+1:

how do u add !m as a alias to !command?
I cant even see a command called !command

it’s the first one on the list… my bad, i forgot the “s” on the end

1 Like

image

1 Like

I’m pretty sure I’ve covered a similar topic before, but I can’t find the link to the post.
While the responses solve the issue in my opinion, we can slightly improve on the !m command by automating it so your mods don’t have to enter anything upon calling the command:

$(eval let c = (parseInt('$(count)') % 6) + 1; `Match ${c}/6 solo cash cup :FortOne :FortOne`;)

That way it’ll constantly loop between 1 and 6.

1 Like

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