Does anyone know how to add a API or something so it can print a random joke. c:
@8ryn8ryn you can use this code to get random jokes and their answers.
import requests import json page = requests.get('https://official-joke-api.appspot.com/random_joke') jokesource = json.loads(page.content) joke = jokesource['setup'] print(joke) answer = jokesource['punchline'] print(answer)
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!