Creating commands involving modified lists

You’re very welcome :slight_smile: Always glad to be able to help when I’ve gotten a ton of help from people around here!

As an added note, if you want to save up on even more characters, you could always shorten the variables (wrong / correct) to something like w and c (everywhere you see wrong you replace it with w, then the same with correct).

Lastly, as I understand it Javascript is case sensitive, so if you define an “admin” in that command like Billy or Bob, that’s exactly how users will have to type it out as well, with the first letter also in capitals. So it may be a good idea to make the names fully lowercase? Up to you really!

Edit: And testing the command on Discord right now… I’m not even sure you need the .trim bit lol…

Example with all 3 changes applied:
!addcom !admin $(eval var w = ["Admin not found."]; var c = ["$(twitch $(query))"]; '$(query)' == 'billy' || '$(query)' == 'bob' ? (c) : (w);)

1 Like