Fixed reference errors #1.1.0.rc2
This commit is contained in:
parent
0bc3bff58e
commit
a95bf7bc6c
@ -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.abc.message_service_abc import MessageServiceABC
|
||||||
from bot_core.helper.command_checks import CommandChecks
|
from bot_core.helper.command_checks import CommandChecks
|
||||||
from bot_core.logging.command_logger import CommandLogger
|
from bot_core.logging.command_logger import CommandLogger
|
||||||
|
from bot_data.model.server_config import ServerConfig
|
||||||
|
|
||||||
|
|
||||||
class AFKCommand(DiscordCommandABC):
|
class AFKCommand(DiscordCommandABC):
|
||||||
|
@ -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.abc.message_service_abc import MessageServiceABC
|
||||||
from bot_core.helper.command_checks import CommandChecks
|
from bot_core.helper.command_checks import CommandChecks
|
||||||
from bot_core.logging.command_logger import CommandLogger
|
from bot_core.logging.command_logger import CommandLogger
|
||||||
|
from bot_data.model.technician_config import TechnicianConfig
|
||||||
|
|
||||||
|
|
||||||
class HelpCommand(DiscordCommandABC):
|
class HelpCommand(DiscordCommandABC):
|
||||||
@ -38,7 +39,7 @@ class HelpCommand(DiscordCommandABC):
|
|||||||
@CommandChecks.check_is_ready()
|
@CommandChecks.check_is_ready()
|
||||||
async def help(self, ctx: Context, persistent_flag: str = None):
|
async def help(self, ctx: Context, persistent_flag: str = None):
|
||||||
self._logger.debug(__name__, f"Received command help {ctx}:{persistent_flag}")
|
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"
|
is_persistent = persistent_flag == "--stay"
|
||||||
await self._message_service.send_ctx_msg(
|
await self._message_service.send_ctx_msg(
|
||||||
ctx,
|
ctx,
|
||||||
|
@ -11,6 +11,7 @@ from discord.ext.commands import Context, CommandError
|
|||||||
|
|
||||||
from bot_core.abc.message_service_abc import MessageServiceABC
|
from bot_core.abc.message_service_abc import MessageServiceABC
|
||||||
from bot_core.exception.check_error import CheckError
|
from bot_core.exception.check_error import CheckError
|
||||||
|
from bot_data.model.technician_config import TechnicianConfig
|
||||||
|
|
||||||
|
|
||||||
class BaseOnCommandErrorEvent(OnCommandErrorABC):
|
class BaseOnCommandErrorEvent(OnCommandErrorABC):
|
||||||
@ -19,6 +20,7 @@ class BaseOnCommandErrorEvent(OnCommandErrorABC):
|
|||||||
logger: LoggerABC,
|
logger: LoggerABC,
|
||||||
bot: DiscordBotServiceABC,
|
bot: DiscordBotServiceABC,
|
||||||
messenger: MessageServiceABC,
|
messenger: MessageServiceABC,
|
||||||
|
tech_settings: TechnicianConfig,
|
||||||
time_format_settings: TimeFormatSettings,
|
time_format_settings: TimeFormatSettings,
|
||||||
translate: TranslatePipe,
|
translate: TranslatePipe,
|
||||||
):
|
):
|
||||||
@ -26,7 +28,7 @@ class BaseOnCommandErrorEvent(OnCommandErrorABC):
|
|||||||
self._logger = logger
|
self._logger = logger
|
||||||
self._bot = bot
|
self._bot = bot
|
||||||
self._messenger = messenger
|
self._messenger = messenger
|
||||||
self._bot_settings = bot_settings
|
self._tech_settings = tech_settings
|
||||||
self._time_format_settings = time_format_settings
|
self._time_format_settings = time_format_settings
|
||||||
self._t = translate
|
self._t = translate
|
||||||
|
|
||||||
@ -264,6 +266,6 @@ class BaseOnCommandErrorEvent(OnCommandErrorABC):
|
|||||||
datetime.datetime.now().strftime(self._time_format_settings.date_time_format),
|
datetime.datetime.now().strftime(self._time_format_settings.date_time_format),
|
||||||
uid,
|
uid,
|
||||||
)
|
)
|
||||||
for t in self._bot_settings.technicians:
|
for t in self._tech_settings.technician_ids:
|
||||||
member = self._bot.get_user(t)
|
member = self._bot.get_user(t)
|
||||||
await self._messenger.send_dm_message(message, member, without_tracking=True)
|
await self._messenger.send_dm_message(message, member, without_tracking=True)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import discord
|
import discord
|
||||||
|
from cpl_core.configuration import ConfigurationABC
|
||||||
from cpl_core.database.context import DatabaseContextABC
|
from cpl_core.database.context import DatabaseContextABC
|
||||||
from cpl_core.logging import LoggerABC
|
from cpl_core.logging import LoggerABC
|
||||||
from cpl_discord.service import DiscordBotServiceABC
|
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.server_repository_abc import ServerRepositoryABC
|
||||||
from bot_data.abc.user_repository_abc import UserRepositoryABC
|
from bot_data.abc.user_repository_abc import UserRepositoryABC
|
||||||
from bot_data.abc.user_warnings_repository_abc import UserWarningsRepositoryABC
|
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 import User
|
||||||
from bot_data.model.user_warnings import UserWarnings
|
from bot_data.model.user_warnings import UserWarnings
|
||||||
from modules.level.service.level_service import LevelService
|
from modules.level.service.level_service import LevelService
|
||||||
@ -18,6 +20,7 @@ from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
|||||||
class UserWarningsService:
|
class UserWarningsService:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
config: ConfigurationABC,
|
||||||
logger: LoggerABC,
|
logger: LoggerABC,
|
||||||
db: DatabaseContextABC,
|
db: DatabaseContextABC,
|
||||||
bot: DiscordBotServiceABC,
|
bot: DiscordBotServiceABC,
|
||||||
@ -30,6 +33,7 @@ class UserWarningsService:
|
|||||||
t: TranslatePipe,
|
t: TranslatePipe,
|
||||||
permissions: PermissionServiceABC,
|
permissions: PermissionServiceABC,
|
||||||
):
|
):
|
||||||
|
self._config = config
|
||||||
self._logger = logger
|
self._logger = logger
|
||||||
self._db = db
|
self._db = db
|
||||||
self._bot = bot
|
self._bot = bot
|
||||||
|
@ -8,6 +8,7 @@ from cpl_translation import TranslatePipe
|
|||||||
|
|
||||||
from bot_core.service.message_service import MessageService
|
from bot_core.service.message_service import MessageService
|
||||||
from bot_data.model.level import Level
|
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.model.user import User
|
||||||
from bot_data.service.level_repository_service import LevelRepositoryService
|
from bot_data.service.level_repository_service import LevelRepositoryService
|
||||||
from bot_data.service.server_repository_service import ServerRepositoryService
|
from bot_data.service.server_repository_service import ServerRepositoryService
|
||||||
|
Loading…
Reference in New Issue
Block a user