aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar prashant <[email protected]>2021-06-04 23:23:15 +0530
committerGravatar prashant <[email protected]>2021-06-04 23:23:15 +0530
commit46c947a6434a8f94722ce85141b39a084fde693e (patch)
tree7b8b4b3eef2a36eaa6b66965cbf886e45a6137f1
parentremoved upper case on printing result and made minor grammar changes. (diff)
-removed dead code
-used ctx.send instead of channel.send
-rw-r--r--bot/exts/evergreen/rps.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/bot/exts/evergreen/rps.py b/bot/exts/evergreen/rps.py
index 49561e4b..2634be21 100644
--- a/bot/exts/evergreen/rps.py
+++ b/bot/exts/evergreen/rps.py
@@ -33,16 +33,11 @@ class RPS(commands.Cog):
@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!"""
- channel = ctx.channel
- if not move:
- await channel.send("Please make a move.")
- return
-
move = move.lower()
player_mention = ctx.author.mention
if move not in CHOICES and move not in SHORT_CHOICES:
- await channel.send(f"Invalid move. Please make move from options: {', '.join(CHOICES).upper()}.")
+ await ctx.send(f"Invalid move. Please make move from options: {', '.join(CHOICES).upper()}.")
return
bot_move = choice(CHOICES)
@@ -51,11 +46,11 @@ class RPS(commands.Cog):
if player_result == 0:
message_string = f"{player_mention} You and Sir Lancebot played {bot_move}, it's a tie."
- await channel.send(message_string)
+ await ctx.send(message_string)
elif player_result == 1:
- await channel.send(f"Sir Lancebot played {bot_move}! {player_mention} won!")
+ await ctx.send(f"Sir Lancebot played {bot_move}! {player_mention} won!")
else:
- await channel.send(f"Sir Lancebot played {bot_move}! {player_mention} lost!")
+ await ctx.send(f"Sir Lancebot played {bot_move}! {player_mention} lost!")
def setup(bot: Bot) -> None: