From 709767c3a081585a664ed52e4da47831dfdc315f Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 30 Sep 2022 17:03:44 +0200 Subject: [PATCH] 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