From 744072e1fc338e5b3596ea35ca636e76327017a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Mon, 20 Nov 2023 14:32:00 +0100 Subject: [PATCH] InfoCommand.name field --- lenaverse_bot/core/config.py | 1 + lenaverse_bot/core/verein.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lenaverse_bot/core/config.py b/lenaverse_bot/core/config.py index 70a8b30..2cff0a0 100644 --- a/lenaverse_bot/core/config.py +++ b/lenaverse_bot/core/config.py @@ -31,6 +31,7 @@ class Post(BaseModel): class InfoCommand(BaseModel): + name: StrippedStr description: StrippedStr = "..." content: StrippedStr = "" diff --git a/lenaverse_bot/core/verein.py b/lenaverse_bot/core/verein.py index 25e8391..b02d328 100644 --- a/lenaverse_bot/core/verein.py +++ b/lenaverse_bot/core/verein.py @@ -14,7 +14,7 @@ def reply_private(interaction: discord.Interaction, name: str) -> bool: @ev_command( - name="info", + name=CONFIG.ev_info.info.description, description=CONFIG.ev_info.info.description, ) async def info(interaction: discord.Interaction) -> None: @@ -24,12 +24,12 @@ async def info(interaction: discord.Interaction) -> None: await interaction.response.send_message( content=CONFIG.ev_info.info.content, - ephemeral=reply_private(interaction, "info"), + ephemeral=reply_private(interaction, CONFIG.ev_info.info.description), ) @ev_command( - name="linktree", + name=CONFIG.ev_info.linktree.description, description=CONFIG.ev_info.linktree.description, ) async def linktree(interaction: discord.Interaction) -> None: @@ -40,12 +40,12 @@ async def linktree(interaction: discord.Interaction) -> None: await interaction.response.send_message( content=CONFIG.ev_info.linktree.content, suppress_embeds=True, - ephemeral=reply_private(interaction, "linktree"), + ephemeral=reply_private(interaction, CONFIG.ev_info.linktree.description), ) @ev_command( - name="join", + name=CONFIG.ev_info.join.description, description=CONFIG.ev_info.join.description, ) async def join(interaction: discord.Interaction) -> None: @@ -57,7 +57,7 @@ async def join(interaction: discord.Interaction) -> None: await interaction.response.send_message( content=CONFIG.ev_info.join.content, file=file, - ephemeral=reply_private(interaction, "join"), + ephemeral=reply_private(interaction, CONFIG.ev_info.join.description), ) else: @@ -68,7 +68,7 @@ async def join(interaction: discord.Interaction) -> None: @ev_command( - name="fest", + name=CONFIG.ev_info.fest.description, description=CONFIG.ev_info.fest.description, ) async def fest(interaction: discord.Interaction) -> None: @@ -78,12 +78,12 @@ async def fest(interaction: discord.Interaction) -> None: await interaction.response.send_message( content=CONFIG.ev_info.fest.content, - ephemeral=reply_private(interaction, "fest"), + ephemeral=reply_private(interaction, CONFIG.ev_info.fest.description), ) @ev_command( - name="aktion", + name=CONFIG.ev_info.aktion.description, description=CONFIG.ev_info.aktion.description, ) async def aktion(interaction: discord.Interaction) -> None: @@ -93,7 +93,7 @@ async def aktion(interaction: discord.Interaction) -> None: await interaction.response.send_message( content=CONFIG.ev_info.aktion.content, - ephemeral=reply_private(interaction, "aktion"), + ephemeral=reply_private(interaction, CONFIG.ev_info.aktion.description), )