1
0
Fork 0
mirror of synced 2024-06-03 03:04:33 +12:00

Use better jokes

This commit is contained in:
phxntxm 2017-05-02 19:29:14 -05:00
parent 84746e23bb
commit e4ef3c075b

View file

@ -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)