How to manually edit Nightbot counter command & change count?

Asked Jul 27, 2022·6 replies·Last activity 4 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 all! Let me preface this by saying I am pretty new to Nightbot's workings and you may have to really explain this to me in painful detail.

I currently have a few commands that work off of a counter. These all work perfectly!
!killed (for viewers to see how many kills I got)
!killed+ (for VIPs and Mods to add 1 kill to the counter)
!killedreset (for Mods to reset the count totally back to 0.)

I'd really love to have a way to allow one of my mods to edit the current kill count displayed in the counter during the !killed command, in case someone accidentally adds to it incorrectly. I don't want to have to reset it totally, especially if the counter is really high in number at that point. I'd hate to have my mods spam !killed+ in the chat 67 times, if the counter should be at 67, for example.

When I try to plug in the following commands in my Twitch chat, Nightbot does not respond at all. Not sure if I'm doing something wrong, but these were the only workarounds I found online.

!editcom edit !killed -c=0
!commands edit !killed -c=0

Please let me know what I'm doing wrong here! Again, just want to have a way to manually adjust the counter to display a different number. I'm not sure if this can only be done via Twitch Chat, or if there's a way to create a new command like !killededit that would let me or my mods edit the counter that way.

If you need further information from me, please let me know. Thank you in advance for your help!

6 replies

Breezy Narwhal said:
I’d hate to have my mods spam !killed+ in the chat 67 times, if the counter should be at 67, for example.

I know that this command here (link expired) lets you add any number you like so you don't have to type the add command multiple times to get a certain number.

Hey @Breezy Narwhal!

You can have a !setkilled command, like so (if you add it from the chat):

!addcom !setdkilled -ul=mod -a=!editcom !killed+ \-c=$(eval $(1)-1)

And once you called !setkilled you need to call !killed+.

Similar commands.

Thank you both for your help!

@Polar Cat: For some reason when I go in to my Twitch chat and type !addcom !setdkilled -ul=mod -a=!editcom !killed+ \-c=$(eval $(1)-1) nothing happens. I don't get a reply from Nightbot and the command is not added. Nightbot is set as a mod, and my channel is added to the Nightbot site; do you know if there's anything else I need to do on my end to set this up?

After weighing all the amazing suggestions, I went with this one and modified the commands at the link you provided with my own tokens. It's perfect and exactly what I wanted. Thank you so much!

You're amazing, that's what I forgot to do!!

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

Ask on Discord