diff --git a/gameutils.py b/gameutils.py index 34b47ff..8e96d35 100644 --- a/gameutils.py +++ b/gameutils.py @@ -28,9 +28,10 @@ class TurnModal(nextcord.ui.Modal): self.add_item(self.text) async def callback(self, interaction: nextcord.Interaction) -> None: - if interaction.permissions.manage_roles: - await interaction.response.send_message("You don't have permission!") if not self.fristrun: + if not interaction.permissions.manage_roles: + await interaction.response.send_message("You don't have permission!", ephemeral=True) + return 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: @@ -63,6 +64,9 @@ class GameView(nextcord.ui.View): label="Next Turn", style=nextcord.ButtonStyle.green, custom_id="gameutils:nextturn" ) async def nextturn(self, button: nextcord.ui.Button, interaction: nextcord.Interaction): + if not interaction.permissions.manage_roles: + await interaction.response.send_message("You don't have permission!", ephemeral=True) + return ogmsg = interaction.message.content.split("\n") turnmessage = ogmsg[0] ogmsg.pop(0)