From 0ff67042067c00e304f670b2793b158c3aba43bd Mon Sep 17 00:00:00 2001 From: phxntxm Date: Sat, 2 Dec 2017 16:21:39 -0600 Subject: [PATCH] Add a coinflip command --- cogs/misc.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cogs/misc.py b/cogs/misc.py index 514d7b8..bf1c4e7 100644 --- a/cogs/misc.py +++ b/cogs/misc.py @@ -109,6 +109,18 @@ class Miscallaneous: await ctx.send(embed=embed) + @commands.command(aliases=["coin"]) + @utils.custom_perms(send_messages=True) + @utils.check_restricted() + async def coinflip(self, ctx): + """Flips a coin and responds with either heads or tails + + EXAMPLE: !coinflip + RESULT: Heads!""" + + result = "Heads!" if random.SystemRandom().randint(0, 1) else "Tails!" + await ctx.send(result) + @commands.command() @utils.custom_perms(send_messages=True) @utils.check_restricted()