13 Commits

Author SHA1 Message Date
aa0bed80ce fixed typo
All checks were successful
Deploy prod on push / pre-build (push) Successful in 2s
Deploy prod on push / build-bot (push) Successful in 2m42s
Deploy prod on push / build-web (push) Successful in 1m54s
Deploy prod on push / deploy (push) Successful in 20s
2025-01-23 21:48:57 +01:00
d0b4a390f0 Handle realm names better
All checks were successful
Deploy prod on push / pre-build (push) Successful in 2s
Deploy prod on push / build-bot (push) Successful in 2m34s
Deploy prod on push / build-web (push) Successful in 1m25s
Deploy prod on push / deploy (push) Successful in 20s
2025-01-10 15:34:21 +01:00
65d04785b1 Merge pull request 'staging' (#483) from staging into master
All checks were successful
Deploy prod on push / pre-build (push) Successful in 2s
Deploy prod on push / build-bot (push) Successful in 1m30s
Deploy prod on push / build-web (push) Successful in 1m29s
Deploy prod on push / deploy (push) Successful in 19s
Reviewed-on: #483
2025-01-10 15:05:37 +01:00
614a60bd2b Fixed project structure
All checks were successful
Deploy staging on push / pre-build (push) Successful in 2s
Deploy staging on push / build-bot (push) Successful in 2m50s
Deploy staging on push / build-web (push) Successful in 1m39s
Deploy staging on push / deploy (push) Successful in 30s
2025-01-10 14:59:58 +01:00
e5b03e7219 Added project structure
Some checks failed
Deploy staging on push / pre-build (push) Successful in 2s
Deploy staging on push / build-web (push) Has been cancelled
Deploy staging on push / build-bot (push) Failing after 1m23s
Deploy staging on push / deploy (push) Has been skipped
2025-01-10 14:35:39 +01:00
09c8f41b05 Removed docker build
All checks were successful
Deploy staging on push / pre-build (push) Successful in 2s
Deploy staging on push / build-bot (push) Successful in 2m55s
Deploy staging on push / build-web (push) Successful in 1m51s
Deploy staging on push / deploy (push) Successful in 24s
2025-01-10 14:26:26 +01:00
bebecb5ec6 Merge pull request '#481' (#482) from #481 into staging
Some checks failed
Deploy staging on push / pre-build (push) Successful in 2s
Deploy staging on push / build-bot (push) Failing after 11s
Deploy staging on push / build-web (push) Failing after 38s
Deploy staging on push / deploy (push) Has been skipped
Reviewed-on: #482
2025-01-10 14:22:18 +01:00
5a31ea5f76 Set cpl version #481 2025-01-10 14:20:49 +01:00
6216bcf917 Build app #481 2025-01-10 14:19:29 +01:00
f060d62039 Updated builds #481 2025-01-10 14:16:03 +01:00
5d30f551fd Data integrity check for realms #481 2025-01-07 18:24:04 +01:00
6e74e9b190 Handle category updates #481 2025-01-07 17:56:56 +01:00
352ede1667 Fixed realm group #481 2025-01-07 16:40:26 +01:00
103 changed files with 404 additions and 208 deletions

View File

@@ -7,7 +7,7 @@ on:
jobs:
pre-build:
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Shutdown stack
@@ -15,13 +15,9 @@ jobs:
build-bot:
needs: pre-build
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Setup docker
uses: https://github.com/papodaca/install-docker-action@main
- run: docker -v
- name: Clone Repository
uses: https://github.com/actions/checkout@v3
with:
@@ -55,13 +51,9 @@ jobs:
build-web:
needs: pre-build
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Setup docker
uses: https://github.com/papodaca/install-docker-action@main
- run: docker -v
- name: Clone Repository
uses: https://github.com/actions/checkout@v3
with:
@@ -99,7 +91,7 @@ jobs:
deploy:
needs: [ build-bot, build-web ]
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Clone Repository

View File

@@ -7,7 +7,7 @@ on:
jobs:
pre-build:
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Shutdown stack
@@ -15,13 +15,9 @@ jobs:
build-bot:
needs: pre-build
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Setup docker
uses: https://github.com/papodaca/install-docker-action@main
- run: docker -v
- name: Clone Repository
uses: https://github.com/actions/checkout@v3
with:
@@ -55,13 +51,9 @@ jobs:
build-web:
needs: pre-build
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Setup docker
uses: https://github.com/papodaca/install-docker-action@main
- run: docker -v
- name: Clone Repository
uses: https://github.com/actions/checkout@v3
with:
@@ -98,7 +90,7 @@ jobs:
deploy:
needs: [ build-bot, build-web ]
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Clone Repository

View File

@@ -7,7 +7,7 @@ on:
jobs:
pre-build:
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Shutdown stack
@@ -15,13 +15,9 @@ jobs:
build-bot:
needs: pre-build
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Setup docker
uses: https://github.com/papodaca/install-docker-action@main
- run: docker -v
- name: Clone Repository
uses: https://github.com/actions/checkout@v3
with:
@@ -55,13 +51,9 @@ jobs:
build-web:
needs: pre-build
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Setup docker
uses: https://github.com/papodaca/install-docker-action@main
- run: docker -v
- name: Clone Repository
uses: https://github.com/actions/checkout@v3
with:
@@ -99,7 +91,7 @@ jobs:
deploy:
needs: [ build-bot, build-web ]
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
runs-on: [ dobby ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Clone Repository

View File

@@ -14,6 +14,7 @@
"config": "src/modules/config/config.json",
"database": "src/modules/database/database.json",
"level": "src/modules/level/level.json",
"realms": "src/modules/realms/realms.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",

View File

@@ -15,7 +15,7 @@ __title__ = "bot"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.9"
__version__ = "1.2.11"
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="9")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "9"
"Micro": "11"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@@ -15,7 +15,7 @@ __title__ = "bot.extension"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -286,7 +286,7 @@
},
"user": {
"birthday": {
"has_birthday": "Alles Gute zum Geburtag {} :D",
"has_birthday": "Alles Gute zum Geburtstag {} :D",
"success": "Dein Geburtstag wurde eingetragen.",
"success_team": "{} hat seinen Geburtstag eingetragen: {}"
},

View File

@@ -15,7 +15,7 @@ __title__ = "bot_api"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_api.abc"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "",
"AuthorEmail": "",

View File

@@ -15,7 +15,7 @@ __title__ = "bot_api.configuration"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_api.controller"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_api.event"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_api.filter"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -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.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_api.logging"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_api.model"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -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.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_api.route"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_api.service"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_api.transformer"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_core"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_core.abc"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@@ -15,7 +15,7 @@ __title__ = "bot_core.configuration"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -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.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_core.events"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_core.exception"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_core.helper"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_core.logging"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_core.pipes"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_core.service"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -27,6 +27,7 @@ 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.achievements.achievement_service import AchievementService
from modules.realms.realm_utils import RealmUtils
class DataIntegrityService:
@@ -46,6 +47,7 @@ class DataIntegrityService:
achievement_service: AchievementService,
client_utils: ClientUtilsABC,
dtp: DateTimeOffsetPipe,
ream_utils: RealmUtils,
):
self._config = config
@@ -62,6 +64,7 @@ class DataIntegrityService:
self._achievements = achievement_service
self._client_utils = client_utils
self._dtp = dtp
self._realm_utils = ream_utils
self._is_for_shutdown = False
@@ -96,6 +99,9 @@ class DataIntegrityService:
self._logger.debug(__name__, f"Start check for user got achievements: {g.id}@{m.id}")
await self._check_for_user_achievements(u)
self._logger.debug(__name__, f"Start check for user got achievements: {g.id}@{m.id}")
await self._realm_utils.check_integrity(s, g)
for m in [m for m in g.members if m.bot]:
u = self._users.find_user_by_discord_id_and_server_id(m.id, s.id)
if u is None:

View File

@@ -15,7 +15,7 @@ __title__ = "bot_data"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_data.abc"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@@ -15,7 +15,7 @@ __title__ = "bot_data.model"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -17,7 +17,7 @@ class Realm(TableABC):
id=0,
):
self._id = id
self._name = name
self._name = name.replace("'", "")
self._role_id = role_id
self._server = server
@@ -31,11 +31,11 @@ class Realm(TableABC):
@property
def name(self) -> str:
return self._name
return self._name.replace("'", "")
@name.setter
def name(self, value: str):
self._name = value
self._name = value.replace("'", "")
@property
def role_id(self) -> int:

View File

@@ -15,7 +15,7 @@ __title__ = "bot_data.service"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_graphql"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_graphql.abc"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@@ -15,7 +15,7 @@ __title__ = "bot_graphql.filter"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_graphql.model"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_graphql.mutations"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "bot_graphql.queries"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -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.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.achievements"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@@ -15,7 +15,7 @@ __title__ = "modules.achievements.commands"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.achievements.events"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.achievements.model"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.auto_role"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "",
"AuthorEmail": "",

View File

@@ -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.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -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.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -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.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.base"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "",
"AuthorEmail": "",

View File

@@ -15,7 +15,7 @@ __title__ = "modules.base.command"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.base.events"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.base.forms"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.base.helper"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.base.model"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.base.service"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.base.tasks"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.boot_log"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "",
"AuthorEmail": "",

View File

@@ -15,7 +15,7 @@ __title__ = "modules.config"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "",
"AuthorEmail": "",

View File

@@ -15,7 +15,7 @@ __title__ = "modules.config.events"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.config.service"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.database"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@@ -15,7 +15,7 @@ __title__ = "modules.level"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.level.command"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.level.configuration"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.level.events"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "",
"AuthorEmail": "",

View File

@@ -15,7 +15,7 @@ __title__ = "modules.level.service"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
"""
bot sh-edraft.de Discord bot
~~~~~~~~~~~~~~~~~~~
Discord bot for customers of sh-edraft.de
:copyright: (c) 2022 - 2023 sh-edraft.de
:license: MIT, see LICENSE for more details.
"""
__title__ = "modules.realms"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.11"
from collections import namedtuple
# imports:
VersionInfo = namedtuple("VersionInfo", "major minor micro")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
"""
bot sh-edraft.de Discord bot
~~~~~~~~~~~~~~~~~~~
Discord bot for customers of sh-edraft.de
:copyright: (c) 2022 - 2023 sh-edraft.de
:license: MIT, see LICENSE for more details.
"""
__title__ = "modules.realms.command"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.11"
from collections import namedtuple
# imports:
VersionInfo = namedtuple("VersionInfo", "major minor micro")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -366,7 +366,9 @@ class RealmGroup(DiscordCommandABC):
)
return
if not self._permissions.is_member_moderator(ctx.author) and not self._realm_utils.is_realm_moderator(ctx.author.id, realm.id):
if not self._permissions.is_member_moderator(ctx.author) and not self._realm_utils.is_realm_moderator(
ctx.author.id, realm.id
):
await self._message_service.send_ctx_msg(
ctx,
self._t.transform("modules.realm.error.not_moderator").format(realm.name),
@@ -408,7 +410,9 @@ class RealmGroup(DiscordCommandABC):
)
return
if not self._permissions.is_member_moderator(ctx.author) and not self._realm_utils.is_realm_moderator(ctx.author.id, realm.id):
if not self._permissions.is_member_moderator(ctx.author) and not self._realm_utils.is_realm_moderator(
ctx.author.id, realm.id
):
await self._message_service.send_ctx_msg(
ctx,
self._t.transform("modules.realm.error.not_moderator").format(realm.name),

View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
"""
bot sh-edraft.de Discord bot
~~~~~~~~~~~~~~~~~~~
Discord bot for customers of sh-edraft.de
:copyright: (c) 2022 - 2023 sh-edraft.de
:license: MIT, see LICENSE for more details.
"""
__title__ = "modules.realms.events"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.11"
from collections import namedtuple
# imports:
VersionInfo = namedtuple("VersionInfo", "major minor micro")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -0,0 +1,75 @@
import discord
from cpl_core.configuration import ConfigurationABC
from cpl_discord.events import OnGuildChannelUpdateABC
from discord import CategoryChannel
from bot_core.logging.message_logger import MessageLogger
from bot_data.abc.realm_repository_abc import RealmRepositoryABC
from bot_data.abc.server_repository_abc import ServerRepositoryABC
from bot_data.abc.user_repository_abc import UserRepositoryABC
from bot_data.model.realm_moderator import RealmModerator
from modules.realms.realm_utils import RealmUtils
class RealmOnChannelUpdateEvent(OnGuildChannelUpdateABC):
def __init__(
self,
config: ConfigurationABC,
logger: MessageLogger,
servers: ServerRepositoryABC,
users: UserRepositoryABC,
realms: RealmRepositoryABC,
realm_utils: RealmUtils,
):
OnGuildChannelUpdateABC.__init__(self)
self._config = config
self._logger = logger
self._servers = servers
self._users = users
self._realms = realms
self._realm_utils = realm_utils
async def on_guild_channel_update(self, before: discord.abc.GuildChannel, after: discord.abc.GuildChannel):
self._logger.debug(__name__, f"Module {type(self)} started")
realm = self._realms.find_realm_by_name(before.name)
if realm is None:
return
if before.name != after.name:
realm.name = after.name
self._realms.update_realm(realm)
role = self._realm_utils.find_role_by_name(after.guild, before.name)
if role is not None:
await role.edit(name=after.name)
if before.overwrites != after.overwrites:
role = self._realm_utils.get_role_by_name(after.guild, after.name)
if role not in after.overwrites:
await after.set_permissions(
role,
view_channel=True,
connect=True,
manage_channels=True,
manage_permissions=True,
create_instant_invite=True,
)
mods = self._realms.get_realm_moderators_by_realm_id(realm.id)
mod_users = mods.select(lambda x: x.user)
for mod in mods:
if mod.user not in after.overwrites:
self._realms.delete_realm_moderator(mod)
server = self._servers.get_server_by_discord_id(after.guild.id)
for mod in after.overwrites:
if isinstance(mod, discord.Role):
continue
if mod not in mod_users:
user = self._users.find_user_by_discord_id_and_server_id(mod.id, server.id)
self._realms.add_realm_moderator(RealmModerator(realm, user))
await self._realm_utils.assign_moderator(after, mod)
self._logger.debug(__name__, f"Module {type(self)} stopped")

View File

@@ -1,14 +1,18 @@
from typing import Optional
from typing import Optional, Union
import discord
from cpl_discord.container import Role, CategoryChannel
from cpl_discord.service import DiscordBotServiceABC
from discord import Guild, Member
from discord.abc import GuildChannel
from bot_data.abc.realm_repository_abc import RealmRepositoryABC
from bot_data.model.server import Server
class RealmUtils:
def __init__(self, realms: RealmRepositoryABC):
def __init__(self, bot: DiscordBotServiceABC, realms: RealmRepositoryABC):
self._bot = bot
self._realms = realms
@staticmethod
@@ -18,6 +22,13 @@ class RealmUtils:
return Role(role)
return None
@staticmethod
def get_role_by_name(guild: Guild, name: str) -> Optional[Role]:
for role in guild.roles:
if role.name == name:
return Role(role)
raise ValueError(f"Role {name} not found")
@staticmethod
def find_category_by_name(guild: Guild, name: str) -> Optional[CategoryChannel]:
for category in guild.categories:
@@ -25,6 +36,13 @@ class RealmUtils:
return CategoryChannel(category)
return None
@staticmethod
def get_category_by_name(guild: Guild, name: str) -> Optional[CategoryChannel]:
for category in guild.categories:
if category.name == name:
return CategoryChannel(category)
raise ValueError(f"Category {name} not found")
@staticmethod
def check_realm_role(guild: Guild, role: Role) -> bool:
return role in guild.roles
@@ -50,7 +68,7 @@ class RealmUtils:
return await guild.create_category(name, overwrites=overwrites)
@staticmethod
async def assign_moderator(category: CategoryChannel, member: Member):
async def assign_moderator(category: Union[CategoryChannel, GuildChannel], member: Member):
await category.set_permissions(
member,
view_channel=True,
@@ -61,7 +79,7 @@ class RealmUtils:
)
@staticmethod
async def remove_moderator(category: CategoryChannel, member: Member):
async def remove_moderator(category: Union[CategoryChannel, GuildChannel], member: Member):
await category.set_permissions(
member,
view_channel=True,
@@ -77,3 +95,35 @@ class RealmUtils:
.select(lambda x: x.user.discord_id)
.contains(member_id)
)
async def check_integrity(self, server: Server, guild: Guild):
for realm in self._realms.get_realms_by_server_id(server.id):
category = self.find_category_by_name(guild, realm.name)
if category is None:
await self.create_category(guild, realm.name, realm.role, None)
role = self.find_role_by_name(guild, realm.name)
if role is None:
await guild.create_role(name=realm.name)
role = self.get_role_by_name(guild, realm.name)
category = self.get_category_by_name(guild, realm.name)
for mod in self._realms.get_realm_moderators_by_realm_id(realm.id):
member = guild.get_member(mod.user.discord_id)
if member is None:
continue
if member.get_role(role.id) is None:
await member.add_roles(role)
if member not in category.overwrites:
await self.assign_moderator(category, member)
mods = self._realms.get_realm_moderators_by_realm_id(realm.id)
mod_user_ids = mods.select(lambda x: x.user.discord_id)
for mod in category.overwrites:
if isinstance(mod, discord.Role):
continue
if mod.id not in mod_user_ids:
await self.remove_moderator(category, mod)

View File

@@ -1,10 +1,10 @@
{
"ProjectSettings": {
"Name": "private-categories",
"Name": "realms",
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "",
"AuthorEmail": "",
@@ -16,10 +16,10 @@
"LicenseName": "",
"LicenseDescription": "",
"Dependencies": [
"cpl-core==2022.12.0"
"cpl-core==2023.10.2"
],
"DevDependencies": [
"cpl-cli==2022.12.0"
"cpl-core==2023.10.2"
],
"PythonVersion": ">=3.10.6",
"PythonPath": {},
@@ -29,8 +29,8 @@
"ProjectType": "library",
"SourcePath": "",
"OutputPath": "../../dist",
"Main": "private_categories.main",
"EntryPoint": "private_categories",
"Main": "realms.main",
"EntryPoint": "realms",
"IncludePackageData": false,
"Included": [],
"Excluded": [

View File

@@ -1,11 +1,13 @@
from cpl_core.configuration import ConfigurationABC
from cpl_core.dependency_injection import ServiceCollectionABC
from cpl_core.environment import ApplicationEnvironmentABC
from cpl_discord.discord_event_types_enum import DiscordEventTypesEnum
from cpl_discord.service.discord_collection_abc import DiscordCollectionABC
from bot_core.abc.module_abc import ModuleABC
from bot_core.configuration.feature_flags_enum import FeatureFlagsEnum
from modules.realms.command.realm_group import RealmGroup
from modules.realms.events.realm_on_channel_update import RealmOnChannelUpdateEvent
from modules.realms.realm_utils import RealmUtils
@@ -19,3 +21,7 @@ class RealmsModule(ModuleABC):
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
services.add_transient(RealmGroup)
services.add_transient(RealmUtils)
services.add_transient(
DiscordEventTypesEnum.on_guild_channel_update.value,
RealmOnChannelUpdateEvent,
)

View File

@@ -15,7 +15,7 @@ __title__ = "modules.short_role_name"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.short_role_name.events"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.short_role_name.service"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "",
"AuthorEmail": "",

View File

@@ -15,7 +15,7 @@ __title__ = "modules.special_offers"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "",
"AuthorEmail": "",

View File

@@ -15,7 +15,7 @@ __title__ = "modules.technician"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -15,7 +15,7 @@ __title__ = "modules.technician.command"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.2.8"
__version__ = "1.2.11"
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="8")
version_info = VersionInfo(major="1", minor="2", micro="11")

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "",
"AuthorEmail": "",

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@@ -4,7 +4,7 @@
"Version": {
"Major": "1",
"Minor": "2",
"Micro": "8"
"Micro": "11"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

Some files were not shown because too many files have changed in this diff Show More