Custom edit command

Asked Dec 3, 2023·11 replies·Last activity 2 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

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?

11 replies

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" 🤣

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

js
edit !match $(query) :FortOne :FortOne

in the !m command and aliased to !command

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

Well I certainly hadn't thought of it !! Nice 🙂 👍

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

image.png

it's the first one on the list... my bad, i forgot the "s" on the end

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.

Didn't find your answer? The community is on Discord.

Ask on Discord