aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gustav Odinger <[email protected]>2020-10-04 23:30:47 +0200
committerGravatar Gustav Odinger <[email protected]>2020-10-04 23:30:47 +0200
commit6969fc1973261bcba51b7346c8e168bcc011b833 (patch)
tree2ac9033caa99dfa98810e0730050b97a98830c78
parentAdd space between dice in roll command (diff)
Revert and update roll command
- Returns to previous version of code - Improves readability - Adds spaced between dice
-rw-r--r--bot/exts/evergreen/fun.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/bot/exts/evergreen/fun.py b/bot/exts/evergreen/fun.py
index 9d6ee29c..23715906 100644
--- a/bot/exts/evergreen/fun.py
+++ b/bot/exts/evergreen/fun.py
@@ -60,13 +60,15 @@ class Fun(Cog):
@commands.command()
async def roll(self, ctx: Context, num_rolls: int = 1) -> None:
"""Outputs a number of random dice emotes (up to 6)."""
+ output = ""
if num_rolls > 6:
num_rolls = 6
-
- dice = (f"dice_{random.randint(1, 6)}" for _ in range(num_rolls))
- output = " ".join(getattr(Emojis, die, '') for die in dice)
-
- await ctx.send(output or ":no_entry: You must roll at least once.")
+ elif num_rolls < 1:
+ output = ":no_entry: You must roll at least once."
+ for _ in range(num_rolls):
+ dice = f"dice_{random.randint(1, 6)}"
+ output += getattr(Emojis, dice, '') + " "
+ await ctx.send(output.rstrip())
@commands.command(name="uwu", aliases=("uwuwize", "uwuify",))
async def uwu_command(self, ctx: Context, *, text: clean_content(fix_channel_mentions=True)) -> None: