From 085021101f2169ae7b753aa765b15ef5b28d57e9 Mon Sep 17 00:00:00 2001 From: Dan Hess Date: Tue, 4 Aug 2020 14:05:23 -0500 Subject: [PATCH] =?UTF-8?q?Handle=20=E3=82=93=20for=20actual=20Japanese=20?= =?UTF-8?q?shiritori?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cogs/games.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cogs/games.py b/cogs/games.py index 738f08e..a035f6a 100644 --- a/cogs/games.py +++ b/cogs/games.py @@ -7,7 +7,7 @@ class Games(commands.Cog): @commands.guild_only() @utils.can_run(send_messages=True) - @commands.command(aliases=["word_chain"]) + @commands.command(aliases=["word_chain", "しりとり"]) async def shiritori(self, ctx, *, start_word): """ Starts a game of Shiritori, in which the last letter of the last word given @@ -57,13 +57,21 @@ class Games(commands.Cog): # As long as we got a valid message, and the letter matches, then we're all good. Continue on last_word = message.content last_letter = grab_letter(message.content) + + # Extra check for the japanese version, ん cannot be used + if last_letter in ("ん", "ン"): + break + last_author = message.author words_used.append(last_word) await message.add_reaction("✅") # If we're here, game over, someone messed up await message.add_reaction("❌") - await ctx.send(f"Wrong! {message.author.mention} is a loser!") + if last_letter in ("ん", "ン"): + await ctx.send(f"Wrong! ん cannot be used as the last letter!") + else: + await ctx.send(f"Wrong! {message.author.mention} is a loser!") def setup(bot):