1
0
Fork 0
mirror of https://code.lenaisten.de/Lenaisten/lenaverse-bot.git synced 2024-11-22 15:03:01 +00:00
lenaverse-bot/lenaverse_bot/core/verein.py

41 lines
1 KiB
Python
Raw Normal View History

2023-11-19 23:26:23 +00:00
import logging
from pathlib import Path
import discord
from lenaverse_bot import __file__ as module_file
from .config import CONFIG
_logger = logging.getLogger(__name__)
def get_files_path() -> Path:
module_path = Path(module_file)
if module_path.is_file():
module_path = module_path.parent
result = module_path / "files"
assert result.is_dir()
return result
@discord.app_commands.command()
async def ev_linktree(interaction: discord.Interaction) -> None:
_logger.debug(f"User {interaction.user.name}({interaction.user.id}) used /linktree")
await interaction.response.send_message(
content=CONFIG.ev_info.linktree.strip(),
suppress_embeds=True,
)
@discord.app_commands.command()
async def ev_join(interaction: discord.Interaction) -> None:
_logger.debug(f"User {interaction.user.name}({interaction.user.id}) used /join")
await interaction.response.send_message(
content=CONFIG.ev_info.join_message.strip(),
file=discord.File(get_files_path() / CONFIG.ev_info.join_file),
)