Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import discord
from discord.ext import commands
import random
import requests
""" THIS CODE IS NOT OURS CODE IT'S FROM THE INTERNET """
"""Source of the code: https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be """
class JokesCog:
def __init__(self, client):
self.client = client
@commands.command()
async def jokes(self, ctx):
# Using api.chucknorris.io/jokes API
url = 'https://safe-falls-22549.herokuapp.com/random_joke'
res = requests.get(url)
data = res.json()
setup = data['setup']
punchline = data ['punchline']
await ctx.send (data['setup'])
await ctx.send (data['punchline'])
def setup(client):
client.add_cog(JokesCog(client))