Fixed reference errors #1.1.0.rc2

This commit is contained in:
Sven Heidemann 2023-08-16 16:37:49 +02:00
parent 0bc3bff58e
commit a95bf7bc6c
5 changed files with 12 additions and 3 deletions

View File

@ -10,6 +10,7 @@ from bot_core.abc.client_utils_abc import ClientUtilsABC
from bot_core.abc.message_service_abc import MessageServiceABC
from bot_core.helper.command_checks import CommandChecks
from bot_core.logging.command_logger import CommandLogger
from bot_data.model.server_config import ServerConfig
class AFKCommand(DiscordCommandABC):

View File

@ -12,6 +12,7 @@ from bot_core.abc.client_utils_abc import ClientUtilsABC
from bot_core.abc.message_service_abc import MessageServiceABC
from bot_core.helper.command_checks import CommandChecks
from bot_core.logging.command_logger import CommandLogger
from bot_data.model.technician_config import TechnicianConfig
class HelpCommand(DiscordCommandABC):
@ -38,7 +39,7 @@ class HelpCommand(DiscordCommandABC):
@CommandChecks.check_is_ready()
async def help(self, ctx: Context, persistent_flag: str = None):
self._logger.debug(__name__, f"Received command help {ctx}:{persistent_flag}")
settings: ServerConfig = self._config.get_configuration(f"ServerConfig_{ctx.guild.id}")
settings: TechnicianConfig = self._config.get_configuration(TechnicianConfig)
is_persistent = persistent_flag == "--stay"
await self._message_service.send_ctx_msg(
ctx,

View File

@ -11,6 +11,7 @@ from discord.ext.commands import Context, CommandError
from bot_core.abc.message_service_abc import MessageServiceABC
from bot_core.exception.check_error import CheckError
from bot_data.model.technician_config import TechnicianConfig
class BaseOnCommandErrorEvent(OnCommandErrorABC):
@ -19,6 +20,7 @@ class BaseOnCommandErrorEvent(OnCommandErrorABC):
logger: LoggerABC,
bot: DiscordBotServiceABC,
messenger: MessageServiceABC,
tech_settings: TechnicianConfig,
time_format_settings: TimeFormatSettings,
translate: TranslatePipe,
):
@ -26,7 +28,7 @@ class BaseOnCommandErrorEvent(OnCommandErrorABC):
self._logger = logger
self._bot = bot
self._messenger = messenger
self._bot_settings = bot_settings
self._tech_settings = tech_settings
self._time_format_settings = time_format_settings
self._t = translate
@ -264,6 +266,6 @@ class BaseOnCommandErrorEvent(OnCommandErrorABC):
datetime.datetime.now().strftime(self._time_format_settings.date_time_format),
uid,
)
for t in self._bot_settings.technicians:
for t in self._tech_settings.technician_ids:
member = self._bot.get_user(t)
await self._messenger.send_dm_message(message, member, without_tracking=True)

View File

@ -1,4 +1,5 @@
import discord
from cpl_core.configuration import ConfigurationABC
from cpl_core.database.context import DatabaseContextABC
from cpl_core.logging import LoggerABC
from cpl_discord.service import DiscordBotServiceABC
@ -9,6 +10,7 @@ from bot_data.abc.level_repository_abc import LevelRepositoryABC
from bot_data.abc.server_repository_abc import ServerRepositoryABC
from bot_data.abc.user_repository_abc import UserRepositoryABC
from bot_data.abc.user_warnings_repository_abc import UserWarningsRepositoryABC
from bot_data.model.server_config import ServerConfig
from bot_data.model.user import User
from bot_data.model.user_warnings import UserWarnings
from modules.level.service.level_service import LevelService
@ -18,6 +20,7 @@ from modules.permission.abc.permission_service_abc import PermissionServiceABC
class UserWarningsService:
def __init__(
self,
config: ConfigurationABC,
logger: LoggerABC,
db: DatabaseContextABC,
bot: DiscordBotServiceABC,
@ -30,6 +33,7 @@ class UserWarningsService:
t: TranslatePipe,
permissions: PermissionServiceABC,
):
self._config = config
self._logger = logger
self._db = db
self._bot = bot

View File

@ -8,6 +8,7 @@ from cpl_translation import TranslatePipe
from bot_core.service.message_service import MessageService
from bot_data.model.level import Level
from bot_data.model.server_config import ServerConfig
from bot_data.model.user import User
from bot_data.service.level_repository_service import LevelRepositoryService
from bot_data.service.server_repository_service import ServerRepositoryService