From fe683cd5637f2b0e921754c5e8753e88dd3940df Mon Sep 17 00:00:00 2001 From: insert Date: Sat, 10 Aug 2024 15:37:41 -0400 Subject: [PATCH] Update --- gameutils.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gameutils.py b/gameutils.py index 4315352..a901951 100644 --- a/gameutils.py +++ b/gameutils.py @@ -20,21 +20,29 @@ class GameView(nextcord.ui.View): ogmsg.pop(0) message = "It has been decreed..\n" found = False + trunover = False for i in range(len(ogmsg)): if ogmsg[i].startswith("~"): message = f"{message}{ogmsg[i]}\n" continue if not found: newmsg = "~~" + ogmsg[i] + "~~" - turnping = ogmsg[i+1].split("<")[1].split(">")[0] - found = True message = message + newmsg + "\n" + found = True + try: + turnping = ogmsg[i+1].split("<")[1].split(">")[0] + except IndexError: + message = message + "The turn is over" + turnover = True continue else: message = message + ogmsg[i] + "\n" print(interaction.user.guild_permissions) await interaction.response.edit_message(content=message) - await interaction.followup.send(f"<{turnping}> it is now your turn!") + if turnover: + await interaction.followup.send(f"The turn has concluded") + else: + await interaction.followup.send(f"<{turnping}> it is now your turn!") return class gameutils(commands.Cog):