From 996494ebb02fc5414726768973ea4917353f87d9 Mon Sep 17 00:00:00 2001 From: Interitio Date: Thu, 4 Sep 2025 04:14:56 +1000 Subject: [PATCH] fix: Add profiles module attribute. --- src/meta/LionBot.py | 9 +++++++++ src/meta/LionContext.py | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/meta/LionBot.py b/src/meta/LionBot.py index 6e2a23f..14205ae 100644 --- a/src/meta/LionBot.py +++ b/src/meta/LionBot.py @@ -26,6 +26,7 @@ from .monitor import SystemMonitor, ComponentMonitor, StatusLevel, ComponentStat if TYPE_CHECKING: from core.cog import CoreCog + from modules.profiles.profiles.discord.cog import ProfilesCog logger = logging.getLogger(__name__) @@ -64,6 +65,10 @@ class LionBot(Bot): def core(self): return self.get_cog('CoreCog') + @property + def profiles(self): + return self.get_cog('ProfilesCog') + async def _monitor_status(self): if self.is_closed(): level = StatusLevel.ERRORED @@ -110,6 +115,10 @@ class LionBot(Bot): def get_cog(self, name: Literal['CoreCog']) -> 'CoreCog': ... + @overload + def get_cog(self, name: Literal['ProfilesCog']) -> 'ProfilesCog': + ... + @overload def get_cog(self, name: str) -> Optional[Cog]: ... diff --git a/src/meta/LionContext.py b/src/meta/LionContext.py index e1b21d8..7acd39f 100644 --- a/src/meta/LionContext.py +++ b/src/meta/LionContext.py @@ -9,6 +9,7 @@ from discord.ext.commands import Context if TYPE_CHECKING: from .LionBot import LionBot + from modules.profiles.profiles.data import UserProfile, Community logger = logging.getLogger(__name__) @@ -46,6 +47,8 @@ class LionContext(Context['LionBot']): Extends Context to add Lion-specific methods and attributes. Also adds several contextual wrapped utilities for simpler user during command invocation. """ + profile: 'UserProfile' + community: 'Community' def __repr__(self): parts = {}