Compare commits
19 Commits
94732b7227
...
1.2.4
Author | SHA1 | Date | |
---|---|---|---|
560c7650bd | |||
b0fb12f841 | |||
18386339b7 | |||
4d980331e2 | |||
e6667c78c8 | |||
9976c59302 | |||
293c8cd81c | |||
8f4ea56184 | |||
898e005978 | |||
db3e6183ba | |||
0a47393510 | |||
6c5b514b41 | |||
84f994fd58 | |||
3d21123786 | |||
36887f1bdf | |||
0e4419312b | |||
db61a764eb | |||
919eef79f6 | |||
5de6710261 |
@@ -14,7 +14,6 @@
|
||||
"config": "src/modules/config/config.json",
|
||||
"database": "src/modules/database/database.json",
|
||||
"level": "src/modules/level/level.json",
|
||||
"permission": "src/modules/permission/permission.json",
|
||||
"technician": "src/modules/technician/technician.json",
|
||||
"short-role-name": "src/modules/short_role_name/short-role-name.json",
|
||||
"special-offers": "src/modules/special_offers/special-offers.json",
|
||||
|
Submodule bot/docker updated: b0bacce9f6...abd1708530
@@ -15,7 +15,7 @@ __title__ = "bot"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "1",
|
||||
"Minor": "2",
|
||||
"Micro": "2"
|
||||
"Micro": "3"
|
||||
},
|
||||
"Author": "Sven Heidemann",
|
||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||
@@ -16,7 +16,7 @@
|
||||
"LicenseName": "MIT",
|
||||
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||
"Dependencies": [
|
||||
"cpl-core==2023.10.0",
|
||||
"cpl-core==2023.10.1",
|
||||
"cpl-translation==2023.4.0.post1",
|
||||
"cpl-query==2023.10.0",
|
||||
"cpl-discord==2023.10.0.post1",
|
||||
@@ -70,7 +70,6 @@
|
||||
"../modules/config/config.json",
|
||||
"../modules/database/database.json",
|
||||
"../modules/level/level.json",
|
||||
"../modules/permission/permission.json",
|
||||
"../modules/short_role_name/short-role-name.json",
|
||||
"../modules/special_offers/special-offers.json",
|
||||
"../modules/technician/technician.json"
|
||||
|
Submodule bot/src/bot/config updated: c11ca6f2e8...4669bf7c43
@@ -15,7 +15,7 @@ __title__ = "bot.extension"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -12,7 +12,6 @@ from modules.boot_log.boot_log_module import BootLogModule
|
||||
from modules.config.config_module import ConfigModule
|
||||
from modules.database.database_module import DatabaseModule
|
||||
from modules.level.level_module import LevelModule
|
||||
from modules.permission.permission_module import PermissionModule
|
||||
from modules.short_role_name.short_role_name_module import ShortRoleNameModule
|
||||
from modules.special_offers.special_offers_module import SteamSpecialOffersModule
|
||||
from modules.technician.technician_module import TechnicianModule
|
||||
@@ -30,7 +29,6 @@ class ModuleList:
|
||||
ConfigModule, # has to be before db check
|
||||
DatabaseModule,
|
||||
GraphQLModule,
|
||||
PermissionModule,
|
||||
AutoRoleModule,
|
||||
BaseModule,
|
||||
LevelModule,
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.abc"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "1",
|
||||
"Minor": "2",
|
||||
"Micro": "2"
|
||||
"Micro": "3"
|
||||
},
|
||||
"Author": "",
|
||||
"AuthorEmail": "",
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.configuration"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.controller"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.event"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.exception"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.filter"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.filter.discord"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.logging"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.model"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.model.discord"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.route"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.service"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_api.transformer"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -10,7 +10,7 @@ from bot_api.model.user_dto import UserDTO
|
||||
from bot_data.model.auth_role_enum import AuthRoleEnum
|
||||
from bot_data.model.auth_user import AuthUser
|
||||
from bot_data.model.user import User
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class AuthUserTransformer(TransformerABC):
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_core"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_core.abc"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "1",
|
||||
"Minor": "2",
|
||||
"Micro": "2"
|
||||
"Micro": "3"
|
||||
},
|
||||
"Author": "Sven Heidemann",
|
||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_core.configuration"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,6 @@ class FeatureFlagsEnum(Enum):
|
||||
database_module = "DatabaseModule"
|
||||
level_module = "LevelModule"
|
||||
moderator_module = "ModeratorModule"
|
||||
permission_module = "PermissionModule"
|
||||
short_role_name_module = "ShortRoleNameModule"
|
||||
steam_special_offers_module = "SteamSpecialOffersModule"
|
||||
# features
|
||||
|
@@ -16,7 +16,6 @@ class FeatureFlagsSettings(ConfigurationModelABC):
|
||||
FeatureFlagsEnum.data_module.value: True, # 03.10.2022 #56
|
||||
FeatureFlagsEnum.database_module.value: True, # 02.10.2022 #48
|
||||
FeatureFlagsEnum.moderator_module.value: False, # 02.10.2022 #48
|
||||
FeatureFlagsEnum.permission_module.value: True, # 02.10.2022 #48
|
||||
FeatureFlagsEnum.config_module.value: True, # 19.07.2023 #127
|
||||
FeatureFlagsEnum.short_role_name_module.value: True, # 28.09.2023 #378
|
||||
FeatureFlagsEnum.steam_special_offers_module.value: True, # 11.10.2023 #188
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_core.core_extension"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -9,7 +9,7 @@ from bot_core.configuration.feature_flags_enum import FeatureFlagsEnum
|
||||
from bot_core.configuration.feature_flags_settings import FeatureFlagsSettings
|
||||
from bot_core.helper.command_checks import CommandChecks
|
||||
from bot_core.helper.event_checks import EventChecks
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class CoreExtension(ApplicationExtensionABC):
|
||||
|
@@ -7,6 +7,7 @@ from cpl_discord.service.discord_collection_abc import DiscordCollectionABC
|
||||
from bot_core.abc.client_utils_abc import ClientUtilsABC
|
||||
from bot_core.abc.message_service_abc import MessageServiceABC
|
||||
from bot_core.abc.module_abc import ModuleABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.configuration.feature_flags_enum import FeatureFlagsEnum
|
||||
from bot_core.events.core_on_ready_event import CoreOnReadyEvent
|
||||
from bot_core.pipes.date_time_offset_pipe import DateTimeOffsetPipe
|
||||
@@ -14,6 +15,7 @@ from bot_core.service.client_utils_service import ClientUtilsService
|
||||
from bot_core.service.config_service import ConfigService
|
||||
from bot_core.service.data_integrity_service import DataIntegrityService
|
||||
from bot_core.service.message_service import MessageService
|
||||
from bot_core.service.permission_service import PermissionService
|
||||
|
||||
|
||||
class CoreModule(ModuleABC):
|
||||
@@ -28,6 +30,7 @@ class CoreModule(ModuleABC):
|
||||
services.add_transient(MessageServiceABC, MessageService)
|
||||
services.add_transient(ClientUtilsABC, ClientUtilsService)
|
||||
services.add_transient(DataIntegrityService)
|
||||
services.add_singleton(PermissionServiceABC, PermissionService)
|
||||
|
||||
# pipes
|
||||
services.add_transient(DateTimeOffsetPipe)
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_core.events"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_core.exception"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_core.helper"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -7,7 +7,7 @@ from discord.ext.commands import Context
|
||||
from bot_core.abc.client_utils_abc import ClientUtilsABC
|
||||
from bot_core.abc.message_service_abc import MessageServiceABC
|
||||
from bot_core.exception.check_error import CheckError
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class CommandChecks:
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_core.logging"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_core.pipes"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_core.service"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
114
bot/src/bot_core/service/permission_service.py
Normal file
114
bot/src/bot_core/service/permission_service.py
Normal file
@@ -0,0 +1,114 @@
|
||||
from typing import Optional
|
||||
|
||||
import discord
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.logging import LoggerABC
|
||||
from cpl_discord.service import DiscordBotServiceABC
|
||||
|
||||
from bot_data.abc.server_config_repository_abc import ServerConfigRepositoryABC
|
||||
from bot_data.abc.server_repository_abc import ServerRepositoryABC
|
||||
from bot_data.abc.technician_config_repository_abc import TechnicianConfigRepositoryABC
|
||||
from bot_data.model.team_member_type_enum import TeamMemberTypeEnum
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class PermissionService(PermissionServiceABC):
|
||||
def __init__(
|
||||
self,
|
||||
logger: LoggerABC,
|
||||
bot: DiscordBotServiceABC,
|
||||
config: ConfigurationABC,
|
||||
servers: ServerRepositoryABC,
|
||||
server_configs: ServerConfigRepositoryABC,
|
||||
technician_configs: TechnicianConfigRepositoryABC,
|
||||
):
|
||||
PermissionServiceABC.__init__(self)
|
||||
self._logger = logger
|
||||
self._bot = bot
|
||||
self._config = config
|
||||
self._servers = servers
|
||||
self._server_configs = server_configs
|
||||
self._technician_configs = technician_configs
|
||||
|
||||
# member_id: {team_member_type: {guild_id: bool}}
|
||||
self._cache: dict[int, dict[TeamMemberTypeEnum, dict[int, bool]]] = {}
|
||||
|
||||
def reset_cache(self):
|
||||
self._cache = {}
|
||||
|
||||
def get_cached_permission(
|
||||
self, member_id: int, team_member_type: TeamMemberTypeEnum, guild_id: int = None
|
||||
) -> Optional[bool]:
|
||||
if member_id not in self._cache:
|
||||
self._cache[member_id] = {}
|
||||
|
||||
if team_member_type not in self._cache[member_id]:
|
||||
self._cache[member_id][team_member_type] = {}
|
||||
return None
|
||||
|
||||
if guild_id not in self._cache[member_id][team_member_type]:
|
||||
return None
|
||||
|
||||
return self._cache[member_id][team_member_type][guild_id]
|
||||
|
||||
def set_cached_permission(
|
||||
self, value: bool, member_id: int, team_member_type: TeamMemberTypeEnum, guild_id: int = None
|
||||
):
|
||||
if member_id not in self._cache:
|
||||
self._cache[member_id] = {}
|
||||
|
||||
if team_member_type not in self._cache[member_id]:
|
||||
self._cache[member_id][team_member_type] = {}
|
||||
|
||||
self._cache[member_id][team_member_type][guild_id] = value
|
||||
|
||||
def _has_member_role(self, member: discord.Member, team_member_type: TeamMemberTypeEnum) -> bool:
|
||||
if member is None or member.guild is None:
|
||||
return False
|
||||
|
||||
try:
|
||||
has_permission_cached = self.get_cached_permission(member.id, team_member_type, member.guild.id)
|
||||
if has_permission_cached is not None:
|
||||
return has_permission_cached
|
||||
|
||||
self._logger.debug(__name__, f"Checking is member {member.name} {team_member_type.value}")
|
||||
|
||||
has_permission = True in [
|
||||
member.guild.get_role(x.role_id) in member.roles
|
||||
for x in self._server_configs.get_server_config_by_server(
|
||||
self._servers.get_server_by_discord_id(member.guild.id).id
|
||||
).team_role_ids
|
||||
if x.team_member_type == team_member_type
|
||||
]
|
||||
self.set_cached_permission(has_permission, member.id, team_member_type, member.guild.id)
|
||||
return has_permission
|
||||
except Exception as e:
|
||||
self._logger.error(__name__, "Permission check failed", e)
|
||||
|
||||
return False
|
||||
|
||||
def is_member_admin(self, member: discord.Member) -> bool:
|
||||
return self._has_member_role(member, TeamMemberTypeEnum.admin)
|
||||
|
||||
def is_member_moderator(self, member: discord.Member) -> bool:
|
||||
return self._has_member_role(member, TeamMemberTypeEnum.moderator) or self._has_member_role(
|
||||
member, TeamMemberTypeEnum.admin
|
||||
)
|
||||
|
||||
def is_member_technician(self, member: discord.Member) -> bool:
|
||||
if member is None or member.guild is None:
|
||||
return False
|
||||
|
||||
has_permission_cached = self.get_cached_permission(member.id, TeamMemberTypeEnum.technician)
|
||||
if has_permission_cached is not None:
|
||||
return has_permission_cached
|
||||
|
||||
self._logger.debug(__name__, f"Checking is member {member.name} technician")
|
||||
|
||||
try:
|
||||
has_permission = member.id in self._technician_configs.get_technician_config().technician_ids
|
||||
self.set_cached_permission(has_permission, member.id, TeamMemberTypeEnum.technician)
|
||||
return has_permission
|
||||
except Exception as e:
|
||||
self._logger.error(__name__, "Permission check failed", e)
|
||||
return False
|
@@ -15,7 +15,7 @@ __title__ = "bot_data"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_data.abc"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -31,6 +31,10 @@ class UserRepositoryABC(ABC):
|
||||
def get_users_by_server_id(self, server_id: int) -> List[User]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_users_with_activity_by_server_id(self, server_id: int) -> List[User]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_user_by_discord_id_and_server_id(self, discord_id: int, server_id: int) -> User:
|
||||
pass
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "1",
|
||||
"Minor": "2",
|
||||
"Micro": "2"
|
||||
"Micro": "3"
|
||||
},
|
||||
"Author": "Sven Heidemann",
|
||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_data.model"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -4,3 +4,4 @@ from enum import Enum
|
||||
class TeamMemberTypeEnum(Enum):
|
||||
moderator = "Moderator"
|
||||
admin = "Admin"
|
||||
technician = "Technician"
|
||||
|
@@ -2,6 +2,7 @@ from datetime import datetime, date
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.database import TableABC
|
||||
from cpl_core.database.context import DatabaseContextABC
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
from cpl_discord.service import DiscordBotServiceABC
|
||||
from cpl_query.extension import List
|
||||
@@ -31,6 +32,8 @@ class User(TableABC):
|
||||
self._birthday = birthday
|
||||
self._server = server
|
||||
|
||||
self._activity = 0
|
||||
|
||||
TableABC.__init__(self)
|
||||
self._created_at = created_at if created_at is not None else self._created_at
|
||||
self._modified_at = modified_at if modified_at is not None else self._modified_at
|
||||
@@ -92,10 +95,40 @@ class User(TableABC):
|
||||
@property
|
||||
@ServiceProviderABC.inject
|
||||
def ontime(self, services: ServiceProviderABC) -> float:
|
||||
from bot_core.abc.client_utils_abc import ClientUtilsABC
|
||||
db: DatabaseContextABC = services.get_service(DatabaseContextABC)
|
||||
result = db.select(
|
||||
f"""
|
||||
SELECT ROUND(SUM(TIME_TO_SEC(TIMEDIFF(UserJoinedVoiceChannel.LeavedOn, UserJoinedVoiceChannel.JoinedOn)) / 3600),2)
|
||||
FROM UserJoinedVoiceChannel
|
||||
WHERE UserId = {self._user_id};
|
||||
"""
|
||||
)[0][0]
|
||||
if result is None:
|
||||
return 0
|
||||
return float(result)
|
||||
|
||||
client_utils: ClientUtilsABC = services.get_service(ClientUtilsABC)
|
||||
return client_utils.get_ontime_for_user(self)
|
||||
@property
|
||||
@ServiceProviderABC.inject
|
||||
def game_ontime(self, services: ServiceProviderABC) -> float:
|
||||
db: DatabaseContextABC = services.get_service(DatabaseContextABC)
|
||||
result = db.select(
|
||||
f"""
|
||||
SELECT ROUND(SUM(TIME_TO_SEC(TIMEDIFF(UserJoinedGameServer.LeavedOn, UserJoinedGameServer.JoinedOn)) / 3600),2)
|
||||
FROM UserJoinedGameServer
|
||||
WHERE UserId = {self._user_id};
|
||||
"""
|
||||
)[0][0]
|
||||
if result is None:
|
||||
return 0
|
||||
return float(result)
|
||||
|
||||
@property
|
||||
def activity(self) -> int:
|
||||
return self._activity
|
||||
|
||||
@activity.setter
|
||||
def activity(self, value: int):
|
||||
self._activity = value
|
||||
|
||||
@property
|
||||
@ServiceProviderABC.inject
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_data.service"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -1,6 +1,8 @@
|
||||
import datetime
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.database.context import DatabaseContextABC
|
||||
from cpl_core.type import T, R
|
||||
from cpl_query.extension import List
|
||||
|
||||
from bot_core.logging.database_logger import DatabaseLogger
|
||||
@@ -38,7 +40,9 @@ class UserRepositoryService(UserRepositoryABC):
|
||||
|
||||
def get_users(self) -> List[User]:
|
||||
self._logger.trace(__name__, f"Send SQL command: {User.get_select_all_string()}")
|
||||
return List(User, [self._from_result(user) for user in self._context.select(User.get_select_all_string())])
|
||||
return List(
|
||||
User, [self._from_result(user) for user in self._context.select(User.get_select_all_string())]
|
||||
).for_each(lambda x: self._set_user_activity(x))
|
||||
|
||||
def get_user_by_id(self, id: int) -> User:
|
||||
self._logger.trace(__name__, f"Send SQL command: {User.get_select_by_id_string(id)}")
|
||||
@@ -77,6 +81,16 @@ class UserRepositoryService(UserRepositoryABC):
|
||||
[self._from_result(user) for user in self._context.select(User.get_select_by_server_id_string(server_id))],
|
||||
)
|
||||
|
||||
def get_users_with_activity_by_server_id(self, server_id: int) -> List[User]:
|
||||
self._logger.trace(
|
||||
__name__,
|
||||
f"Send SQL command: {User.get_select_by_server_id_string(server_id)}",
|
||||
)
|
||||
return List(
|
||||
User,
|
||||
[self._from_result(user) for user in self._context.select(User.get_select_by_server_id_string(server_id))],
|
||||
).for_each(lambda x: self._set_user_activity(x))
|
||||
|
||||
def get_user_by_discord_id_and_server_id(self, discord_id: int, server_id: int) -> User:
|
||||
self._logger.trace(
|
||||
__name__,
|
||||
@@ -109,3 +123,91 @@ class UserRepositoryService(UserRepositoryABC):
|
||||
def delete_user(self, user: User):
|
||||
self._logger.trace(__name__, f"Send SQL command: {user.delete_string}")
|
||||
self._context.cursor.execute(user.delete_string)
|
||||
|
||||
def _set_user_activity(self, user):
|
||||
days = (datetime.date.today() - (datetime.date.today() - datetime.timedelta(days=7))).days
|
||||
query = f"""
|
||||
SELECT (
|
||||
(
|
||||
SELECT Count(UserGotAchievements.CreatedAt)
|
||||
FROM UserGotAchievements
|
||||
INNER JOIN Achievements ON UserGotAchievements.AchievementId = Achievements.Id
|
||||
INNER JOIN Users ON UserGotAchievements.UserId = Users.UserId
|
||||
WHERE Users.ServerId = {user.server.id}
|
||||
AND Users.UserId = {user.id}
|
||||
AND UserGotAchievements.CreatedAt >= "{datetime.date.today() - datetime.timedelta(days=7)}"
|
||||
) +
|
||||
(
|
||||
SELECT SUM(
|
||||
UserMessageCountPerHour.XPCount / (
|
||||
SELECT XpPerMessage
|
||||
FROM CFG_Server
|
||||
WHERE ServerId = {user.server.id}
|
||||
)
|
||||
)
|
||||
FROM UserMessageCountPerHour
|
||||
INNER JOIN Users ON UserMessageCountPerHour.UserId = Users.UserId
|
||||
WHERE Users.ServerId = {user.server.id}
|
||||
AND Users.UserId = {user.id}
|
||||
AND UserMessageCountPerHour.CreatedAt >= "{datetime.date.today() - datetime.timedelta(days=7)}"
|
||||
) +
|
||||
(
|
||||
SELECT Count(UserJoinedVoiceChannel.CreatedAt)
|
||||
FROM UserJoinedVoiceChannel
|
||||
INNER JOIN Users ON UserJoinedVoiceChannel.UserId = Users.UserId
|
||||
WHERE Users.ServerId = {user.server.id}
|
||||
AND Users.UserId = {user.id}
|
||||
AND UserJoinedVoiceChannel.CreatedAt >= "{datetime.date.today() - datetime.timedelta(days=7)}"
|
||||
) +
|
||||
(
|
||||
SELECT IFNULL(ROUND(SUM(TIME_TO_SEC(
|
||||
TIMEDIFF(UserJoinedVoiceChannel.LeavedOn, UserJoinedVoiceChannel.JoinedOn)
|
||||
) / 3600), 2), 0)
|
||||
FROM UserJoinedVoiceChannel
|
||||
INNER JOIN Users ON UserJoinedVoiceChannel.UserId = Users.UserId
|
||||
WHERE Users.ServerId = {user.server.id}
|
||||
AND Users.UserId = {user.id}
|
||||
AND UserJoinedVoiceChannel.CreatedAt >= "{datetime.date.today() - datetime.timedelta(days=7)}"
|
||||
) +
|
||||
(
|
||||
SELECT Count(UserJoinedGameServer.CreatedAt)
|
||||
FROM UserJoinedGameServer
|
||||
INNER JOIN Users ON UserJoinedGameServer.UserId = Users.UserId
|
||||
WHERE Users.ServerId = {user.server.id}
|
||||
AND Users.UserId = {user.id}
|
||||
AND UserJoinedGameServer.CreatedAt >= "{datetime.date.today() - datetime.timedelta(days=7)}"
|
||||
) +
|
||||
(
|
||||
SELECT IFNULL(ROUND(SUM(TIME_TO_SEC(
|
||||
TIMEDIFF(UserJoinedGameServer.LeavedOn, UserJoinedGameServer.JoinedOn)
|
||||
) / 3600), 2), 0)
|
||||
FROM UserJoinedGameServer
|
||||
INNER JOIN Users ON UserJoinedGameServer.UserId = Users.UserId
|
||||
WHERE Users.ServerId = {user.server.id}
|
||||
AND Users.UserId = {user.id}
|
||||
AND UserJoinedGameServer.CreatedAt >= "{datetime.date.today() - datetime.timedelta(days=7)}"
|
||||
) -
|
||||
(
|
||||
SELECT COUNT(UserWarnings.CreatedAt)
|
||||
FROM UserWarnings
|
||||
INNER JOIN Users ON UserWarnings.UserId = Users.UserId
|
||||
WHERE Users.ServerId = {user.server.id}
|
||||
AND Users.UserId = {user.id}
|
||||
AND UserWarnings.CreatedAt >= "{datetime.date.today() - datetime.timedelta(days=7)}"
|
||||
)
|
||||
) / {days} * 1000 as count;
|
||||
"""
|
||||
user.activity = self._cast_query_result(query, int)
|
||||
|
||||
def _cast_query_result(self, query: str, r_type: T) -> Optional[R]:
|
||||
results = self._context.select(query)
|
||||
if len(results) == 0 or len(results[0]) == 0:
|
||||
return None
|
||||
result = results[0][0]
|
||||
default = None
|
||||
if r_type is int or r_type is float:
|
||||
default = 0
|
||||
elif r_type is str:
|
||||
default = ""
|
||||
|
||||
return r_type(result) if result is not None else default
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_graphql"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_graphql.abc"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -12,6 +12,7 @@ from bot_api.exception.service_exception import ServiceException
|
||||
from bot_api.route.route import Route
|
||||
from bot_core.configuration.feature_flags_enum import FeatureFlagsEnum
|
||||
from bot_core.environment_variables import MAINTENANCE
|
||||
from bot_core.service.permission_service import PermissionService
|
||||
from bot_data.model.achievement import Achievement
|
||||
from bot_data.model.auth_role_enum import AuthRoleEnum
|
||||
from bot_data.model.auth_user import AuthUser
|
||||
@@ -32,7 +33,6 @@ from bot_data.model.user_role_enum import UserRoleEnum
|
||||
from bot_graphql.abc.filter_abc import FilterABC
|
||||
from bot_graphql.filter.page import Page
|
||||
from bot_graphql.filter.sort import Sort
|
||||
from modules.permission.service.permission_service import PermissionService
|
||||
|
||||
|
||||
class QueryABC(ObjectType):
|
||||
@@ -64,11 +64,9 @@ class QueryABC(ObjectType):
|
||||
if user == "system" or user.auth_role == AuthRoleEnum.admin:
|
||||
return self._resolve_collection(collection, *args, **kwargs)
|
||||
|
||||
for x in collection.to_list():
|
||||
if not self._can_user_see_element(user, x):
|
||||
collection.remove(x)
|
||||
|
||||
return self._resolve_collection(collection, *args, **kwargs)
|
||||
return self._resolve_collection(
|
||||
collection.where(lambda x: self._can_user_see_element(user, x)), *args, **kwargs
|
||||
)
|
||||
|
||||
self.set_field(f"{name}s", wrapper)
|
||||
self.set_field(f"{name}Count", lambda *args: wrapper(*args).count())
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "1",
|
||||
"Minor": "2",
|
||||
"Micro": "2"
|
||||
"Micro": "3"
|
||||
},
|
||||
"Author": "Sven Heidemann",
|
||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_graphql.filter"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -52,4 +52,5 @@ type Query {
|
||||
discord: Discord
|
||||
|
||||
hasFeatureFlag(flag: String): FeatureFlag
|
||||
featureFlags: [FeatureFlag]
|
||||
}
|
@@ -40,6 +40,7 @@ type Server implements TableWithHistoryQuery {
|
||||
|
||||
config: ServerConfig
|
||||
hasFeatureFlag(flag: String): FeatureFlag
|
||||
featureFlags: [FeatureFlag]
|
||||
|
||||
statistic(date: String): ServerStatistic
|
||||
|
||||
|
@@ -7,7 +7,9 @@ type User implements TableWithHistoryQuery {
|
||||
reactionCount: Int
|
||||
birthday: String
|
||||
ontime: Float
|
||||
gameOntime: Float
|
||||
level: Level
|
||||
activityScore: Int
|
||||
|
||||
joinedServers(filter: UserJoinedServerFilter, page: Page, sort: Sort): [UserJoinedServer]
|
||||
joinedServerCount: Int
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_graphql.model"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_graphql.mutations"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -6,7 +6,7 @@ from bot_data.abc.server_repository_abc import ServerRepositoryABC
|
||||
from bot_data.model.achievement import Achievement
|
||||
from bot_data.model.user_role_enum import UserRoleEnum
|
||||
from bot_graphql.abc.query_abc import QueryABC
|
||||
from modules.permission.service.permission_service import PermissionService
|
||||
from bot_core.service.permission_service import PermissionService
|
||||
|
||||
|
||||
class AchievementMutation(QueryABC):
|
||||
|
@@ -10,7 +10,7 @@ from bot_data.model.scheduled_event import ScheduledEvent
|
||||
from bot_data.model.scheduled_event_interval_enum import ScheduledEventIntervalEnum
|
||||
from bot_data.model.user_role_enum import UserRoleEnum
|
||||
from bot_graphql.abc.query_abc import QueryABC
|
||||
from modules.permission.service.permission_service import PermissionService
|
||||
from bot_core.service.permission_service import PermissionService
|
||||
|
||||
|
||||
class ScheduledEventMutation(QueryABC):
|
||||
|
@@ -13,6 +13,7 @@ from bot_data.model.server_team_role_ids_config import ServerTeamRoleIdsConfig
|
||||
from bot_data.model.team_member_type_enum import TeamMemberTypeEnum
|
||||
from bot_data.model.user_role_enum import UserRoleEnum
|
||||
from bot_graphql.abc.query_abc import QueryABC
|
||||
from bot_core.service.permission_service import PermissionService
|
||||
|
||||
|
||||
class ServerConfigMutation(QueryABC):
|
||||
@@ -24,6 +25,7 @@ class ServerConfigMutation(QueryABC):
|
||||
server_configs: ServerConfigRepositoryABC,
|
||||
db: DatabaseContextABC,
|
||||
config_service: ConfigService,
|
||||
permissions: PermissionService,
|
||||
):
|
||||
QueryABC.__init__(self, "ServerConfigMutation")
|
||||
|
||||
@@ -33,6 +35,7 @@ class ServerConfigMutation(QueryABC):
|
||||
self._server_configs = server_configs
|
||||
self._db = db
|
||||
self._config_service = config_service
|
||||
self._permissions = permissions
|
||||
|
||||
self.set_field("updateServerConfig", self.resolve_update_server_config)
|
||||
|
||||
@@ -175,11 +178,13 @@ class ServerConfigMutation(QueryABC):
|
||||
|
||||
def _update_team_role_ids(self, new_config: ServerConfig):
|
||||
old_config = self._server_configs.get_server_config_by_server(new_config.server.id)
|
||||
has_update = False
|
||||
for role_id in old_config.team_role_ids:
|
||||
if role_id.role_id in new_config.team_role_ids.select(lambda x: int(x.role_id)):
|
||||
continue
|
||||
|
||||
self._server_configs.delete_server_team_role_id_config(role_id)
|
||||
has_update = True
|
||||
|
||||
for role_id in new_config.team_role_ids:
|
||||
guild = self._bot.get_guild(new_config.server.discord_id)
|
||||
@@ -192,3 +197,7 @@ class ServerConfigMutation(QueryABC):
|
||||
continue
|
||||
|
||||
self._server_configs.add_server_team_role_id_config(role_id)
|
||||
has_update = True
|
||||
|
||||
if has_update:
|
||||
self._permissions.reset_cache()
|
||||
|
@@ -6,7 +6,7 @@ from bot_data.abc.short_role_name_repository_abc import ShortRoleNameRepositoryA
|
||||
from bot_data.model.short_role_name import ShortRoleName
|
||||
from bot_data.model.user_role_enum import UserRoleEnum
|
||||
from bot_graphql.abc.query_abc import QueryABC
|
||||
from modules.permission.service.permission_service import PermissionService
|
||||
from bot_core.service.permission_service import PermissionService
|
||||
|
||||
|
||||
class ShortRoleNameMutation(QueryABC):
|
||||
|
@@ -16,6 +16,7 @@ from bot_data.model.technician_ping_url_config import TechnicianPingUrlConfig
|
||||
from bot_data.model.user_role_enum import UserRoleEnum
|
||||
from bot_data.service.technician_config_seeder import TechnicianConfigSeeder
|
||||
from bot_graphql.abc.query_abc import QueryABC
|
||||
from bot_core.service.permission_service import PermissionService
|
||||
|
||||
|
||||
class TechnicianConfigMutation(QueryABC):
|
||||
@@ -30,6 +31,7 @@ class TechnicianConfigMutation(QueryABC):
|
||||
config_service: ConfigService,
|
||||
tech_seeder: TechnicianConfigSeeder,
|
||||
client_utils: ClientUtilsABC,
|
||||
permissions: PermissionService,
|
||||
):
|
||||
QueryABC.__init__(self, "TechnicianConfigMutation")
|
||||
|
||||
@@ -42,6 +44,7 @@ class TechnicianConfigMutation(QueryABC):
|
||||
self._config_service = config_service
|
||||
self._tech_seeder = tech_seeder
|
||||
self._client_utils = client_utils
|
||||
self._permissions = permissions
|
||||
|
||||
self.set_field("updateTechnicianConfig", self.resolve_update_technician_config)
|
||||
|
||||
@@ -126,11 +129,13 @@ class TechnicianConfigMutation(QueryABC):
|
||||
|
||||
def _update_technician_ids(self, new_config: TechnicianConfig):
|
||||
old_config = self._technician_configs.get_technician_config()
|
||||
has_update = False
|
||||
for technician_id in old_config.technician_ids:
|
||||
if technician_id in new_config.technician_ids:
|
||||
continue
|
||||
|
||||
self._technician_configs.delete_technician_id_config(TechnicianIdConfig(technician_id))
|
||||
has_update = True
|
||||
|
||||
for technician_id in new_config.technician_ids:
|
||||
user = self._bot.get_user(technician_id)
|
||||
@@ -142,3 +147,7 @@ class TechnicianConfigMutation(QueryABC):
|
||||
continue
|
||||
|
||||
self._technician_configs.add_technician_id_config(TechnicianIdConfig(technician_id))
|
||||
has_update = True
|
||||
|
||||
if has_update:
|
||||
self._permissions.reset_cache()
|
||||
|
@@ -24,7 +24,7 @@ from bot_data.model.server_config import ServerConfig
|
||||
from bot_data.model.user_joined_game_server import UserJoinedGameServer
|
||||
from bot_data.model.user_role_enum import UserRoleEnum
|
||||
from bot_graphql.abc.query_abc import QueryABC
|
||||
from modules.permission.service.permission_service import PermissionService
|
||||
from bot_core.service.permission_service import PermissionService
|
||||
|
||||
|
||||
class UserJoinedGameServerMutation(QueryABC):
|
||||
|
@@ -13,7 +13,7 @@ from bot_data.model.user_role_enum import UserRoleEnum
|
||||
from bot_graphql.abc.query_abc import QueryABC
|
||||
from modules.base.service.user_warnings_service import UserWarningsService
|
||||
from modules.level.service.level_service import LevelService
|
||||
from modules.permission.service.permission_service import PermissionService
|
||||
from bot_core.service.permission_service import PermissionService
|
||||
|
||||
|
||||
class UserMutation(QueryABC):
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_graphql.queries"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "bot_graphql.queries.discord"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -86,7 +86,7 @@ class ServerQuery(DataQueryWithHistoryABC):
|
||||
)
|
||||
self.add_collection(
|
||||
"user",
|
||||
lambda server, *_: self._users.get_users_by_server_id(server.id),
|
||||
lambda server, *_: self._users.get_users_with_activity_by_server_id(server.id),
|
||||
UserFilter,
|
||||
)
|
||||
self.add_collection(
|
||||
@@ -116,6 +116,10 @@ class ServerQuery(DataQueryWithHistoryABC):
|
||||
"hasFeatureFlag",
|
||||
lambda server, *_, **kwargs: self._resolve_has_feature_flag(server, *_, **kwargs),
|
||||
)
|
||||
self.set_field(
|
||||
"featureFlags",
|
||||
lambda server, *_, **kwargs: self._resolve_feature_flags(server, *_),
|
||||
)
|
||||
self.set_field("statistic", lambda server, *_, **kwargs: ServerStatistics(server, kwargs))
|
||||
|
||||
@staticmethod
|
||||
@@ -142,3 +146,13 @@ class ServerQuery(DataQueryWithHistoryABC):
|
||||
"key": kwargs["flag"],
|
||||
"value": FeatureFlagsSettings.get_flag_from_dict(settings.feature_flags, FeatureFlagsEnum(kwargs["flag"])),
|
||||
}
|
||||
|
||||
def _resolve_feature_flags(self, server: Server, *_) -> list[dict]:
|
||||
settings: ServerConfig = self._config.get_configuration(f"ServerConfig_{server.discord_id}")
|
||||
return [
|
||||
{
|
||||
"key": flag,
|
||||
"value": FeatureFlagsSettings.get_flag_from_dict(settings.feature_flags, FeatureFlagsEnum(flag)),
|
||||
}
|
||||
for flag in [e.value for e in FeatureFlagsEnum]
|
||||
]
|
||||
|
@@ -114,7 +114,9 @@ class ServerStatisticQuery(QueryABC):
|
||||
|
||||
def _resolve_voice_channel_ontime(self, server, *_):
|
||||
query = f"""
|
||||
SELECT ROUND(SUM(TIME_TO_SEC(TIMEDIFF(UserJoinedVoiceChannel.LeavedOn, UserJoinedVoiceChannel.JoinedOn)) / 3600),{server.server.id}) FROM UserJoinedVoiceChannel
|
||||
SELECT IFNULL(ROUND(SUM(
|
||||
TIME_TO_SEC(TIMEDIFF(UserJoinedVoiceChannel.LeavedOn, UserJoinedVoiceChannel.JoinedOn)) / 3600
|
||||
), 2), 0) FROM UserJoinedVoiceChannel
|
||||
INNER JOIN Users ON UserJoinedVoiceChannel.UserId = Users.UserId
|
||||
WHERE Users.ServerId = {server.server.id}
|
||||
AND UserJoinedVoiceChannel.CreatedAt >= "{self._get_date(**server.kwargs)}";
|
||||
@@ -132,7 +134,10 @@ class ServerStatisticQuery(QueryABC):
|
||||
|
||||
def _resolve_game_server_ontime(self, server, *_):
|
||||
query = f"""
|
||||
SELECT ROUND(SUM(TIME_TO_SEC(TIMEDIFF(UserJoinedGameServer.LeavedOn, UserJoinedGameServer.JoinedOn)) / 3600),{server.server.id}) FROM UserJoinedGameServer
|
||||
SELECT IFNULL(ROUND(SUM(
|
||||
TIME_TO_SEC(TIMEDIFF(UserJoinedGameServer.LeavedOn, UserJoinedGameServer.JoinedOn)) / 3600
|
||||
), 2), 0)
|
||||
FROM UserJoinedGameServer
|
||||
INNER JOIN Users ON UserJoinedGameServer.UserId = Users.UserId
|
||||
WHERE Users.ServerId = {server.server.id}
|
||||
AND UserJoinedGameServer.CreatedAt >= "{self._get_date(**server.kwargs)}";
|
||||
|
@@ -2,6 +2,7 @@ from cpl_core.database.context import DatabaseContextABC
|
||||
from cpl_discord.service import DiscordBotServiceABC
|
||||
|
||||
from bot_core.abc.client_utils_abc import ClientUtilsABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_data.abc.achievement_repository_abc import AchievementRepositoryABC
|
||||
from bot_data.abc.user_joined_game_server_repository_abc import (
|
||||
UserJoinedGameServerRepositoryABC,
|
||||
@@ -11,7 +12,6 @@ from bot_data.abc.user_joined_voice_channel_repository_abc import (
|
||||
UserJoinedVoiceChannelRepositoryABC,
|
||||
)
|
||||
from bot_data.abc.user_warnings_repository_abc import UserWarningsRepositoryABC
|
||||
from bot_data.model.user import User
|
||||
from bot_data.model.user_history import UserHistory
|
||||
from bot_graphql.abc.data_query_with_history_abc import DataQueryWithHistoryABC
|
||||
from bot_graphql.filter.achievement_filter import AchievementFilter
|
||||
@@ -22,7 +22,6 @@ from bot_graphql.filter.user_joined_voice_channel_filter import (
|
||||
)
|
||||
from bot_graphql.filter.user_warning_filter import UserWarningFilter
|
||||
from modules.level.service.level_service import LevelService
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class UserQuery(DataQueryWithHistoryABC):
|
||||
@@ -50,15 +49,17 @@ class UserQuery(DataQueryWithHistoryABC):
|
||||
self._permissions = permissions
|
||||
self._achievements = achievements
|
||||
|
||||
self.set_field("id", self.resolve_id)
|
||||
self.set_field("discordId", self.resolve_discord_id)
|
||||
self.set_field("name", self.resolve_name)
|
||||
self.set_field("xp", self.resolve_xp)
|
||||
self.set_field("id", lambda user, *_: user.id)
|
||||
self.set_field("discordId", lambda user, *_: user.discord_id)
|
||||
self.set_field("name", lambda user, *_: user.name)
|
||||
self.set_field("xp", lambda user, *_: user.xp)
|
||||
self.set_field("messageCount", lambda x, *_: x.message_count)
|
||||
self.set_field("reactionCount", lambda x, *_: x.reaction_count)
|
||||
self.set_field("birthday", lambda x, *_: None if x.birthday is None else x.birthday.strftime("%d.%m.%Y"))
|
||||
self.set_field("ontime", self.resolve_ontime)
|
||||
self.set_field("level", self.resolve_level)
|
||||
self.set_field("ontime", lambda user, *_: user.ontime)
|
||||
self.set_field("gameOntime", lambda user, *_: user.game_ontime)
|
||||
self.set_field("level", lambda user, *_: user.level)
|
||||
self.set_field("activityScore", lambda user, *_: user.activity)
|
||||
self.add_collection(
|
||||
"joinedServer",
|
||||
lambda user, *_: self._ujs.get_user_joined_servers_by_user_id(user.id),
|
||||
@@ -85,37 +86,5 @@ class UserQuery(DataQueryWithHistoryABC):
|
||||
UserWarningFilter,
|
||||
)
|
||||
|
||||
self.set_field("server", self.resolve_server)
|
||||
self.set_field("leftServer", self.resolve_left_server)
|
||||
|
||||
@staticmethod
|
||||
def resolve_id(user: User, *_):
|
||||
return user.id
|
||||
|
||||
@staticmethod
|
||||
def resolve_discord_id(user: User, *_):
|
||||
return user.discord_id
|
||||
|
||||
@staticmethod
|
||||
def resolve_name(user: User, *_):
|
||||
return user.name
|
||||
|
||||
@staticmethod
|
||||
def resolve_xp(user: User, *_):
|
||||
return user.xp
|
||||
|
||||
@staticmethod
|
||||
def resolve_ontime(user: User, *_):
|
||||
return user.ontime
|
||||
|
||||
@staticmethod
|
||||
def resolve_level(user: User, *_):
|
||||
return user.level
|
||||
|
||||
@staticmethod
|
||||
def resolve_server(user: User, *_):
|
||||
return user.server
|
||||
|
||||
@staticmethod
|
||||
def resolve_left_server(user: User, *_):
|
||||
return user.left_server
|
||||
self.set_field("server", lambda user, *_: user.server)
|
||||
self.set_field("leftServer", lambda user, *_: user.left_server)
|
||||
|
@@ -131,6 +131,10 @@ class Query(QueryABC):
|
||||
"hasFeatureFlag",
|
||||
lambda *_, **kwargs: self._resolve_has_feature_flag(*_, **kwargs),
|
||||
)
|
||||
self.set_field(
|
||||
"featureFlags",
|
||||
lambda *_, **kwargs: self._resolve_feature_flags(*_),
|
||||
)
|
||||
|
||||
def _resolve_has_feature_flag(self, *_, **kwargs):
|
||||
settings: TechnicianConfig = self._config.get_configuration(TechnicianConfig)
|
||||
@@ -140,3 +144,13 @@ class Query(QueryABC):
|
||||
"key": kwargs["flag"],
|
||||
"value": FeatureFlagsSettings.get_flag_from_dict(settings.feature_flags, FeatureFlagsEnum(kwargs["flag"])),
|
||||
}
|
||||
|
||||
def _resolve_feature_flags(self, *_) -> list[dict]:
|
||||
settings: TechnicianConfig = self._config.get_configuration(TechnicianConfig)
|
||||
return [
|
||||
{
|
||||
"key": flag,
|
||||
"value": FeatureFlagsSettings.get_flag_from_dict(settings.feature_flags, FeatureFlagsEnum(flag)),
|
||||
}
|
||||
for flag in [e.value for e in FeatureFlagsEnum]
|
||||
]
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.achievements"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "1",
|
||||
"Minor": "2",
|
||||
"Micro": "2"
|
||||
"Micro": "3"
|
||||
},
|
||||
"Author": "Sven Heidemann",
|
||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.achievements.commands"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.achievements.events"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.achievements.model"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.auto_role"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "1",
|
||||
"Minor": "2",
|
||||
"Micro": "2"
|
||||
"Micro": "3"
|
||||
},
|
||||
"Author": "",
|
||||
"AuthorEmail": "",
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.auto_role.command"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -22,7 +22,7 @@ from bot_data.abc.server_repository_abc import ServerRepositoryABC
|
||||
from bot_data.model.auto_role import AutoRole
|
||||
from bot_data.model.auto_role_rule import AutoRoleRule
|
||||
from bot_data.model.server_config import ServerConfig
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class AutoRoleGroup(DiscordCommandABC):
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.auto_role.events"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.auto_role.helper"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.base"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "1",
|
||||
"Minor": "2",
|
||||
"Micro": "2"
|
||||
"Micro": "3"
|
||||
},
|
||||
"Author": "",
|
||||
"AuthorEmail": "",
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.base.command"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -23,7 +23,7 @@ from bot_data.abc.user_game_ident_repository_abc import UserGameIdentRepositoryA
|
||||
from bot_data.abc.user_repository_abc import UserRepositoryABC
|
||||
from bot_data.model.game_server import GameServer
|
||||
from bot_data.model.server_config import ServerConfig
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class GameServerGroup(DiscordCommandABC):
|
||||
|
@@ -11,7 +11,7 @@ from bot_core.helper.command_checks import CommandChecks
|
||||
from bot_core.logging.command_logger import CommandLogger
|
||||
from bot_data.abc.server_repository_abc import ServerRepositoryABC
|
||||
from bot_data.model.technician_config import TechnicianConfig
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class PingCommand(DiscordCommandABC):
|
||||
|
@@ -11,7 +11,7 @@ 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
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class PurgeCommand(DiscordCommandABC):
|
||||
|
@@ -27,7 +27,7 @@ from bot_data.abc.user_warnings_repository_abc import UserWarningsRepositoryABC
|
||||
from bot_data.model.server_config import ServerConfig
|
||||
from modules.base.service.user_warnings_service import UserWarningsService
|
||||
from modules.level.service.level_service import LevelService
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class UserGroup(DiscordCommandABC):
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.base.events"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -20,7 +20,7 @@ from bot_data.model.known_user import KnownUser
|
||||
from bot_data.model.server_config import ServerConfig
|
||||
from bot_data.model.user import User
|
||||
from bot_data.model.user_joined_server import UserJoinedServer
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class BaseOnMemberJoinEvent(OnMemberJoinABC):
|
||||
|
@@ -8,7 +8,7 @@ from bot_core.abc.message_service_abc import MessageServiceABC
|
||||
from bot_core.helper.event_checks import EventChecks
|
||||
from bot_data.abc.server_repository_abc import ServerRepositoryABC
|
||||
from bot_data.model.server_config import ServerConfig
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class BaseOnVoiceStateUpdateEventHelpChannel(OnVoiceStateUpdateABC):
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.base.forms"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.base.helper"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.base.model"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.base.service"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
@@ -14,7 +14,7 @@ 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
|
||||
from modules.permission.abc.permission_service_abc import PermissionServiceABC
|
||||
from bot_core.abc.permission_service_abc import PermissionServiceABC
|
||||
|
||||
|
||||
class UserWarningsService:
|
||||
|
@@ -15,7 +15,7 @@ __title__ = "modules.base.tasks"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="2")
|
||||
version_info = VersionInfo(major="1", minor="2", micro="3")
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user