Skip to content

Commit

Permalink
Revert shuffle and choice command to use comma, but make it simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
albertopoljak committed Oct 7, 2021
1 parent 156739d commit 47bd32d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bot/cogs/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,17 @@ async def randint(self, ctx, low: int = 1, high: int = 100, n: int = 1):
ctx.me, title=""))

@commands.command(aliases=["choose"])
async def choice(self, ctx, *args):
async def choice(self, ctx, *, args):
"""Returns a randomly chosen string from given arguments"""
choices = list(args)
choices = args.split(",")
if len(choices):
choice = random.choice(choices)
await ctx.send(embed=info(f"🎰 | Random choice | **{choice}**", ctx.me, title=""))
await ctx.send(embed=info(f"🎰 | Random choice | **{choice.strip()}**", ctx.me, title=""))

@commands.command()
async def shuffle(self, ctx, *args):
async def shuffle(self, ctx, *, args):
"""Returns a shuffled sequence of given arguments"""
choices = list(args)
choices = [word.strip() for word in args.split(",")]
if len(choices):
random.shuffle(choices)
await ctx.send(embed=info(f"📃 | Random shuffle | **{', '.join(choices)}**", ctx.me, title=""))
Expand Down

0 comments on commit 47bd32d

Please sign in to comment.