Fix: système de ticket & optimisation

This commit is contained in:
Mathis 2026-06-18 23:12:51 +02:00
parent 5a9e9b52d6
commit 710ae134b0

View file

@ -127,18 +127,21 @@ class RatingSelect(disnake.ui.Select):
await interaction.response.defer()
class FeedbackModal(disnake.ui.Modal):
def __init__(self, view):
super().__init__(components=[], title="Votre avis")
"""Modal that collects a freeform comment for a ticket feedback."""
def __init__(self, view: FeedbackView):
self.view = view
self.comment = disnake.ui.TextInput(
label="Commentaire",
style=disnake.TextInputStyle.paragraph,
placeholder="Dites-nous ce que vous avez pensé du support...",
required=True,
max_length=1000
max_length=1000,
)
self.add_item(self.comment)
super().__init__(title="Votre avis", components=[self.comment])
async def callback(self, interaction: disnake.Interaction):
self.view.comment = self.comment.value
await interaction.response.send_message("Commentaire enregistré ! N'oubliez pas de valider avec 'Envoyer'.", ephemeral=True)
await interaction.response.send_message(
"Commentaire enregistré! N'oubliez pas de valider avec «Envoyer».",
ephemeral=True,
)