aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar prashant <[email protected]>2021-06-02 16:56:26 +0530
committerGravatar prashant <[email protected]>2021-06-02 16:56:26 +0530
commit0442ea631198fd42014436e5c64c3a696b9b78c9 (patch)
tree282495b37ea7462d7c0518179c52fb2c5cfeaf17
parentMerge branch 'master' of https://github.com/OculusMode/sir-lancebot (diff)
added logical spacing and removed redundant code
-rw-r--r--bot/exts/evergreen/rps.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/bot/exts/evergreen/rps.py b/bot/exts/evergreen/rps.py
index e7c1a182..d07f9c60 100644
--- a/bot/exts/evergreen/rps.py
+++ b/bot/exts/evergreen/rps.py
@@ -54,12 +54,16 @@ class RPS(commands.Cog):
if not action:
await channel.send("Please make a move.")
return
+
action = action.lower()
+
if action not in CHOICES and action not in SHORT_CHOICES:
await channel.send(f"Invalid move. Please make move from options: {' '.join(CHOICES)}")
return
+
bot_move = self.make_move()
player_result = self.get_winner(action[0], bot_move[0])
+
if player_result == 0:
message_string = f"{player.mention} You and Sir Lancebot played {bot_move.upper()}, It's a tie."
await channel.send(message_string)
@@ -69,10 +73,7 @@ class RPS(commands.Cog):
await channel.send(f"Sir Lancebot played {bot_move.upper()}! {player.mention} Lost!")
@guild_only()
- @commands.command(
- invoke_without_command=True,
- case_insensitive=True
- )
+ @commands.command(case_insensitive=True)
async def rps(self, ctx: commands.Context, move: str) -> None:
"""Play the classic game of Rock Paper Scissor with your own sir-lancebot!"""
await self.game_start(ctx.author, ctx.channel, move)