Update
This commit is contained in:
parent
0c427bc6dc
commit
32eddce00c
1 changed files with 11 additions and 6 deletions
13
gameutils.py
13
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:
|
||||
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",
|
||||
|
|
Loading…
Reference in a new issue