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",