Improved complaint command #293_complaints

This commit is contained in:
Sven Heidemann 2023-07-18 11:30:05 +02:00
parent 9f63a9c6dd
commit d642322985
2 changed files with 8 additions and 4 deletions

View File

@ -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... (◔_◔)",

View File

@ -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")