Memes or Jokes Command

Asked Nov 23, 2020·2 replies·Last activity 5 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 I hope someone can help me

So what im thinking of is a command that when I type !meme or !joke , nightbot will send out a random joke from a list that I will be making. Also how can I put the jokes on a list that nightbot will choose.

This command would be good for those viewers that is on queue to join my games.

2 replies

Hey @Perky Pufferfish!

What you'll need to do is to create a Pastebin account (that way you can go back in later to edit the command), then create a unlisted paste with no expiration date, similar to this one.

Notice how it's structured:

Meme or joke #1;
Meme or joke #2;
Meme or joke #3;
...
Meme or joke #n

All your jokes must end by a separator, in the example it's a ; (semi-colon), but it could be anything else, like a } (closing bracket) for example, that said I don't recommend using either of these: ``,.:'"```, or any character you'd use in a regular sentence.
Also, the last joke doesn't need to be ended with the separator.

Now here's the command:

!addcom !joke $(eval j=`$(urlfetch json https://pastebin.com/raw/XXXXXXXX)`.split(`SEPARATOR`); j[Math.floor(Math.random()*j.length)];)

Replace XXXXXXXX with your paste ID, and SEPARATOR with the separator you chose to use.

Wow so detailed and precise, thank you so much! I would shake your hands if I can
Thank you so much have a good one!