diff --git a/fouras.py b/fouras.py index 80e8902..f19dd44 100644 --- a/fouras.py +++ b/fouras.py @@ -6,7 +6,7 @@ import re from typing import Any, Dict, Optional import discord -from discord import app_commands +from discord import Interaction, app_commands from unidecode import unidecode import database @@ -321,20 +321,19 @@ async def handle_message(message, client: discord.Client) -> bool: return False -async def new_riddle(interaction, index: int) -> None: +async def new_riddle(interaction: Interaction, index: int) -> None: if random.random() <= 0.03: await interaction.response.send_message("Non") else: riddle_state = new_riddle_state(index) - await interaction.response.send_message("Nouvelle énigme !") - msg = await interaction.channel.send( + msg = await interaction.response.send_message( format_riddle_message({**riddle_state, "index": index}) ) database.save_active_riddle( channel_id=str(interaction.channel.id), riddle_index=index, nb_clues=-1, - message_id=msg.id, + message_id=msg.message_id, solver_id=None )