Fixed roll command

This commit is contained in:
Nicba1010 2018-02-21 14:23:43 +01:00
parent f89805ec07
commit 205b55d506

6
bot.py
View File

@ -306,8 +306,8 @@ async def latest(ctx: Context):
# User requests
# noinspection PyMissingTypeHints,PyMissingOrEmptyDocstring
@bot.command(pass_context=True)
async def roll(*args):
@bot.command()
async def roll(ctx: Context, *args):
"""Generates a random number between 0 and n (default 10)"""
n = 10
if len(args) >= 1:
@ -315,7 +315,7 @@ async def roll(*args):
n = int(args[0])
except ValueError:
pass
await bot_channel.send("You rolled a {}!".format(randint(0, n)))
await ctx.channel.send("You rolled a {}!".format(randint(0, n)))
# noinspection PyMissingTypeHints,PyMissingOrEmptyDocstring