Code Cleanup
This commit is contained in:
parent
d2622e25e8
commit
fa34f8510d
13 changed files with 98 additions and 50 deletions
|
@ -1,18 +1,23 @@
|
|||
'''
|
||||
Flips a coin.
|
||||
Will probably reworked into a "games" cog to
|
||||
hold more interactive commands
|
||||
'''
|
||||
import discord
|
||||
import random
|
||||
from discord.ext import commands
|
||||
|
||||
class Coinflip(commands.Cog):
|
||||
|
||||
def __init__(self, client):
|
||||
def __init__(self, client: discord.Client):
|
||||
self.client = client
|
||||
|
||||
@commands.command(name="coinflip", description="Flips a coin and reacts with the result", aliases=["coin", "flip"])
|
||||
async def coinflip(self, ctx):
|
||||
async def coinflip(self, ctx: commands.Context):
|
||||
if random.randint(0, 1) == 0:
|
||||
await ctx.message.add_reaction("🌑")
|
||||
else:
|
||||
await ctx.message.add_reaction("🌕")
|
||||
|
||||
def setup(client):
|
||||
def setup(client: discord.Client):
|
||||
client.add_cog(Coinflip(client))
|
Loading…
Add table
Add a link
Reference in a new issue