Files
overub/core/module.py
2025-12-21 17:12:32 +01:00

31 lines
836 B
Python

from __future__ import annotations
from typing import Any, Dict
from core.logger import get_logger
class Module:
name: str = ""
version: str = "0.1.0"
description: str = ""
dependencies: list[str] = []
optional_dependencies: list[str] = []
def __init__(self, app: "OverUB") -> None:
self.app = app
self.log = get_logger(f"module.{self.name or self.__class__.__name__}")
self.commands = app.command_builder.with_owner(self.name, owner_type="module")
async def on_load(self) -> None:
return None
async def on_unload(self) -> None:
return None
def get_config(self) -> Dict[str, Any]:
return self.app.config.get_module_config(self.name)
def register_command(self, *args, **kwargs) -> Any:
return self.commands.command(*args, **kwargs)