diff options
author | 2021-06-04 23:23:15 +0530 | |
---|---|---|
committer | 2021-06-04 23:23:15 +0530 | |
commit | 46c947a6434a8f94722ce85141b39a084fde693e (patch) | |
tree | 7b8b4b3eef2a36eaa6b66965cbf886e45a6137f1 /bot/exts/evergreen/rps.py | |
parent | removed upper case on printing result and made minor grammar changes. (diff) |
-removed dead code
-used ctx.send instead of channel.send
Diffstat (limited to 'bot/exts/evergreen/rps.py')
-rw-r--r-- | bot/exts/evergreen/rps.py | 13 |
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: |