mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-12-13 13:46:20 +00:00
Fixed roll command
This commit is contained in:
parent
f89805ec07
commit
205b55d506
6
bot.py
6
bot.py
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user