Use better jokes
This commit is contained in:
parent
84746e23bb
commit
e4ef3c075b
16
cogs/misc.py
16
cogs/misc.py
|
@ -258,17 +258,11 @@ class Miscallaneous:
|
||||||
|
|
||||||
EXAMPLE: !joke
|
EXAMPLE: !joke
|
||||||
RESULT: An absolutely terrible joke."""
|
RESULT: An absolutely terrible joke."""
|
||||||
# Use the fortune riddles command because it's funny, I promise
|
joke = await utils.request('http://tambal.azurewebsites.net/joke/random')
|
||||||
fortune_command = "/usr/bin/fortune riddles"
|
if joke is not None and 'joke' in joke:
|
||||||
while True:
|
await ctx.send(joke.get('joke'))
|
||||||
try:
|
else:
|
||||||
fortune = subprocess.check_output(
|
await ctx.send("Sorry, I'm not feeling funny right now...try later")
|
||||||
fortune_command.split()).decode("utf-8")
|
|
||||||
await ctx.send(fortune)
|
|
||||||
except discord.HTTPException:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
@utils.custom_perms(send_messages=True)
|
@utils.custom_perms(send_messages=True)
|
||||||
|
|
Loading…
Reference in a new issue