aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/seasons/evergreen/fun.py22
1 files changed, 7 insertions, 15 deletions
diff --git a/bot/seasons/evergreen/fun.py b/bot/seasons/evergreen/fun.py
index ebc10fca..afe70462 100644
--- a/bot/seasons/evergreen/fun.py
+++ b/bot/seasons/evergreen/fun.py
@@ -15,22 +15,14 @@ class Fun:
self.bot = bot
@commands.command()
- async def roll(self, ctx, str_input: str = None):
+ async def roll(self, ctx, num_rolls: int):
output = ""
-
- if not str_input:
- output = "To use .roll, format it as such: .roll (number)"
- else:
- try:
- num_rolls = int(str_input)
- if num_rolls > 6:
- num_rolls = 6
- elif num_rolls < 1:
- return
- for i in range(num_rolls):
- output += ":terning%d: " % random.randint(1, 6)
- except ValueError:
- return
+ if num_rolls > 6:
+ num_rolls = 6
+ elif num_rolls < 0:
+ output = ":no_entry: You must roll at least once."
+ for _ in range(num_rolls):
+ output += ":terning%d: " % random.randint(1, 6)
await ctx.send(output)