1.0.0 #253
@ -5,6 +5,7 @@ from typing import Callable
|
||||
from cpl_query.extension import List
|
||||
from discord.ext.commands import Context
|
||||
|
||||
from bot_data.model.user import User
|
||||
from modules.base.configuration.base_server_settings import BaseServerSettings
|
||||
|
||||
|
||||
@ -49,12 +50,12 @@ class ClientUtilsABC(ABC):
|
||||
def is_message_xp_count_by_hour_higher_that_max_message_count_per_hour(
|
||||
self,
|
||||
created_at: datetime,
|
||||
user: "User",
|
||||
user: User,
|
||||
settings: BaseServerSettings,
|
||||
is_reaction: bool = False,
|
||||
) -> bool:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_ontime_for_user(self, user: "User") -> float:
|
||||
def get_ontime_for_user(self, user: User) -> float:
|
||||
pass
|
||||
|
@ -5,7 +5,7 @@ from cpl_core.database import TableABC
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
from cpl_discord.service import DiscordBotServiceABC
|
||||
|
||||
from bot_core.abc.client_utils_abc import ClientUtilsABC
|
||||
from bot_data.model.level import Level
|
||||
from bot_data.model.server import Server
|
||||
|
||||
|
||||
@ -63,12 +63,15 @@ class User(TableABC):
|
||||
|
||||
@property
|
||||
@ServiceProviderABC.inject
|
||||
def ontime(self, client_utils: ClientUtilsABC) -> float:
|
||||
def ontime(self, services: ServiceProviderABC) -> float:
|
||||
from bot_core.abc.client_utils_abc import ClientUtilsABC
|
||||
|
||||
client_utils: ClientUtilsABC = services.get_service(ClientUtilsABC)
|
||||
return client_utils.get_ontime_for_user(self)
|
||||
|
||||
@property
|
||||
@ServiceProviderABC.inject
|
||||
def level(self, services: ServiceProviderABC) -> "Level":
|
||||
def level(self, services: ServiceProviderABC) -> Level:
|
||||
from modules.level.service.level_service import LevelService
|
||||
|
||||
levels: LevelService = services.get_service(LevelService)
|
||||
|
Loading…
Reference in New Issue
Block a user