Pastebin command

I’m trying to get a command working with a created Pastebin that I have already which allows users to select a random lines in the Pastebin but also allows specific users to be able to choose specific lines.


What does your paste look like? Also, how do you plan to allow those specific users to choose specific lines? An example usage I’m thinking of is:

!commandname [position in which the line appears in the list]

$(eval notes = “$(urlfetch json “.split(”;”); notes[Math.floor(Math.random() * (notes.length - 1))])

This is the current command and idk anything that will allow me to setup a specific line.

The only thing that separates the lines is the ; from the code .split(";")

I was thinking a separate command for quotes that runs off the same pastebin for mods or something

This will allow mods to enter a line number to get a specific number. If no number is specified or the user isn’t a mod, it’ll output a random line.

$(eval r=x=>x[Math.floor(Math.random()*x.length)];a=`$(urlfetch json`.split(`;`).filter(a=>a);[`moderator`,`owner`].includes(`$(userlevel)`)?a[parseInt(decodeURIComponent(`$(querystring)`),10)-1]||r(a):r(a))

Works like a charm ty

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