From 0f67bf467a4e4146568f6038e2282967390c487b Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 18 Jul 2023 11:30:05 +0200 Subject: [PATCH] Improved complaint command #293_complaints --- kdb-bot/src/bot/translation/de.json | 3 ++- kdb-bot/src/modules/base/forms/complaint_form.py | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kdb-bot/src/bot/translation/de.json b/kdb-bot/src/bot/translation/de.json index d231e3f4..61f143e5 100644 --- a/kdb-bot/src/bot/translation/de.json +++ b/kdb-bot/src/bot/translation/de.json @@ -154,7 +154,8 @@ "complaints": { "title": "Beschwerde einreichen", "label": "Beschwerde", - "message": "{} hat eine Beschwerde eingereicht:\n{}" + "message": "{} hat eine Beschwerde eingereicht:\n{}", + "response": "Danke für deine Beschwerde" }, "afk_command_channel_missing_message": "Zu unfähig einem Sprachkanal beizutreten?", "afk_command_move_message": "Ich verschiebe dich ja schon... (◔_◔)", diff --git a/kdb-bot/src/modules/base/forms/complaint_form.py b/kdb-bot/src/modules/base/forms/complaint_form.py index 856b417d..6ae3b96e 100644 --- a/kdb-bot/src/modules/base/forms/complaint_form.py +++ b/kdb-bot/src/modules/base/forms/complaint_form.py @@ -1,7 +1,7 @@ import discord from cpl_core.database.context import DatabaseContextABC from cpl_translation import TranslatePipe -from discord import ui +from discord import ui, TextStyle from bot_core.abc.message_service_abc import MessageServiceABC from bot_core.logging.command_logger import CommandLogger @@ -10,7 +10,7 @@ from modules.base.service.base_helper_service import BaseHelperService class ComplaintForm(ui.Modal): - description = ui.TextInput(label="Complain about something", required=True) + description = ui.TextInput(label="Complain about something", required=True, style=TextStyle.long) def __init__( self, @@ -32,7 +32,7 @@ class ComplaintForm(ui.Modal): async def on_submit(self, interaction: discord.Interaction): self._logger.debug(__name__, f"Started complaint command form") - settings: BaseServerSettings = self._base_helper.get_config(interaction.message.guild.id) + settings: BaseServerSettings = self._base_helper.get_config(interaction.guild.id) channel = interaction.guild.get_channel(settings.team_channel_id) await self._message_service.send_channel_message( channel, @@ -41,4 +41,7 @@ class ComplaintForm(ui.Modal): ), is_persistent=True, ) + await self._message_service.send_interaction_msg( + interaction, self._t.transform("modules.base.complaints.response") + ) self._logger.trace(__name__, f"Finished complaint command form")