Update
This commit is contained in:
parent
f88a169537
commit
9d55a7eb98
1 changed files with 21 additions and 2 deletions
23
gameutils.py
23
gameutils.py
|
@ -7,6 +7,26 @@ import aiohttp
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
class TurnModal(nextcord.ui.Modal):
|
||||||
|
def __init__(self,message,turnping):
|
||||||
|
self.message = message
|
||||||
|
self.turnping = turnping
|
||||||
|
super().__init__(
|
||||||
|
f"set turn message/context"
|
||||||
|
)
|
||||||
|
|
||||||
|
self.text = nextcord.ui.TextInput(
|
||||||
|
label="text",
|
||||||
|
placeholder="text",
|
||||||
|
style=TextInputStyle.paragraph,
|
||||||
|
max_length=1700,
|
||||||
|
)
|
||||||
|
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}")
|
||||||
|
|
||||||
|
|
||||||
class GameView(nextcord.ui.View):
|
class GameView(nextcord.ui.View):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -46,8 +66,7 @@ class GameView(nextcord.ui.View):
|
||||||
pass
|
pass
|
||||||
await interaction.followup.send(f"The round has concluded")
|
await interaction.followup.send(f"The round has concluded")
|
||||||
else:
|
else:
|
||||||
await interaction.response.edit_message(content=message)
|
await interaction.response.send_modal(TurnModal())
|
||||||
await interaction.followup.send(f"<{turnping}> it is now your turn!")
|
|
||||||
return
|
return
|
||||||
|
|
||||||
class gameutils(commands.Cog):
|
class gameutils(commands.Cog):
|
||||||
|
|
Loading…
Reference in a new issue