lenaverse-bot/lenaverse_bot/core/_helpers.py

32 lines
624 B
Python
Raw Normal View History

from pathlib import Path
import discord
from discord.app_commands import locale_str
from discord.utils import MISSING
from lenaverse_bot import __file__ as module_file
from .config import CONFIG
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
def ev_command(
name: str,
description: str | locale_str = MISSING,
):
return discord.app_commands.command(
name=CONFIG.command_prefix + name,
description=description,
)