Hey there, im trying to create a custom command for my channel. It’s a pick 5 random names command.
i was able a make a version where it picked one, but i want to increase it where it picks 5 names at once instead. i tried repeating the code 5 times in the command but it was too long. is this possible?
First we’ll need to fix your paste, because otherwise you’re going to have issues down the line, it’ll also allow us to remove the .split(), it’s not needed.
If you want to keep the current shape of it, all you need to do is to replace the backticks ` with double quotes: ", you can easily do so with your notepad, use the Find and Replace feature. In the end, it should look like this:
["NAME_1",
"NAME_2",
// ...
"LAST_NAME"]
there’s a quote missing on line 224 of your paste, make sure to add it.
I also assume you want to avoid duplicates, so here’s how to write such command:
Thank you so much. I did the changes as you suggested into a new paste so i can see the difference, and it works like a charm. I also noticed i can change { length: 5 } to adjust the number of picks I want. Thanks again, amazing work.