fixed grammar in riddle
This commit is contained in:
parent
bc688c0f62
commit
b38d596bca
37
fouras.py
37
fouras.py
@ -322,6 +322,18 @@ async def handle_message(message, client: discord.Client) -> bool:
|
||||
|
||||
|
||||
async def new_riddle(interaction: Interaction, index: int) -> None:
|
||||
class ConfirmRiddle(discord.ui.View):
|
||||
def __init__(self):
|
||||
super().__init__(timeout=60)
|
||||
|
||||
@discord.ui.button(label="Oui", style=discord.ButtonStyle.success)
|
||||
async def yes(self, interaction: discord.Interaction, button: discord.ui.Button):
|
||||
await interaction.response.send_message("Confirmé.", ephemeral=True)
|
||||
|
||||
@discord.ui.button(label="Non", style=discord.ButtonStyle.danger)
|
||||
async def no(self, interaction: discord.Interaction, button: discord.ui.Button):
|
||||
await interaction.response.send_message("Annulé.", ephemeral=True)
|
||||
|
||||
if random.random() <= 0.03:
|
||||
await interaction.response.send_message("Non")
|
||||
else:
|
||||
@ -447,3 +459,28 @@ def setup_commands(client: discord.Client, tree) -> None:
|
||||
if(not await update_riddle_message(interaction.channel, current_riddle)):
|
||||
return
|
||||
await interaction.response.send_message("Nouvel indice : `{0}`".format(clue_string(answer, nb_clues)))
|
||||
|
||||
@tree.command(
|
||||
name="testmodal"
|
||||
)
|
||||
async def testmodal(
|
||||
interaction: Interaction
|
||||
):
|
||||
class Confirm(discord.ui.View):
|
||||
def __init__(self):
|
||||
super().__init__(timeout=60)
|
||||
|
||||
@discord.ui.button(label="Oui", style=discord.ButtonStyle.success)
|
||||
async def yes(self, interaction: discord.Interaction, button: discord.ui.Button):
|
||||
await interaction.response.send_message("✅ Confirmé.", ephemeral=True)
|
||||
|
||||
@discord.ui.button(label="Non", style=discord.ButtonStyle.danger)
|
||||
async def no(self, interaction: discord.Interaction, button: discord.ui.Button):
|
||||
await interaction.response.send_message("❌ Annulé.", ephemeral=True)
|
||||
|
||||
view = Confirm()
|
||||
await interaction.response.send_message(
|
||||
"Es-tu sûr ?",
|
||||
view=view,
|
||||
ephemeral=True
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user