fix(ticket): corriger l'échec d'interaction caused par un custom_id dynamique

Le custom_id des boutons de catégorie incluait un snowflake basé sur
l'heure courante, ce qui changeait à chaque affichage du message et
empêchait Discord de matcher le bouton enregistré.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lowei 2026-05-25 17:19:45 +02:00
parent 6e314f081d
commit 101f078f51

View file

@ -182,7 +182,7 @@ class TicketPanelView(disnake.ui.View):
accessory=disnake.ui.Button( accessory=disnake.ui.Button(
label=cat.name, label=cat.name,
style=disnake.ButtonStyle.primary, style=disnake.ButtonStyle.primary,
custom_id=f"cat|{cat.id}|{int(disnake.utils.time_snowflake(disnake.utils.utcnow()) / 1000)}" custom_id=f"cat|{cat.id}"
) )
) )
) )
@ -3745,12 +3745,9 @@ class TicketCommands(commands.Cog):
@commands.slash_command(name="ticket", description="Ouvre le panel des tickets") @commands.slash_command(name="ticket", description="Ouvre le panel des tickets")
async def ticket_main(self, inter: disnake.ApplicationCommandInteraction): async def ticket_main(self, inter: disnake.ApplicationCommandInteraction):
"""Ouvre le panel des tickets""" """Ouvre le panel des tickets"""
await inter.response.defer(ephemeral=True)
config = self.storage.load_config(inter.guild.id) config = self.storage.load_config(inter.guild.id)
view = TicketPanelView(self.bot, config, self.storage) view = TicketPanelView(self.bot, config, self.storage)
await inter.edit_original_response(components=view.get_components_v2()) await inter.response.send_message(components=view.get_components_v2(), view=view, ephemeral=True)
@commands.slash_command(name="ticketpanel", description="Envoie le panel de création de tickets dans un canal") @commands.slash_command(name="ticketpanel", description="Envoie le panel de création de tickets dans un canal")
@commands.has_permissions(administrator=True) @commands.has_permissions(administrator=True)