From 32eddce00c70763e5ccc41f29fca44e2e93a72c7 Mon Sep 17 00:00:00 2001 From: insert Date: Sun, 11 Aug 2024 00:33:12 -0400 Subject: [PATCH] Update --- gameutils.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gameutils.py b/gameutils.py index 5528202..3df5020 100644 --- a/gameutils.py +++ b/gameutils.py @@ -8,11 +8,12 @@ from urllib.parse import urlparse import os class TurnModal(nextcord.ui.Modal): - def __init__(self,message,turnping): + def __init__(self,message,turnping,fristrun): self.message = message self.turnping = turnping + self.fristrun = fristrun super().__init__( - f"set turn message/context" + f"set turn message/context for {self.fristrun.name}/{self.fristrun.display_name}" if self.fristrun else f"set turn message/context" ) self.text = nextcord.ui.TextInput( @@ -24,8 +25,11 @@ class TurnModal(nextcord.ui.Modal): self.add_item(self.text) async def callback(self, interaction: nextcord.Interaction) -> None: - await interaction.response.edit_message(content=self.message) - await interaction.followup.send(f"<{self.turnping}> it is now your turn!\n{self.text.value}") + if not fristrun: + await interaction.response.edit_message(content=self.message) + await interaction.followup.send(f"<{self.turnping}> it is now your turn!\n{self.text.value}") + else: + await interaction.followup.send(f"<{self.fristrun.id}> it is now your turn!\n{self.text.value}") class GameView(nextcord.ui.View): @@ -66,7 +70,7 @@ class GameView(nextcord.ui.View): pass await interaction.followup.send(f"The round has concluded") else: - await interaction.response.send_modal(TurnModal(message,turnping)) + await interaction.response.send_modal(TurnModal(message,turnping,False)) return class gameutils(commands.Cog): @@ -109,7 +113,8 @@ class gameutils(commands.Cog): await sentmsg.pin() except: pass - await interaction.followup.send(f"<@{users[0].id}> it is now your turn!") + await interaction.followup.send_modal(None,None,users[0]) + #await interaction.followup.send(f"<@{users[0].id}> it is now your turn!") @nextcord.slash_command( name="dice",