Compare commits

..

2 commits

Author SHA1 Message Date
f64cfbf1c0 InfoCommands: info, fest, aktion 2023-11-20 13:55:20 +01:00
64cb7bd5a9 config rework, command_prefix, remove clutter
- _helpers.ev_command respects CONFIG.command_prefix
- restrict public replies to channel ids
2023-11-20 13:40:25 +01:00
2 changed files with 53 additions and 2 deletions

View file

@ -40,8 +40,11 @@ class FileCommand(InfoCommand):
class ClubInfo(BaseModel): class ClubInfo(BaseModel):
channels: list[int] channels: list[int]
linktree: InfoCommand = InfoCommand() info: InfoCommand
join: FileCommand = FileCommand(filename="Aufnahmeantrag.pdf") linktree: InfoCommand
join: FileCommand
fest: InfoCommand
aktion: InfoCommand
class Config(BaseModel): class Config(BaseModel):

View file

@ -13,6 +13,21 @@ def reply_private(interaction: discord.Interaction, name: str) -> bool:
return interaction.channel_id not in CONFIG.ev_info.channels return interaction.channel_id not in CONFIG.ev_info.channels
@ev_command(
name="info",
description=CONFIG.ev_info.info.description,
)
async def info(interaction: discord.Interaction) -> None:
"""
Allgemeine Infos zum Verein
"""
await interaction.response.send_message(
content=CONFIG.ev_info.info.content,
ephemeral=reply_private(interaction, "info"),
)
@ev_command( @ev_command(
name="linktree", name="linktree",
description=CONFIG.ev_info.linktree.description, description=CONFIG.ev_info.linktree.description,
@ -45,7 +60,40 @@ async def join(interaction: discord.Interaction) -> None:
) )
@ev_command(
name="fest",
description=CONFIG.ev_info.fest.description,
)
async def fest(interaction: discord.Interaction) -> None:
"""
Infos zum nächsten Vereinsfest
"""
await interaction.response.send_message(
content=CONFIG.ev_info.fest.content,
ephemeral=reply_private(interaction, "fest"),
)
@ev_command(
name="aktion",
description=CONFIG.ev_info.aktion.description,
)
async def aktion(interaction: discord.Interaction) -> None:
"""
Infos zu aktuellen Aktionen
"""
await interaction.response.send_message(
content=CONFIG.ev_info.aktion.content,
ephemeral=reply_private(interaction, "aktion"),
)
COMMANDS = [ COMMANDS = [
info,
linktree, linktree,
join, join,
fest,
aktion,
] ]