Ask coding questions

← Back to all posts
Jokes!
brynisaweeb

Does anyone know how to add a API or something so it can print a random joke. c:

Voters
IdhantOMG
Nettakrim
intriguing-
brynisaweeb
Comments
hotnewtop
adl212

@8ryn8ryn you can use this code to get random jokes and their answers.

Since this is a discord bot and you are using client, you are going to replace the print functions with await message.channel.send(#content). Upvote and choose this as the correct answer if it is!

rediar

search up "joke api" if there isnt one, you can consider webscraping, however if thats too advanced just put your own jokes in an array, and write a function to randomly select one.

brynisaweeb

@rediar Thanks ill do that c:

Coder100
ParthRangarajan

Hey could you help with that?
I'm having a tough time navigate through the json although the documentation is pretty [email protected]