From 709767c3a081585a664ed52e4da47831dfdc315f Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 30 Sep 2022 17:03:44 +0200 Subject: [PATCH 1/2] First fixes #38 --- src/bot/bot.json | 4 +- .../config/appsettings.edrafts-pc-ubuntu.json | 59 +++++++++++++++++++ src/bot/main.py | 2 + .../user_joined_voice_channel_service.py | 2 +- 4 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 src/bot/config/appsettings.edrafts-pc-ubuntu.json diff --git a/src/bot/bot.json b/src/bot/bot.json index e744e3b3..0fa1408b 100644 --- a/src/bot/bot.json +++ b/src/bot/bot.json @@ -17,8 +17,8 @@ "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ "cpl-core>=2022.7.0.post4", - "cpl-translation==2022.7.0.post2", - "cpl-query==2022.7.0", + "cpl-translation==2022.10rc2", + "cpl-query==2022.10rc2", "cpl-discord==2022.7.0.post4" ], "DevDependencies": [ diff --git a/src/bot/config/appsettings.edrafts-pc-ubuntu.json b/src/bot/config/appsettings.edrafts-pc-ubuntu.json new file mode 100644 index 00000000..8c26c3ea --- /dev/null +++ b/src/bot/config/appsettings.edrafts-pc-ubuntu.json @@ -0,0 +1,59 @@ +{ + "LoggingSettings": { + "Path": "logs/", + "Filename": "log_dev.log", + "ConsoleLogLevel": "DEBUG", + "FileLogLevel": "TRACE" + }, + "DatabaseSettings": { + "Host": "localhost", + "User": "kd_kdb", + "Password": "VGpZcihrb0N2T2MyZUlURQ==", + "Database": "keksdose_bot_dev", + "Charset": "utf8mb4", + "UseUnicode": "true", + "Buffered": "true", + "AuthPlugin": "mysql_native_password" + }, + "DiscordBot": { + "Token": "OTk4MTYwNDI3Njg5MTgxMjM3.GI7h67.BqD6Lu1Tz0MuG8iktYrcLnHi1pNozyMiWFGTKI", + "Prefix": "!ke " + }, + "Bot": { + "910199451145076828": { + "MessageDeleteTimer": 2 + }, + "Technicians": [ + 240160344557879316 + ], + "DeployFilesPath": "../../deploy" + }, + "Base": { + "910199451145076828": { + "MaxVoiceStateHours": 24, + "XpPerMessage": 2, + "XpPerOntimeHour": 4, + "AFKChannelIds": [ + 910199452915093593, + 910199452915093594 + ], + "AFKCommandChannelId": 910199452915093594, + "HelpCommandReferenceUrl": "https://git.sh-edraft.de/sh-edraft.de/kd_discord_bot/wiki/Befehle" + } + }, + "BootLog": { + "910199451145076828": { + "LoginMessageChannelId": "910199452915093588" + } + }, + "Permission": { + "910199451145076828": { + "AdminRoleIds": [ + 925072155203477584 + ], + "ModeratorRoleIds": [ + 925072209884635167 + ] + } + } +} diff --git a/src/bot/main.py b/src/bot/main.py index c2e53cf0..0bfb5a82 100644 --- a/src/bot/main.py +++ b/src/bot/main.py @@ -28,6 +28,8 @@ class Program: await self.app.run_async() async def stop(self): + if self.app is None: + return await self.app.stop_async() diff --git a/src/bot_data/service/user_joined_voice_channel_service.py b/src/bot_data/service/user_joined_voice_channel_service.py index bbcb3c99..05e98244 100644 --- a/src/bot_data/service/user_joined_voice_channel_service.py +++ b/src/bot_data/service/user_joined_voice_channel_service.py @@ -2,7 +2,7 @@ from typing import Optional from cpl_core.database.context import DatabaseContextABC from cpl_core.logging import LoggerABC -from cpl_query.extension import List, IterableABC +from cpl_query.extension import List from bot_data.abc.user_repository_abc import UserRepositoryABC from bot_data.model.user_joined_voice_channel import UserJoinedVoiceChannel -- 2.45.2 From b936e569aa0995d9ac64342362baede45cb81ce2 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 30 Sep 2022 17:24:02 +0200 Subject: [PATCH 2/2] Build new version and fixed deps #38 --- src/bot/__init__.py | 4 ++-- src/bot/bot.json | 14 +++++++------- src/bot_core/__init__.py | 4 ++-- src/bot_core/abc/__init__.py | 4 ++-- src/bot_core/bot-core.json | 6 +++--- src/bot_core/configuration/__init__.py | 4 ++-- src/bot_core/pipes/__init__.py | 4 ++-- src/bot_core/service/__init__.py | 4 ++-- src/bot_data/__init__.py | 4 ++-- src/bot_data/abc/__init__.py | 4 ++-- src/bot_data/bot-data.json | 6 +++--- src/bot_data/migration/__init__.py | 4 ++-- src/bot_data/model/__init__.py | 4 ++-- src/bot_data/service/__init__.py | 4 ++-- src/modules/admin/__init__.py | 4 ++-- src/modules/admin/admin.json | 4 ++-- src/modules/admin/command/__init__.py | 4 ++-- src/modules/base/__init__.py | 4 ++-- src/modules/base/abc/__init__.py | 4 ++-- src/modules/base/base.json | 4 ++-- src/modules/base/command/__init__.py | 4 ++-- src/modules/base/configuration/__init__.py | 4 ++-- src/modules/base/events/__init__.py | 4 ++-- src/modules/base/service/__init__.py | 4 ++-- src/modules/boot_log/__init__.py | 4 ++-- src/modules/boot_log/boot-log.json | 4 ++-- src/modules/boot_log/configuration/__init__.py | 4 ++-- src/modules/database/__init__.py | 4 ++-- src/modules/database/database.json | 4 ++-- src/modules/database/database_on_ready_event.py | 10 +++++++--- src/modules/moderator/__init__.py | 4 ++-- src/modules/moderator/command/__init__.py | 4 ++-- src/modules/moderator/moderator.json | 4 ++-- src/modules/permission/__init__.py | 4 ++-- src/modules/permission/abc/__init__.py | 4 ++-- src/modules/permission/configuration/__init__.py | 4 ++-- src/modules/permission/events/__init__.py | 4 ++-- src/modules/permission/permission.json | 4 ++-- src/modules/permission/service/__init__.py | 4 ++-- 39 files changed, 90 insertions(+), 86 deletions(-) diff --git a/src/bot/__init__.py b/src/bot/__init__.py index e28eb092..30520581 100644 --- a/src/bot/__init__.py +++ b/src/bot/__init__.py @@ -15,7 +15,7 @@ __title__ = 'bot' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/bot/bot.json b/src/bot/bot.json index 0fa1408b..1ebf34f1 100644 --- a/src/bot/bot.json +++ b/src/bot/bot.json @@ -3,8 +3,8 @@ "Name": "bot", "Version": { "Major": "0", - "Minor": "1", - "Micro": "14" + "Minor": "2", + "Micro": "0" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,13 +16,13 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.7.0.post4", - "cpl-translation==2022.10rc2", - "cpl-query==2022.10rc2", - "cpl-discord==2022.7.0.post4" + "cpl-core>=2022.10.0", + "cpl-translation>=2022.10.0", + "cpl-query>=2022.10.0", + "cpl-discord>=2022.10.0" ], "DevDependencies": [ - "cpl-cli>=2022.7.0.post2" + "cpl-cli>=2022.10.0" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/bot_core/__init__.py b/src/bot_core/__init__.py index 04df7d2e..6ba98ff0 100644 --- a/src/bot_core/__init__.py +++ b/src/bot_core/__init__.py @@ -15,7 +15,7 @@ __title__ = 'bot_core' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/bot_core/abc/__init__.py b/src/bot_core/abc/__init__.py index 469d543f..aac72ca3 100644 --- a/src/bot_core/abc/__init__.py +++ b/src/bot_core/abc/__init__.py @@ -15,7 +15,7 @@ __title__ = 'bot_core.abc' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/bot_core/bot-core.json b/src/bot_core/bot-core.json index 93f908da..6720bf0f 100644 --- a/src/bot_core/bot-core.json +++ b/src/bot_core/bot-core.json @@ -4,7 +4,7 @@ "Version": { "Major": "1", "Minor": "0", - "Micro": "0.dev1" + "Micro": "0" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,10 +16,10 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.7.0" + "cpl-core>=2022.10.0" ], "DevDependencies": [ - "cpl-cli>=2022.7.0" + "cpl-cli>=2022.10.0" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/bot_core/configuration/__init__.py b/src/bot_core/configuration/__init__.py index fe1b32c3..5c540e04 100644 --- a/src/bot_core/configuration/__init__.py +++ b/src/bot_core/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'bot_core.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/bot_core/pipes/__init__.py b/src/bot_core/pipes/__init__.py index 08d99b3d..381e147f 100644 --- a/src/bot_core/pipes/__init__.py +++ b/src/bot_core/pipes/__init__.py @@ -15,7 +15,7 @@ __title__ = 'bot_core.pipes' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/bot_core/service/__init__.py b/src/bot_core/service/__init__.py index 0b9970fd..1775598a 100644 --- a/src/bot_core/service/__init__.py +++ b/src/bot_core/service/__init__.py @@ -15,7 +15,7 @@ __title__ = 'bot_core.service' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/bot_data/__init__.py b/src/bot_data/__init__.py index ada79234..526ef397 100644 --- a/src/bot_data/__init__.py +++ b/src/bot_data/__init__.py @@ -15,7 +15,7 @@ __title__ = 'bot_data' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/bot_data/abc/__init__.py b/src/bot_data/abc/__init__.py index b555931a..6d4ca870 100644 --- a/src/bot_data/abc/__init__.py +++ b/src/bot_data/abc/__init__.py @@ -15,7 +15,7 @@ __title__ = 'bot_data.abc' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/bot_data/bot-data.json b/src/bot_data/bot-data.json index 0a328b86..e92af7de 100644 --- a/src/bot_data/bot-data.json +++ b/src/bot_data/bot-data.json @@ -4,7 +4,7 @@ "Version": { "Major": "1", "Minor": "0", - "Micro": "0.dev1" + "Micro": "0" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,10 +16,10 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.7.0" + "cpl-core>=2022.10.0" ], "DevDependencies": [ - "cpl-cli>=2022.7.0.post1" + "cpl-cli>=2022.10.0" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/bot_data/migration/__init__.py b/src/bot_data/migration/__init__.py index 7c59b5bc..40311e46 100644 --- a/src/bot_data/migration/__init__.py +++ b/src/bot_data/migration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'bot_data.migration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/bot_data/model/__init__.py b/src/bot_data/model/__init__.py index 2ae9de94..35cd1af1 100644 --- a/src/bot_data/model/__init__.py +++ b/src/bot_data/model/__init__.py @@ -15,7 +15,7 @@ __title__ = 'bot_data.model' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/bot_data/service/__init__.py b/src/bot_data/service/__init__.py index 37813919..f268cc0a 100644 --- a/src/bot_data/service/__init__.py +++ b/src/bot_data/service/__init__.py @@ -15,7 +15,7 @@ __title__ = 'bot_data.service' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/admin/__init__.py b/src/modules/admin/__init__.py index 99a9b9f9..daf704dd 100644 --- a/src/modules/admin/__init__.py +++ b/src/modules/admin/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.admin' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/admin/admin.json b/src/modules/admin/admin.json index 6c2ac50b..446e16f3 100644 --- a/src/modules/admin/admin.json +++ b/src/modules/admin/admin.json @@ -16,10 +16,10 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.7.0.post5" + "cpl-core>=2022.10.0.post5" ], "DevDependencies": [ - "cpl-cli>=2022.7.0.post2" + "cpl-cli>=2022.10.0" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/modules/admin/command/__init__.py b/src/modules/admin/command/__init__.py index 6e758476..6ebd80ad 100644 --- a/src/modules/admin/command/__init__.py +++ b/src/modules/admin/command/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.admin.command' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/base/__init__.py b/src/modules/base/__init__.py index f843d189..b89988ff 100644 --- a/src/modules/base/__init__.py +++ b/src/modules/base/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.base' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/base/abc/__init__.py b/src/modules/base/abc/__init__.py index 7a9d5ca9..ac238cec 100644 --- a/src/modules/base/abc/__init__.py +++ b/src/modules/base/abc/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.base.abc' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/base/base.json b/src/modules/base/base.json index 47c6c442..4371622c 100644 --- a/src/modules/base/base.json +++ b/src/modules/base/base.json @@ -16,10 +16,10 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.7.0.post2" + "cpl-core>=2022.10.0.post2" ], "DevDependencies": [ - "cpl-cli>=2022.7.0.post2" + "cpl-cli>=2022.10.0" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/modules/base/command/__init__.py b/src/modules/base/command/__init__.py index 18fcb380..c38e8b4e 100644 --- a/src/modules/base/command/__init__.py +++ b/src/modules/base/command/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.base.command' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/base/configuration/__init__.py b/src/modules/base/configuration/__init__.py index 11a799ad..973a4814 100644 --- a/src/modules/base/configuration/__init__.py +++ b/src/modules/base/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.base.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/base/events/__init__.py b/src/modules/base/events/__init__.py index a6eae56a..5d993630 100644 --- a/src/modules/base/events/__init__.py +++ b/src/modules/base/events/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.base.events' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/base/service/__init__.py b/src/modules/base/service/__init__.py index 448a2cf2..24e4a38c 100644 --- a/src/modules/base/service/__init__.py +++ b/src/modules/base/service/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.base.service' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/boot_log/__init__.py b/src/modules/boot_log/__init__.py index be817848..4cb82f60 100644 --- a/src/modules/boot_log/__init__.py +++ b/src/modules/boot_log/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.boot_log' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/boot_log/boot-log.json b/src/modules/boot_log/boot-log.json index a60ba335..bf1e0b5b 100644 --- a/src/modules/boot_log/boot-log.json +++ b/src/modules/boot_log/boot-log.json @@ -16,10 +16,10 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.7.0.post2" + "cpl-core>=2022.10.0.post2" ], "DevDependencies": [ - "cpl-cli>=2022.7.0.post2" + "cpl-cli>=2022.10.0" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/modules/boot_log/configuration/__init__.py b/src/modules/boot_log/configuration/__init__.py index 766c534b..307f52fb 100644 --- a/src/modules/boot_log/configuration/__init__.py +++ b/src/modules/boot_log/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.boot_log.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/database/__init__.py b/src/modules/database/__init__.py index 3f729c4c..5ffb50d2 100644 --- a/src/modules/database/__init__.py +++ b/src/modules/database/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.database' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/database/database.json b/src/modules/database/database.json index 1107ef1c..efcaea3f 100644 --- a/src/modules/database/database.json +++ b/src/modules/database/database.json @@ -16,10 +16,10 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.7.0.post2" + "cpl-core>=2022.10.0.post2" ], "DevDependencies": [ - "cpl-cli>=2022.7.0.post2" + "cpl-cli>=2022.10.0" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/modules/database/database_on_ready_event.py b/src/modules/database/database_on_ready_event.py index dba4ba46..fab4dc0a 100644 --- a/src/modules/database/database_on_ready_event.py +++ b/src/modules/database/database_on_ready_event.py @@ -8,6 +8,7 @@ from cpl_core.logging import LoggerABC from cpl_discord.events import OnReadyABC from cpl_discord.service import DiscordBotServiceABC +from bot_core.pipes.date_time_offset_pipe import DateTimeOffsetPipe from bot_data.abc.client_repository_abc import ClientRepositoryABC from bot_data.abc.known_user_repository_abc import KnownUserRepositoryABC from bot_data.abc.user_joined_server_repository_abc import UserJoinedServerRepositoryABC @@ -20,6 +21,7 @@ from bot_data.model.user import User from bot_data.model.user_joined_server import UserJoinedServer from bot_data.model.user_joined_voice_channel import UserJoinedVoiceChannel from bot_data.service.user_repository_service import ServerRepositoryABC +from modules.base.configuration.base_server_settings import BaseServerSettings class DatabaseOnReadyEvent(OnReadyABC): @@ -35,7 +37,8 @@ class DatabaseOnReadyEvent(OnReadyABC): client_repo: ClientRepositoryABC, known_users: KnownUserRepositoryABC, user_joins: UserJoinedServerRepositoryABC, - user_joins_vc: UserJoinedVoiceChannelRepositoryABC + user_joins_vc: UserJoinedVoiceChannelRepositoryABC, + dtp: DateTimeOffsetPipe ): self._config = config @@ -48,6 +51,7 @@ class DatabaseOnReadyEvent(OnReadyABC): self._known_users = known_users self._user_joins = user_joins self._user_joins_vc = user_joins_vc + self._dtp = dtp OnReadyABC.__init__(self) self._logger.info(__name__, f'Module {type(self)} loaded') @@ -213,7 +217,7 @@ class DatabaseOnReadyEvent(OnReadyABC): m: discord.Member = u self._logger.warn(__name__, f'Active UserJoinedServer not found in database: {guild.id}:{u.id}@{m.joined_at}') self._logger.debug(__name__, f'Add UserJoinedServer: {guild.id}:{u.id}@{m.joined_at}') - self._user_joins.add_user_joined_server(UserJoinedServer(user, m.joined_at, None)) + self._user_joins.add_user_joined_server(UserJoinedServer(user, self._dtp.transform(m.joined_at), None)) self._db_context.save_changes() self._logger.debug(__name__, f'Added UserJoinedServer: {u.id}') @@ -267,7 +271,7 @@ class DatabaseOnReadyEvent(OnReadyABC): for join in joins: self._logger.warn(__name__, f'Active UserJoinedVoiceChannel found in database: {guild.id}:{member.id}@{join.joined_on}') join.leaved_on = datetime.now() - settings: BaseSettings = self._config.get_configuration(f'BaseServerSettings_{guild.id}') + settings: BaseServerSettings = self._config.get_configuration(f'BaseServerSettings_{guild.id}') if ((join.leaved_on - join.joined_on).total_seconds() / 60 / 60) > settings.max_voice_state_hours: join.leaved_on = join.joined_on + timedelta(hours=settings.max_voice_state_hours) diff --git a/src/modules/moderator/__init__.py b/src/modules/moderator/__init__.py index ffc4f675..613869fb 100644 --- a/src/modules/moderator/__init__.py +++ b/src/modules/moderator/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.moderator' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/moderator/command/__init__.py b/src/modules/moderator/command/__init__.py index 023daf5f..17bf6f16 100644 --- a/src/modules/moderator/command/__init__.py +++ b/src/modules/moderator/command/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.moderator.command' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/moderator/moderator.json b/src/modules/moderator/moderator.json index d4e025be..45dca24c 100644 --- a/src/modules/moderator/moderator.json +++ b/src/modules/moderator/moderator.json @@ -16,10 +16,10 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.7.0.post5" + "cpl-core>=2022.10.0.post5" ], "DevDependencies": [ - "cpl-cli>=2022.7.0.post2" + "cpl-cli>=2022.10.0" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/modules/permission/__init__.py b/src/modules/permission/__init__.py index 8b59ce1c..58467172 100644 --- a/src/modules/permission/__init__.py +++ b/src/modules/permission/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.permission' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/permission/abc/__init__.py b/src/modules/permission/abc/__init__.py index 01cd49b4..c78ae287 100644 --- a/src/modules/permission/abc/__init__.py +++ b/src/modules/permission/abc/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.permission.abc' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/permission/configuration/__init__.py b/src/modules/permission/configuration/__init__.py index f0482d9f..aab3d9e0 100644 --- a/src/modules/permission/configuration/__init__.py +++ b/src/modules/permission/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.permission.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/permission/events/__init__.py b/src/modules/permission/events/__init__.py index 4935e287..3cad9c9d 100644 --- a/src/modules/permission/events/__init__.py +++ b/src/modules/permission/events/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.permission.events' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') diff --git a/src/modules/permission/permission.json b/src/modules/permission/permission.json index 324f1ec1..f5c96087 100644 --- a/src/modules/permission/permission.json +++ b/src/modules/permission/permission.json @@ -16,10 +16,10 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.7.0.post2" + "cpl-core>=2022.10.0.post2" ], "DevDependencies": [ - "cpl-cli>=2022.7.0.post2" + "cpl-cli>=2022.10.0" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/modules/permission/service/__init__.py b/src/modules/permission/service/__init__.py index a30dfa9c..d3071613 100644 --- a/src/modules/permission/service/__init__.py +++ b/src/modules/permission/service/__init__.py @@ -15,7 +15,7 @@ __title__ = 'modules.permission.service' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2022 sh-edraft.de' -__version__ = '0.1.14' +__version__ = '0.2.0' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='0', minor='1', micro='14') +version_info = VersionInfo(major='0', minor='2', micro='0') -- 2.45.2