lenaverse-bot/lenaverse_bot/core/verein.py

52 lines
1.2 KiB
Python
Raw Normal View History

2023-11-19 23:26:23 +00:00
import logging
import discord
from ._helpers import ev_command, get_files_path
2023-11-19 23:26:23 +00:00
from .config import CONFIG
_logger = logging.getLogger(__name__)
def reply_private(interaction: discord.Interaction, name: str) -> bool:
_logger.debug(f"User {interaction.user.name}({interaction.user.id}) used /{name}")
return interaction.channel_id not in CONFIG.ev_info.channels
2023-11-19 23:26:23 +00:00
@ev_command(
name="linktree",
description=CONFIG.ev_info.linktree.description,
)
async def linktree(interaction: discord.Interaction) -> None:
"""
Links rund um den Verein
"""
2023-11-19 23:26:23 +00:00
await interaction.response.send_message(
content=CONFIG.ev_info.linktree.content,
2023-11-19 23:26:23 +00:00
suppress_embeds=True,
ephemeral=reply_private(interaction, "linktree"),
2023-11-19 23:26:23 +00:00
)
@ev_command(
name="join",
description=CONFIG.ev_info.join.description,
)
async def join(interaction: discord.Interaction) -> None:
"""
Wie und warum dem Verein beitreten
"""
2023-11-19 23:26:23 +00:00
await interaction.response.send_message(
content=CONFIG.ev_info.join.content,
file=discord.File(get_files_path() / CONFIG.ev_info.join.filename),
ephemeral=reply_private(interaction, "join"),
2023-11-19 23:26:23 +00:00
)
2023-11-19 23:43:50 +00:00
COMMANDS = [
linktree,
join,
2023-11-19 23:43:50 +00:00
]