Fixed code after merges #1.1.0

This commit is contained in:
Sven Heidemann 2023-08-14 19:25:12 +02:00
parent 99e75ba325
commit 44e225c273
2 changed files with 2 additions and 9 deletions

View File

@ -7,8 +7,6 @@ from cpl_discord.events import OnVoiceStateUpdateABC
from bot_core.helper.event_checks import EventChecks from bot_core.helper.event_checks import EventChecks
from bot_data.abc.server_repository_abc import ServerRepositoryABC from bot_data.abc.server_repository_abc import ServerRepositoryABC
from bot_data.abc.user_repository_abc import UserRepositoryABC from bot_data.abc.user_repository_abc import UserRepositoryABC
from modules.base.abc.base_helper_abc import BaseHelperABC
from modules.base.configuration.base_server_settings import BaseServerSettings
from modules.base.service.event_service import EventService from modules.base.service.event_service import EventService
@ -17,7 +15,6 @@ class BaseOnVoiceStateUpdateEventScheduledEventBonus(OnVoiceStateUpdateABC):
self, self,
config: ConfigurationABC, config: ConfigurationABC,
logger: LoggerABC, logger: LoggerABC,
base_helper: BaseHelperABC,
servers: ServerRepositoryABC, servers: ServerRepositoryABC,
users: UserRepositoryABC, users: UserRepositoryABC,
events: EventService, events: EventService,
@ -26,7 +23,6 @@ class BaseOnVoiceStateUpdateEventScheduledEventBonus(OnVoiceStateUpdateABC):
OnVoiceStateUpdateABC.__init__(self) OnVoiceStateUpdateABC.__init__(self)
self._config = config self._config = config
self._logger = logger self._logger = logger
self._base_helper = base_helper
self._servers = servers self._servers = servers
self._users = users self._users = users
self._events = events self._events = events

View File

@ -8,9 +8,8 @@ from cpl_query.extension import List
from bot_data.abc.server_repository_abc import ServerRepositoryABC from bot_data.abc.server_repository_abc import ServerRepositoryABC
from bot_data.abc.user_repository_abc import UserRepositoryABC from bot_data.abc.user_repository_abc import UserRepositoryABC
from modules.base.configuration.base_server_settings import BaseServerSettings from bot_data.model.server_config import ServerConfig
from modules.base.model.active_event import ActiveEvent from modules.base.model.active_event import ActiveEvent
from modules.base.service.base_helper_service import BaseHelperService
class EventService: class EventService:
@ -18,14 +17,12 @@ class EventService:
self, self,
config: ConfigurationABC, config: ConfigurationABC,
logger: LoggerABC, logger: LoggerABC,
base_helper: BaseHelperService,
servers: ServerRepositoryABC, servers: ServerRepositoryABC,
users: UserRepositoryABC, users: UserRepositoryABC,
db: DatabaseContextABC, db: DatabaseContextABC,
): ):
self._config = config self._config = config
self._logger = logger self._logger = logger
self._base_helper = base_helper
self._servers = servers self._servers = servers
self._users = users self._users = users
self._db = db self._db = db
@ -59,7 +56,7 @@ class EventService:
self._logger.debug(__name__, f"Module {type(self)} stopped") self._logger.debug(__name__, f"Module {type(self)} stopped")
return return
settings: BaseServerSettings = self._base_helper.get_config(server.discord_id) settings: ServerConfig = self._config.get_configuration(f"ServerConfig_{server.discord_id}")
user.xp += settings.xp_per_event_participation user.xp += settings.xp_per_event_participation
self._users.update_user(user) self._users.update_user(user)
self._db.save_changes() self._db.save_changes()