InfoCommand.name field

This commit is contained in:
Jörn-Michael Miehe 2023-11-20 14:32:00 +01:00
parent d3b7a445c5
commit e9de83daed
2 changed files with 11 additions and 10 deletions

View file

@ -31,6 +31,7 @@ class Post(BaseModel):
class InfoCommand(BaseModel): class InfoCommand(BaseModel):
name: StrippedStr
description: StrippedStr = "..." description: StrippedStr = "..."
content: StrippedStr = "" content: StrippedStr = ""

View file

@ -14,7 +14,7 @@ def reply_private(interaction: discord.Interaction, name: str) -> bool:
@ev_command( @ev_command(
name="info", name=CONFIG.ev_info.info.name,
description=CONFIG.ev_info.info.description, description=CONFIG.ev_info.info.description,
) )
async def info(interaction: discord.Interaction) -> None: async def info(interaction: discord.Interaction) -> None:
@ -24,12 +24,12 @@ async def info(interaction: discord.Interaction) -> None:
await interaction.response.send_message( await interaction.response.send_message(
content=CONFIG.ev_info.info.content, content=CONFIG.ev_info.info.content,
ephemeral=reply_private(interaction, "info"), ephemeral=reply_private(interaction, CONFIG.ev_info.info.description),
) )
@ev_command( @ev_command(
name="linktree", name=CONFIG.ev_info.linktree.name,
description=CONFIG.ev_info.linktree.description, description=CONFIG.ev_info.linktree.description,
) )
async def linktree(interaction: discord.Interaction) -> None: async def linktree(interaction: discord.Interaction) -> None:
@ -40,12 +40,12 @@ async def linktree(interaction: discord.Interaction) -> None:
await interaction.response.send_message( await interaction.response.send_message(
content=CONFIG.ev_info.linktree.content, content=CONFIG.ev_info.linktree.content,
suppress_embeds=True, suppress_embeds=True,
ephemeral=reply_private(interaction, "linktree"), ephemeral=reply_private(interaction, CONFIG.ev_info.linktree.description),
) )
@ev_command( @ev_command(
name="join", name=CONFIG.ev_info.join.name,
description=CONFIG.ev_info.join.description, description=CONFIG.ev_info.join.description,
) )
async def join(interaction: discord.Interaction) -> None: async def join(interaction: discord.Interaction) -> None:
@ -57,7 +57,7 @@ async def join(interaction: discord.Interaction) -> None:
await interaction.response.send_message( await interaction.response.send_message(
content=CONFIG.ev_info.join.content, content=CONFIG.ev_info.join.content,
file=file, file=file,
ephemeral=reply_private(interaction, "join"), ephemeral=reply_private(interaction, CONFIG.ev_info.join.description),
) )
else: else:
@ -68,7 +68,7 @@ async def join(interaction: discord.Interaction) -> None:
@ev_command( @ev_command(
name="fest", name=CONFIG.ev_info.fest.name,
description=CONFIG.ev_info.fest.description, description=CONFIG.ev_info.fest.description,
) )
async def fest(interaction: discord.Interaction) -> None: async def fest(interaction: discord.Interaction) -> None:
@ -78,12 +78,12 @@ async def fest(interaction: discord.Interaction) -> None:
await interaction.response.send_message( await interaction.response.send_message(
content=CONFIG.ev_info.fest.content, content=CONFIG.ev_info.fest.content,
ephemeral=reply_private(interaction, "fest"), ephemeral=reply_private(interaction, CONFIG.ev_info.fest.description),
) )
@ev_command( @ev_command(
name="aktion", name=CONFIG.ev_info.aktion.name,
description=CONFIG.ev_info.aktion.description, description=CONFIG.ev_info.aktion.description,
) )
async def aktion(interaction: discord.Interaction) -> None: async def aktion(interaction: discord.Interaction) -> None:
@ -93,7 +93,7 @@ async def aktion(interaction: discord.Interaction) -> None:
await interaction.response.send_message( await interaction.response.send_message(
content=CONFIG.ev_info.aktion.content, content=CONFIG.ev_info.aktion.content,
ephemeral=reply_private(interaction, "aktion"), ephemeral=reply_private(interaction, CONFIG.ev_info.aktion.description),
) )