Multiple randomized commands in one command

hello, new here and to all of this lol

i’m trying to get random copypasta command for my chat working and i’m probably missing something so i figured i’d ask.

i’d like to be able to type !copypasta, and have a random copypasta from a list of a handful pasted into chat. obviously your commands are limited in character number, so i tried having nightbot just type another command at rando in chat, which works, but doesn’t activate/trigger that command.

i added one to it’s alias but as far as i know a command can only have a single alias, so it just spits out the same copypasta every time now.

is there a way to do what i’m trying? or am i just being obnoxious lol

thanks in advanced!

[here’s the base of the random code i’m using currently, just tweaked a bit] !addcom nightbot $(eval a=[RESPONSE_1,RESPONSE_2,RESPONSE_3];a[Math.floor(Math.random()*a.length)])

1 Like

If you use something like pastebin you can have lots and lots of responses that can randomly be selected using $(urlfetch json) As seen with commands such as “pokemon attack”, which has well over 1000 possible responses.

If you have a smaller amount of responses then this should work:

i apologize for what is probably a dumb question lol, but how does one use pastebin?

would i be placing all my copy pasta text into a single paste, separating them with commas and such in there? or do i make a bin for each?

i apologize again, all greek to me but trying to learn a little

(and thanks!!)

[edit]: between my questions i AM tinkering and googling on my own XD not just being lazy and making someone else sort my problem, i just haven’t sorted it out myself lul

This is a place to learn and ask any question you have, so please ask away.

Yes you can put all your copypasta examples in one paste and separate each by a different key if you want.

!addcom !example $(eval responses = `$(urlfetch json RAW Pastebin link here)`.split(`Whatever you what to split each line with`); + responses[Math.ceil(Math.random() * responses.length)])

Do note that although Pastebin increases the number of possible random responses twitch still has a character limit of (i think) 500 or so words.

When you make your paste click RAW and copy the link into the command where it says “RAW Pastebin link here”

In that example i used “,” just because i stole it off Reddit a while ago and thats how it was already written :sweat_smile: but for my dad joke paste it’s split by “Q:” as seen in this code here:

!addcom !dadjoke $(eval responses = `$(urlfetch json`.split(`Q:`); `Q:` + responses[Math.ceil(Math.random() * responses.length)])

It just depends on what responses you have and how you want to split those responses yourself. I have many random lurk commands that all use “,” as a split.

ohhhh ok so i’m copying the link from the bin and not the text? and when NB spits it out it reads as text. that makes sense now

thanks you for all the help so far! i’ll tinker some more and see what i can’t come up with lol

[edit] i think i’ve got it! the “400” is a bit fiddly and not a true 400 i don’t believe as it could spit out the same text of a copypasta individually but not out of the randomizer which is odd. also, it has to be a public bin, which mine wasn’t as i had a “rage” copypasta that was sorta spicy and a Valorant one that mentioned guns a few times and pastebin isn’t a fan apparently lol

also i had some set to @ a random user in chat (i.e. "get ratio’d @‘random user here’ " and it doesn’t seem to want to do things like that. guess it makes sense as it’s a command within a command within a link lol

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