Compare commits
123 Commits
1.1.4
...
42eeb068e3
Author | SHA1 | Date | |
---|---|---|---|
42eeb068e3 | |||
89199004c4 | |||
8f26835d72 | |||
4c1de9e20b | |||
9c5760e0f9 | |||
dd6b609094 | |||
3810dec927 | |||
a87380f6f8 | |||
98ac7835b6 | |||
0a76068604 | |||
f9caf59180 | |||
284318bb10 | |||
6130cac6fe | |||
3a64c51600 | |||
90fce5a79a | |||
d448ad7707 | |||
19791ff9d8 | |||
3cba8de675 | |||
b7ff070676 | |||
c88e07d743 | |||
f5b978b231 | |||
0e2b7d03fc | |||
c7f5ab0161 | |||
01e8e4256d | |||
75adc2285e | |||
9e12d84ba0 | |||
d3b503d3ef | |||
dd86c3a657 | |||
aba6e48e2b | |||
73848c3141 | |||
33d6015088 | |||
7e962e05f6 | |||
c73c6876b2 | |||
8e949c3e1a | |||
472a76d563 | |||
f5d88ec94c | |||
2182c021b9 | |||
a9c9880fd4 | |||
d91c76467d | |||
2f10ace27f | |||
3b79a61bb6 | |||
ef0fab1178 | |||
189b6370a9 | |||
0ed93c56d0 | |||
4d18dd3845 | |||
7b7cbb20db | |||
84c2f5c2c4 | |||
c85c6df784 | |||
d5d898fa07 | |||
ef5ebabf81 | |||
f89b4c4ef5 | |||
8b277a2d19 | |||
a84e77e055 | |||
892c983e1e | |||
1d3809c986 | |||
3117f617d9 | |||
7e6053768f | |||
3d9cd0a2fc | |||
8d90768594 | |||
7e8a9482d4 | |||
bf7d29e6ab | |||
608001e0e1 | |||
0dd9558f33 | |||
7acd850e68 | |||
ecd3ea96b1 | |||
d869bcfd3a | |||
818e021761 | |||
b286322247 | |||
661b057e85 | |||
9be4e344f6 | |||
ebc782e266 | |||
887a46fa7f | |||
0cc8d6f2c7 | |||
3546d38f75 | |||
376cb76036 | |||
8e8da46a54 | |||
94e003312d | |||
fe42d46a38 | |||
4c0a4bc1ae | |||
4161d3a38a | |||
4a763e4e03 | |||
9783424066 | |||
290b5f38a7 | |||
5bfd04722c | |||
12f956f4c3 | |||
0b767fcb68 | |||
a303108da2 | |||
5e9cca5b1d | |||
d1c79c95b2 | |||
378d2c3dc9 | |||
a8ea9f5e49 | |||
957a54ccf3 | |||
0037a30c11 | |||
77e079d91c | |||
25137c6923 | |||
0a0401dd87 | |||
74f3ee2f08 | |||
69fc75fc97 | |||
5a85232374 | |||
5892b209d3 | |||
6715ecacd6 | |||
d72715d51b | |||
a7f9fa5818 | |||
c45916aaee | |||
8bbd57e82f | |||
987a1a664b | |||
99bfa9874a | |||
82058bab0e | |||
a566fca01f | |||
e52f5e4186 | |||
c90ede69dd | |||
85ba012b6f | |||
4cc094576d | |||
74ddc238be | |||
b53ddb1351 | |||
ca5a6c81b8 | |||
7b7bbaea50 | |||
d4b40eb52e | |||
ed524c2f64 | |||
8e3c8459f8 | |||
e661ee1489 | |||
9eaeb2df42 | |||
2e0c1babe4 |
17
.gitea/issue_template.md
Normal file
17
.gitea/issue_template.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#### Beschreibung
|
||||||
|
|
||||||
|
Als Produktmanager muss ich nun dieses Ticket ausfüllen.
|
||||||
|
|
||||||
|
#### Aktuelles Verhalten
|
||||||
|
|
||||||
|
* Was macht die Software aktuell?
|
||||||
|
|
||||||
|
#### Gewünschtes Verhalten
|
||||||
|
|
||||||
|
* Was soll die Software anders machen?
|
||||||
|
|
||||||
|
#### Akzeptanzkriterien
|
||||||
|
|
||||||
|
* Was muss erfüllt sein, damit das Ticket als abgeschlossen angesehen werden kann?
|
||||||
|
|
||||||
|
#### Anmerkungen
|
7
.gitea/pull_request_template.md
Normal file
7
.gitea/pull_request_template.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#### Ticket Referenz:
|
||||||
|
|
||||||
|
#1
|
||||||
|
|
||||||
|
#### Gibt es etwas beim Review zu beachten?
|
||||||
|
|
||||||
|
Nein
|
65
.gitea/workflows/deploy_dev.yaml
Normal file
65
.gitea/workflows/deploy_dev.yaml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
name: Deploy dev on push
|
||||||
|
run-name: Deploy dev on push
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
on-push-deploy_sh-edraft:
|
||||||
|
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
|
||||||
|
container: catthehacker/ubuntu:act-latest
|
||||||
|
steps:
|
||||||
|
- name: Setup Python 3.10
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: "3.10.12"
|
||||||
|
- run: python -v
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
- name: Shutdown stack
|
||||||
|
run: docker stack rm sdb_staging
|
||||||
|
|
||||||
|
- name: Prepare bot build
|
||||||
|
run: |
|
||||||
|
cd bot
|
||||||
|
pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
|
||||||
|
cpl i
|
||||||
|
|
||||||
|
- name: Build docker bot
|
||||||
|
run: |
|
||||||
|
cd bot
|
||||||
|
docker image prune -f
|
||||||
|
cpl docker-build
|
||||||
|
|
||||||
|
- name: Setup node
|
||||||
|
uses: https://github.com/actions/setup-node@v3
|
||||||
|
|
||||||
|
- name: Prepare web build
|
||||||
|
run: |
|
||||||
|
cd web
|
||||||
|
npm install -g ts-node
|
||||||
|
npm i
|
||||||
|
|
||||||
|
- name: Build docker web
|
||||||
|
run: |
|
||||||
|
cd web
|
||||||
|
docker image prune -f
|
||||||
|
npm run docker-build
|
||||||
|
|
||||||
|
- name: Deploy Stack to sh-edraft.de
|
||||||
|
uses: https://github.com/kgierke/portainer-stack-deployment@v1
|
||||||
|
with:
|
||||||
|
portainer-url: "https://docker.sh-edraft.de"
|
||||||
|
portainer-username: "gitea_job"
|
||||||
|
portainer-password: "${{ secrets.docker_job }}"
|
||||||
|
portainer-endpoint: 2
|
||||||
|
name: sdb_staging
|
||||||
|
file: ./docker-compose.staging.yml
|
||||||
|
variables: '{}'
|
65
.gitea/workflows/deploy_prod.yaml
Normal file
65
.gitea/workflows/deploy_prod.yaml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
name: Deploy dev on push
|
||||||
|
run-name: Deploy dev on push
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
on-push-deploy_sh-edraft:
|
||||||
|
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
|
||||||
|
container: catthehacker/ubuntu:act-latest
|
||||||
|
steps:
|
||||||
|
- name: Setup Python 3.10
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: "3.10.12"
|
||||||
|
- run: python -v
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
- name: Shutdown stack
|
||||||
|
run: docker stack rm sdb_prod
|
||||||
|
|
||||||
|
- name: Prepare bot build
|
||||||
|
run: |
|
||||||
|
cd bot
|
||||||
|
pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
|
||||||
|
cpl i
|
||||||
|
|
||||||
|
- name: Build docker bot
|
||||||
|
run: |
|
||||||
|
cd bot
|
||||||
|
docker image prune -f
|
||||||
|
cpl docker-build
|
||||||
|
|
||||||
|
- name: Setup node
|
||||||
|
uses: https://github.com/actions/setup-node@v3
|
||||||
|
|
||||||
|
- name: Prepare web build
|
||||||
|
run: |
|
||||||
|
cd web
|
||||||
|
npm install -g ts-node
|
||||||
|
npm i
|
||||||
|
|
||||||
|
- name: Build docker web
|
||||||
|
run: |
|
||||||
|
cd web
|
||||||
|
docker image prune -f
|
||||||
|
npm run docker-build
|
||||||
|
|
||||||
|
- name: Deploy Stack to sh-edraft.de
|
||||||
|
uses: https://github.com/kgierke/portainer-stack-deployment@v1
|
||||||
|
with:
|
||||||
|
portainer-url: "https://docker.sh-edraft.de"
|
||||||
|
portainer-username: "gitea_job"
|
||||||
|
portainer-password: "${{ secrets.docker_job }}"
|
||||||
|
portainer-endpoint: 2
|
||||||
|
name: sdb_prod
|
||||||
|
file: ./docker-compose.yml
|
||||||
|
variables: '{}'
|
18
.gitmodules
vendored
18
.gitmodules
vendored
@@ -1,9 +1,9 @@
|
|||||||
[submodule "kdb-bot/src/bot/config"]
|
[submodule "bot/src/bot/config"]
|
||||||
path = kdb-bot/src/bot/config
|
path = bot/src/bot/config
|
||||||
url = https://git.sh-edraft.de/sh-edraft.de/kd_discord_bot.config.git
|
url = https://git.sh-edraft.de/sh-edraft.de/sh_discord_bot.config.git
|
||||||
[submodule "kdb-bot/src/bot_api/config"]
|
[submodule "bot/src/bot_api/config"]
|
||||||
path = kdb-bot/src/bot_api/config
|
path = bot/src/bot_api/config
|
||||||
url = https://git.sh-edraft.de/sh-edraft.de/kd_discord_bot.api.config.git
|
url = https://git.sh-edraft.de/sh-edraft.de/sh_discord_bot.api.config.git
|
||||||
[submodule "kdb-bot/docker"]
|
[submodule "bot/docker"]
|
||||||
path = kdb-bot/docker
|
path = bot/docker
|
||||||
url = https://git.sh-edraft.de/sh-edraft.de/kd_discord_bot.docker.git
|
url = https://git.sh-edraft.de/sh-edraft.de/sh_discord_bot.docker.git
|
||||||
|
@@ -16,6 +16,8 @@
|
|||||||
"level": "src/modules/level/level.json",
|
"level": "src/modules/level/level.json",
|
||||||
"permission": "src/modules/permission/permission.json",
|
"permission": "src/modules/permission/permission.json",
|
||||||
"technician": "src/modules/technician/technician.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",
|
||||||
"checks": "tools/checks/checks.json",
|
"checks": "tools/checks/checks.json",
|
||||||
"get-version": "tools/get_version/get-version.json",
|
"get-version": "tools/get_version/get-version.json",
|
||||||
"post-build": "tools/post_build/post-build.json",
|
"post-build": "tools/post_build/post-build.json",
|
||||||
@@ -30,12 +32,12 @@
|
|||||||
"pre-build": "cpl set-version $ARGS; black ./;",
|
"pre-build": "cpl set-version $ARGS; black ./;",
|
||||||
"post-build": "cpl run post-build --dev; black ./;",
|
"post-build": "cpl run post-build --dev; black ./;",
|
||||||
"pre-prod": "cpl build",
|
"pre-prod": "cpl build",
|
||||||
"prod": "export KDB_ENVIRONMENT=production; export KDB_NAME=KDB-Prod; cpl start;",
|
"prod": "export SDB_ENVIRONMENT=production; export SDB_NAME=SDB-Prod; cpl start;",
|
||||||
"pre-stage": "cpl build",
|
"pre-stage": "cpl build",
|
||||||
"stage": "export KDB_ENVIRONMENT=staging; export KDB_NAME=KDB-Stage; cpl start;",
|
"stage": "export SDB_ENVIRONMENT=staging; export SDB_NAME=SDB-Stage; cpl start;",
|
||||||
"pre-dev": "cpl build",
|
"pre-dev": "cpl build",
|
||||||
"dev": "export KDB_ENVIRONMENT=development; export KDB_NAME=KDB-Dev; cpl start;",
|
"dev": "export SDB_ENVIRONMENT=development; export SDB_NAME=SDB-Dev; cpl start;",
|
||||||
"docker-build": "cpl build $ARGS; docker build -t kdb-bot/kdb-bot:$(cpl gv) .;",
|
"docker-build": "cpl build $ARGS; docker build -t sh-edraft.de/sdb-bot:$(cpl gv) .;",
|
||||||
"dc-up": "docker-compose up -d",
|
"dc-up": "docker-compose up -d",
|
||||||
"dc-down": "docker-compose down",
|
"dc-down": "docker-compose down",
|
||||||
"docker": "cpl dc-down; cpl docker-build; cpl dc-up;"
|
"docker": "cpl dc-down; cpl docker-build; cpl dc-up;"
|
@@ -2,7 +2,7 @@
|
|||||||
FROM python:3.10.4-alpine
|
FROM python:3.10.4-alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY ./dist/bot/build/kdb-bot/ .
|
COPY ./dist/bot/build/bot/ .
|
||||||
COPY ./dist/bot/build/requirements.txt .
|
COPY ./dist/bot/build/requirements.txt .
|
||||||
|
|
||||||
RUN python -m pip install --upgrade pip
|
RUN python -m pip install --upgrade pip
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -8,6 +8,7 @@ from cpl_discord.service import DiscordBotServiceABC, DiscordBotService
|
|||||||
from cpl_translation import TranslatePipe, TranslationServiceABC, TranslationSettings
|
from cpl_translation import TranslatePipe, TranslationServiceABC, TranslationSettings
|
||||||
|
|
||||||
from bot_api.api_thread import ApiThread
|
from bot_api.api_thread import ApiThread
|
||||||
|
from bot_core.abc.task_abc import TaskABC
|
||||||
from bot_core.configuration.feature_flags_enum import FeatureFlagsEnum
|
from bot_core.configuration.feature_flags_enum import FeatureFlagsEnum
|
||||||
from bot_core.configuration.feature_flags_settings import FeatureFlagsSettings
|
from bot_core.configuration.feature_flags_settings import FeatureFlagsSettings
|
||||||
from bot_core.service.data_integrity_service import DataIntegrityService
|
from bot_core.service.data_integrity_service import DataIntegrityService
|
||||||
@@ -29,6 +30,8 @@ class Application(DiscordBotApplicationABC):
|
|||||||
# cpl-translation
|
# cpl-translation
|
||||||
self._translation: TranslationServiceABC = services.get_service(TranslationServiceABC)
|
self._translation: TranslationServiceABC = services.get_service(TranslationServiceABC)
|
||||||
self._t: TranslatePipe = services.get_service(TranslatePipe)
|
self._t: TranslatePipe = services.get_service(TranslatePipe)
|
||||||
|
# internal stuff
|
||||||
|
self._tasks = services.get_services(TaskABC)
|
||||||
|
|
||||||
self._feature_flags: FeatureFlagsSettings = config.get_configuration(FeatureFlagsSettings)
|
self._feature_flags: FeatureFlagsSettings = config.get_configuration(FeatureFlagsSettings)
|
||||||
|
|
||||||
@@ -55,6 +58,9 @@ class Application(DiscordBotApplicationABC):
|
|||||||
return
|
return
|
||||||
|
|
||||||
self._logger.info(__name__, f"Try to start {DiscordBotService.__name__}")
|
self._logger.info(__name__, f"Try to start {DiscordBotService.__name__}")
|
||||||
|
for task in self._tasks:
|
||||||
|
await self._bot.add_cog(task)
|
||||||
|
|
||||||
await self._bot.start_async()
|
await self._bot.start_async()
|
||||||
await self._bot.stop_async()
|
await self._bot.stop_async()
|
||||||
except Exception as e:
|
except Exception as e:
|
@@ -3,35 +3,36 @@
|
|||||||
"Name": "bot",
|
"Name": "bot",
|
||||||
"Version": {
|
"Version": {
|
||||||
"Major": "1",
|
"Major": "1",
|
||||||
"Minor": "1",
|
"Minor": "2",
|
||||||
"Micro": "4"
|
"Micro": "0"
|
||||||
},
|
},
|
||||||
"Author": "Sven Heidemann",
|
"Author": "Sven Heidemann",
|
||||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||||
"Description": "Keksdose bot",
|
"Description": "sh-edraft.de Discord bot",
|
||||||
"LongDescription": "Discord bot for the Keksdose discord Server",
|
"LongDescription": "Discord bot for customers of sh-edraft.de",
|
||||||
"URL": "https://www.sh-edraft.de",
|
"URL": "https://www.sh-edraft.de",
|
||||||
"CopyrightDate": "2022 - 2023",
|
"CopyrightDate": "2022 - 2023",
|
||||||
"CopyrightName": "sh-edraft.de",
|
"CopyrightName": "sh-edraft.de",
|
||||||
"LicenseName": "MIT",
|
"LicenseName": "MIT",
|
||||||
"LicenseDescription": "MIT, see LICENSE for more details.",
|
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||||
"Dependencies": [
|
"Dependencies": [
|
||||||
"cpl-core==2023.4.0.post5",
|
"cpl-core==2023.10.0",
|
||||||
"cpl-translation==2023.4.0.post1",
|
"cpl-translation==2023.4.0.post1",
|
||||||
"cpl-query==2023.4.0.post1",
|
"cpl-query==2023.10.0",
|
||||||
"cpl-discord==2023.4.0.post3",
|
"cpl-discord==2023.10.0.post1",
|
||||||
"Flask==2.3.2",
|
"Flask==3.0.0",
|
||||||
"Flask-Classful==0.14.2",
|
"Flask-Classful==0.16.0",
|
||||||
"Flask-Cors==4.0.0",
|
"Flask-Cors==4.0.0",
|
||||||
"PyJWT==2.8.0",
|
"PyJWT==2.8.0",
|
||||||
"waitress==2.1.2",
|
"waitress==2.1.2",
|
||||||
"Flask-SocketIO==5.3.4",
|
"Flask-SocketIO==5.3.6",
|
||||||
"eventlet==0.33.3",
|
"eventlet==0.33.3",
|
||||||
"requests-oauthlib==1.3.1",
|
"requests-oauthlib==1.3.1",
|
||||||
"icmplib==3.0.3",
|
"icmplib==3.0.4",
|
||||||
"ariadne==0.20.1",
|
"ariadne==0.20.1",
|
||||||
"cryptography==41.0.2",
|
"cryptography==41.0.4",
|
||||||
"discord>=2.3.2"
|
"discord==2.3.2",
|
||||||
|
"bs4==0.0.1"
|
||||||
],
|
],
|
||||||
"DevDependencies": [
|
"DevDependencies": [
|
||||||
"cpl-cli==2023.4.0.post3",
|
"cpl-cli==2023.4.0.post3",
|
||||||
@@ -68,6 +69,8 @@
|
|||||||
"../modules/database/database.json",
|
"../modules/database/database.json",
|
||||||
"../modules/level/level.json",
|
"../modules/level/level.json",
|
||||||
"../modules/permission/permission.json",
|
"../modules/permission/permission.json",
|
||||||
|
"../modules/short_role_name/short-role-name.json",
|
||||||
|
"../modules/special_offers/special-offers.json",
|
||||||
"../modules/technician/technician.json"
|
"../modules/technician/technician.json"
|
||||||
]
|
]
|
||||||
}
|
}
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot.extension"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -13,6 +13,8 @@ from modules.config.config_module import ConfigModule
|
|||||||
from modules.database.database_module import DatabaseModule
|
from modules.database.database_module import DatabaseModule
|
||||||
from modules.level.level_module import LevelModule
|
from modules.level.level_module import LevelModule
|
||||||
from modules.permission.permission_module import PermissionModule
|
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
|
from modules.technician.technician_module import TechnicianModule
|
||||||
|
|
||||||
|
|
||||||
@@ -35,6 +37,8 @@ class ModuleList:
|
|||||||
ApiModule,
|
ApiModule,
|
||||||
TechnicianModule,
|
TechnicianModule,
|
||||||
AchievementsModule,
|
AchievementsModule,
|
||||||
|
ShortRoleNameModule,
|
||||||
|
SteamSpecialOffersModule,
|
||||||
# has to be last!
|
# has to be last!
|
||||||
BootLogModule,
|
BootLogModule,
|
||||||
CoreExtensionModule,
|
CoreExtensionModule,
|
@@ -16,6 +16,7 @@ from bot_core.configuration.feature_flags_settings import FeatureFlagsSettings
|
|||||||
from bot_core.logging.command_logger import CommandLogger
|
from bot_core.logging.command_logger import CommandLogger
|
||||||
from bot_core.logging.database_logger import DatabaseLogger
|
from bot_core.logging.database_logger import DatabaseLogger
|
||||||
from bot_core.logging.message_logger import MessageLogger
|
from bot_core.logging.message_logger import MessageLogger
|
||||||
|
from bot_core.logging.task_logger import TaskLogger
|
||||||
from bot_data.db_context import DBContext
|
from bot_data.db_context import DBContext
|
||||||
|
|
||||||
|
|
||||||
@@ -43,6 +44,7 @@ class Startup(StartupABC):
|
|||||||
services.add_singleton(CustomFileLoggerABC, CommandLogger)
|
services.add_singleton(CustomFileLoggerABC, CommandLogger)
|
||||||
services.add_singleton(CustomFileLoggerABC, DatabaseLogger)
|
services.add_singleton(CustomFileLoggerABC, DatabaseLogger)
|
||||||
services.add_singleton(CustomFileLoggerABC, MessageLogger)
|
services.add_singleton(CustomFileLoggerABC, MessageLogger)
|
||||||
|
services.add_singleton(CustomFileLoggerABC, TaskLogger)
|
||||||
|
|
||||||
if self._feature_flags.get_flag(FeatureFlagsEnum.api_module):
|
if self._feature_flags.get_flag(FeatureFlagsEnum.api_module):
|
||||||
services.add_singleton(CustomFileLoggerABC, ApiLogger)
|
services.add_singleton(CustomFileLoggerABC, ApiLogger)
|
@@ -9,15 +9,27 @@ from bot_data.migration.api_key_migration import ApiKeyMigration
|
|||||||
from bot_data.migration.api_migration import ApiMigration
|
from bot_data.migration.api_migration import ApiMigration
|
||||||
from bot_data.migration.auto_role_fix1_migration import AutoRoleFix1Migration
|
from bot_data.migration.auto_role_fix1_migration import AutoRoleFix1Migration
|
||||||
from bot_data.migration.auto_role_migration import AutoRoleMigration
|
from bot_data.migration.auto_role_migration import AutoRoleMigration
|
||||||
from bot_data.migration.config_feature_flags_migration import ConfigFeatureFlagsMigration
|
from bot_data.migration.birthday_migration import BirthdayMigration
|
||||||
|
from bot_data.migration.config_feature_flags_migration import (
|
||||||
|
ConfigFeatureFlagsMigration,
|
||||||
|
)
|
||||||
from bot_data.migration.config_migration import ConfigMigration
|
from bot_data.migration.config_migration import ConfigMigration
|
||||||
from bot_data.migration.db_history_migration import DBHistoryMigration
|
from bot_data.migration.db_history_migration import DBHistoryMigration
|
||||||
from bot_data.migration.default_role_migration import DefaultRoleMigration
|
from bot_data.migration.default_role_migration import DefaultRoleMigration
|
||||||
|
from bot_data.migration.fix_updates_migration import FixUpdatesMigration
|
||||||
|
from bot_data.migration.fix_user_history_migration import FixUserHistoryMigration
|
||||||
from bot_data.migration.initial_migration import InitialMigration
|
from bot_data.migration.initial_migration import InitialMigration
|
||||||
from bot_data.migration.level_migration import LevelMigration
|
from bot_data.migration.level_migration import LevelMigration
|
||||||
from bot_data.migration.remove_stats_migration import RemoveStatsMigration
|
from bot_data.migration.remove_stats_migration import RemoveStatsMigration
|
||||||
|
from bot_data.migration.short_role_name_migration import ShortRoleNameMigration
|
||||||
|
from bot_data.migration.short_role_name_only_highest_migration import (
|
||||||
|
ShortRoleNameOnlyHighestMigration,
|
||||||
|
)
|
||||||
from bot_data.migration.stats_migration import StatsMigration
|
from bot_data.migration.stats_migration import StatsMigration
|
||||||
from bot_data.migration.user_joined_game_server_migration import UserJoinedGameServerMigration
|
from bot_data.migration.steam_special_offer_migration import SteamSpecialOfferMigration
|
||||||
|
from bot_data.migration.user_joined_game_server_migration import (
|
||||||
|
UserJoinedGameServerMigration,
|
||||||
|
)
|
||||||
from bot_data.migration.user_message_count_per_hour_migration import (
|
from bot_data.migration.user_message_count_per_hour_migration import (
|
||||||
UserMessageCountPerHourMigration,
|
UserMessageCountPerHourMigration,
|
||||||
)
|
)
|
||||||
@@ -50,3 +62,9 @@ class StartupMigrationExtension(StartupExtensionABC):
|
|||||||
services.add_transient(MigrationABC, ConfigMigration) # 19.07.2023 #127 - 1.1.0
|
services.add_transient(MigrationABC, ConfigMigration) # 19.07.2023 #127 - 1.1.0
|
||||||
services.add_transient(MigrationABC, ConfigFeatureFlagsMigration) # 15.08.2023 #334 - 1.1.0
|
services.add_transient(MigrationABC, ConfigFeatureFlagsMigration) # 15.08.2023 #334 - 1.1.0
|
||||||
services.add_transient(MigrationABC, DefaultRoleMigration) # 24.09.2023 #360 - 1.1.3
|
services.add_transient(MigrationABC, DefaultRoleMigration) # 24.09.2023 #360 - 1.1.3
|
||||||
|
services.add_transient(MigrationABC, ShortRoleNameMigration) # 28.09.2023 #378 - 1.1.7
|
||||||
|
services.add_transient(MigrationABC, FixUpdatesMigration) # 28.09.2023 #378 - 1.1.7
|
||||||
|
services.add_transient(MigrationABC, ShortRoleNameOnlyHighestMigration) # 02.10.2023 #391 - 1.1.9
|
||||||
|
services.add_transient(MigrationABC, FixUserHistoryMigration) # 10.10.2023 #401 - 1.2.0
|
||||||
|
services.add_transient(MigrationABC, BirthdayMigration) # 10.10.2023 #401 - 1.2.0
|
||||||
|
services.add_transient(MigrationABC, SteamSpecialOfferMigration) # 10.10.2023 #188 - 1.2.0
|
@@ -17,7 +17,7 @@ class StartupSettingsExtension(StartupExtensionABC):
|
|||||||
def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironmentABC):
|
def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironmentABC):
|
||||||
# this shit has to be done here because we need settings in subsequent startup extensions
|
# this shit has to be done here because we need settings in subsequent startup extensions
|
||||||
environment.set_working_directory(os.path.dirname(os.path.realpath(__file__)))
|
environment.set_working_directory(os.path.dirname(os.path.realpath(__file__)))
|
||||||
configuration.add_environment_variables("KDB_")
|
configuration.add_environment_variables("SDB_")
|
||||||
configuration.add_environment_variables("DISCORD_")
|
configuration.add_environment_variables("DISCORD_")
|
||||||
|
|
||||||
configuration.add_json_file(f"config/appsettings.json", optional=False)
|
configuration.add_json_file(f"config/appsettings.json", optional=False)
|
@@ -82,6 +82,7 @@
|
|||||||
"unexpected_quote_error": "Fehler: Unerwarteter Fehler beim Anführungszeichen!",
|
"unexpected_quote_error": "Fehler: Unerwarteter Fehler beim Anführungszeichen!",
|
||||||
"user_input_error": "Fehler: Eingabefehler!"
|
"user_input_error": "Fehler: Eingabefehler!"
|
||||||
},
|
},
|
||||||
|
"feature_not_activated": "Diese Funktion ist deaktiviert",
|
||||||
"hello_world": "Hallo Welt",
|
"hello_world": "Hallo Welt",
|
||||||
"no_permission_message": "Nein!\nIch höre nicht auf dich ¯\\_(ツ)_/¯",
|
"no_permission_message": "Nein!\nIch höre nicht auf dich ¯\\_(ツ)_/¯",
|
||||||
"not_implemented_yet": "Ey Alter, das kann ich noch nicht...",
|
"not_implemented_yet": "Ey Alter, das kann ich noch nicht...",
|
||||||
@@ -93,11 +94,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"modules": {
|
"modules": {
|
||||||
|
"special_offers": {
|
||||||
|
"price": "Preis",
|
||||||
|
"discount": "Rabatt",
|
||||||
|
"discount_price": "Neuer Preis"
|
||||||
|
},
|
||||||
"achievements": {
|
"achievements": {
|
||||||
"got_new_achievement": "{} hat die Errungenschaft {} freigeschaltet :D",
|
|
||||||
"commands": {
|
"commands": {
|
||||||
"check": "Alles klar, ich schaue eben nach... nom nom"
|
"check": "Alles klar, ich schaue eben nach... nom nom"
|
||||||
}
|
},
|
||||||
|
"got_new_achievement": "{} hat die Errungenschaft {} freigeschaltet :D"
|
||||||
},
|
},
|
||||||
"auto_role": {
|
"auto_role": {
|
||||||
"add": {
|
"add": {
|
||||||
@@ -122,6 +128,9 @@
|
|||||||
},
|
},
|
||||||
"success": "auto-role {} wurde entfernt :D"
|
"success": "auto-role {} wurde entfernt :D"
|
||||||
},
|
},
|
||||||
|
"react": {
|
||||||
|
"success": "Alle Reaktionen wurden hinzugefügt"
|
||||||
|
},
|
||||||
"rule": {
|
"rule": {
|
||||||
"add": {
|
"add": {
|
||||||
"error": {
|
"error": {
|
||||||
@@ -151,33 +160,37 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"base": {
|
"base": {
|
||||||
"member_left_message": "{} hat uns leider verlassen :(",
|
|
||||||
"complaints": {
|
|
||||||
"title": "Beschwerde einreichen",
|
|
||||||
"label": "Beschwerde",
|
|
||||||
"message": "{} hat eine Beschwerde eingereicht:\n{}",
|
|
||||||
"response": "Danke für deine Beschwerde"
|
|
||||||
},
|
|
||||||
"bug": {
|
|
||||||
"title": "Bug melden",
|
|
||||||
"label": "Bug",
|
|
||||||
"message": "{} meldet einen Bug:\n{}",
|
|
||||||
"response": "Danke für dein Feedback :D"
|
|
||||||
},
|
|
||||||
"afk_command_channel_missing_message": "Zu unfähig einem Sprachkanal beizutreten?",
|
"afk_command_channel_missing_message": "Zu unfähig einem Sprachkanal beizutreten?",
|
||||||
"afk_command_move_message": "Ich verschiebe dich ja schon... (◔_◔)",
|
"afk_command_move_message": "Ich verschiebe dich ja schon... (◔_◔)",
|
||||||
|
"bug": {
|
||||||
|
"label": "Bug",
|
||||||
|
"message": "{} meldet einen Bug:\n{}",
|
||||||
|
"response": "Danke für dein Feedback :D",
|
||||||
|
"title": "Bug melden"
|
||||||
|
},
|
||||||
|
"complaints": {
|
||||||
|
"label": "Beschwerde",
|
||||||
|
"message": "{} hat eine Beschwerde eingereicht:\n{}",
|
||||||
|
"response": "Danke für deine Beschwerde",
|
||||||
|
"title": "Beschwerde einreichen"
|
||||||
|
},
|
||||||
"game_server": {
|
"game_server": {
|
||||||
|
"add": {
|
||||||
|
"success": "Gameserver {} wurde hinzugefügt :)"
|
||||||
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"nothing_found": "Keine Gameserver gefunden."
|
"nothing_found": "Keine Gameserver gefunden."
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "Gameserver",
|
"api_key": "API Key",
|
||||||
"description": "Konfigurierte Gameserver:",
|
"description": "Konfigurierte Gameserver:",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"api_key": "API Key"
|
"title": "Gameserver"
|
||||||
},
|
},
|
||||||
"add": {
|
"list_members": {
|
||||||
"success": "Gameserver {} wurde hinzugefügt :)"
|
"description": "Konfigurierte Mitglieder:",
|
||||||
|
"title": "Mitglieder",
|
||||||
|
"users": "Mitglieder"
|
||||||
},
|
},
|
||||||
"remove": {
|
"remove": {
|
||||||
"success": "Gameserver wurde entfernt :D"
|
"success": "Gameserver wurde entfernt :D"
|
||||||
@@ -204,6 +217,7 @@
|
|||||||
"moved": "Alle Personen aus {} wurden nach {} verschoben."
|
"moved": "Alle Personen aus {} wurden nach {} verschoben."
|
||||||
},
|
},
|
||||||
"member_joined_help_voice_channel": "{} braucht Hilfe, bitte kümmere dich drum :D",
|
"member_joined_help_voice_channel": "{} braucht Hilfe, bitte kümmere dich drum :D",
|
||||||
|
"member_left_message": "{} hat uns leider verlassen :(",
|
||||||
"pong": "Pong",
|
"pong": "Pong",
|
||||||
"presence": {
|
"presence": {
|
||||||
"changed": "Presence wurde geändert.",
|
"changed": "Presence wurde geändert.",
|
||||||
@@ -220,6 +234,11 @@
|
|||||||
"success": "Verlinkung wurde entfernt :D"
|
"success": "Verlinkung wurde entfernt :D"
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
|
"birthday": {
|
||||||
|
"has_birthday": "Alles Gute zum Geburtag {} :D",
|
||||||
|
"success": "Dein Geburtstag wurde eingetragen.",
|
||||||
|
"success_team": "{} hat seinen Geburtstag eingetragen: {}"
|
||||||
|
},
|
||||||
"add": {
|
"add": {
|
||||||
"xp": "Die {} von {} wurden um {} erhöht"
|
"xp": "Die {} von {} wurden um {} erhöht"
|
||||||
},
|
},
|
||||||
@@ -340,6 +359,9 @@
|
|||||||
"moderator": {
|
"moderator": {
|
||||||
"purge_message": "Na gut..., ich lösche alle Nachrichten wenns sein muss."
|
"purge_message": "Na gut..., ich lösche alle Nachrichten wenns sein muss."
|
||||||
},
|
},
|
||||||
|
"short_role_name": {
|
||||||
|
"checked_message": "Die Rollen Kürzel wurden überprüft"
|
||||||
|
},
|
||||||
"technician": {
|
"technician": {
|
||||||
"api_key": {
|
"api_key": {
|
||||||
"add": {
|
"add": {
|
||||||
@@ -353,7 +375,8 @@
|
|||||||
},
|
},
|
||||||
"log_message": "Hier sind deine Logdateien! :)",
|
"log_message": "Hier sind deine Logdateien! :)",
|
||||||
"restart_message": "Bin gleich wieder da :D",
|
"restart_message": "Bin gleich wieder da :D",
|
||||||
"shutdown_message": "Trauert nicht um mich, es war eine logische Entscheidung. Das Wohl von Vielen, es wiegt schwerer als das Wohl von Wenigen oder eines Einzelnen. Ich war es und ich werde es immer sein, euer Freund. Lebt lange und in Frieden :)"
|
"shutdown_message": "Trauert nicht um mich, es war eine logische Entscheidung. Das Wohl von Vielen, es wiegt schwerer als das Wohl von Wenigen oder eines Einzelnen. Ich war es und ich werde es immer sein, euer Freund. Lebt lange und in Frieden :)",
|
||||||
|
"synced_message": "Der Sync wurde abgeschlossen."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.abc"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -149,7 +149,10 @@ class Api(Flask):
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
self._logger.info(__name__, f"Starting API {self._api_settings.host}:{self._api_settings.port}")
|
self._logger.info(
|
||||||
|
__name__,
|
||||||
|
f"Starting API {self._api_settings.host}:{self._api_settings.port}",
|
||||||
|
)
|
||||||
self._register_routes()
|
self._register_routes()
|
||||||
self.secret_key = CredentialManager.decrypt(self._auth_settings.secret_key)
|
self.secret_key = CredentialManager.decrypt(self._auth_settings.secret_key)
|
||||||
# from waitress import serve
|
# from waitress import serve
|
@@ -48,4 +48,4 @@ class ApiModule(ModuleABC):
|
|||||||
services.add_transient(GraphQLController)
|
services.add_transient(GraphQLController)
|
||||||
|
|
||||||
# cpl-discord
|
# cpl-discord
|
||||||
self._dc.add_event(DiscordEventTypesEnum.on_ready.value, BotApiOnReadyEvent)
|
services.add_transient(DiscordEventTypesEnum.on_ready.value, BotApiOnReadyEvent)
|
@@ -3,8 +3,8 @@
|
|||||||
"Name": "bot-api",
|
"Name": "bot-api",
|
||||||
"Version": {
|
"Version": {
|
||||||
"Major": "1",
|
"Major": "1",
|
||||||
"Minor": "1",
|
"Minor": "2",
|
||||||
"Micro": "4"
|
"Micro": "0"
|
||||||
},
|
},
|
||||||
"Author": "",
|
"Author": "",
|
||||||
"AuthorEmail": "",
|
"AuthorEmail": "",
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.configuration"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports
|
# imports
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.controller"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.event"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.exception"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.filter"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.filter.discord"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.logging"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.model"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.model.discord"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -27,4 +27,8 @@ class TokenDTO(DtoABC):
|
|||||||
self._first_login = values["firstLogin"]
|
self._first_login = values["firstLogin"]
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {"token": self._token, "refreshToken": self._refresh_token, "firstLogin": self._first_login}
|
return {
|
||||||
|
"token": self._token,
|
||||||
|
"refreshToken": self._refresh_token,
|
||||||
|
"firstLogin": self._first_login,
|
||||||
|
}
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.route"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -25,7 +25,12 @@ class Route:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ServiceProviderABC.inject
|
@ServiceProviderABC.inject
|
||||||
def init_authorize(cls, env: ApplicationEnvironmentABC, auth_users: AuthUserRepositoryABC, auth: AuthServiceABC):
|
def init_authorize(
|
||||||
|
cls,
|
||||||
|
env: ApplicationEnvironmentABC,
|
||||||
|
auth_users: AuthUserRepositoryABC,
|
||||||
|
auth: AuthServiceABC,
|
||||||
|
):
|
||||||
cls._auth_users = auth_users
|
cls._auth_users = auth_users
|
||||||
cls._auth = auth
|
cls._auth = auth
|
||||||
cls._env = env.environment_name
|
cls._env = env.environment_name
|
||||||
@@ -52,7 +57,13 @@ class Route:
|
|||||||
return user
|
return user
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def authorize(cls, f: Callable = None, role: AuthRoleEnum = None, skip_in_dev=False, by_api_key=False):
|
def authorize(
|
||||||
|
cls,
|
||||||
|
f: Callable = None,
|
||||||
|
role: AuthRoleEnum = None,
|
||||||
|
skip_in_dev=False,
|
||||||
|
by_api_key=False,
|
||||||
|
):
|
||||||
if f is None:
|
if f is None:
|
||||||
return functools.partial(cls.authorize, role=role, skip_in_dev=skip_in_dev, by_api_key=by_api_key)
|
return functools.partial(cls.authorize, role=role, skip_in_dev=skip_in_dev, by_api_key=by_api_key)
|
||||||
|
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.service"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports
|
# imports
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_api.transformer"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_core"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports
|
# imports
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_core.abc"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -64,7 +64,11 @@ class ClientUtilsABC(ABC):
|
|||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
async def react_to_message_by_auto_role_rule(
|
async def react_to_message_by_auto_role_rule(
|
||||||
self, discord_channel_id: int, discord_message_id: int, rule: AutoRoleRule, guild: discord.Guild
|
self,
|
||||||
|
discord_channel_id: int,
|
||||||
|
discord_message_id: int,
|
||||||
|
rule: AutoRoleRule,
|
||||||
|
guild: discord.Guild,
|
||||||
):
|
):
|
||||||
pass
|
pass
|
||||||
|
|
28
bot/src/bot_core/abc/task_abc.py
Normal file
28
bot/src/bot_core/abc/task_abc.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import asyncio
|
||||||
|
from abc import abstractmethod
|
||||||
|
|
||||||
|
from cpl_core.configuration import ConfigurationABC
|
||||||
|
from cpl_core.dependency_injection import ServiceProviderABC
|
||||||
|
from cpl_discord.service import DiscordBotServiceABC
|
||||||
|
from discord.ext import commands
|
||||||
|
|
||||||
|
from bot_core.logging.task_logger import TaskLogger
|
||||||
|
|
||||||
|
|
||||||
|
class TaskABC(commands.Cog):
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self):
|
||||||
|
commands.Cog.__init__(self)
|
||||||
|
|
||||||
|
@ServiceProviderABC.inject
|
||||||
|
async def _wait_until_ready(self, config: ConfigurationABC, logger: TaskLogger, bot: DiscordBotServiceABC):
|
||||||
|
logger.debug(__name__, f"Waiting before {type(self).__name__}")
|
||||||
|
await bot.wait_until_ready()
|
||||||
|
|
||||||
|
async def wait():
|
||||||
|
is_ready = config.get_configuration("IS_READY")
|
||||||
|
if is_ready != "true":
|
||||||
|
await asyncio.sleep(1)
|
||||||
|
await wait()
|
||||||
|
|
||||||
|
await wait()
|
@@ -3,8 +3,8 @@
|
|||||||
"Name": "bot-core",
|
"Name": "bot-core",
|
||||||
"Version": {
|
"Version": {
|
||||||
"Major": "1",
|
"Major": "1",
|
||||||
"Minor": "1",
|
"Minor": "2",
|
||||||
"Micro": "4"
|
"Micro": "0"
|
||||||
},
|
},
|
||||||
"Author": "Sven Heidemann",
|
"Author": "Sven Heidemann",
|
||||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_core.configuration"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -16,7 +16,14 @@ class FeatureFlagsEnum(Enum):
|
|||||||
level_module = "LevelModule"
|
level_module = "LevelModule"
|
||||||
moderator_module = "ModeratorModule"
|
moderator_module = "ModeratorModule"
|
||||||
permission_module = "PermissionModule"
|
permission_module = "PermissionModule"
|
||||||
|
short_role_name_module = "ShortRoleNameModule"
|
||||||
|
steam_special_offers_module = "SteamSpecialOffersModule"
|
||||||
# features
|
# features
|
||||||
api_only = "ApiOnly"
|
api_only = "ApiOnly"
|
||||||
presence = "Presence"
|
presence = "Presence"
|
||||||
version_in_presence = "VersionInPresence"
|
version_in_presence = "VersionInPresence"
|
||||||
|
game_server = "GameServer"
|
||||||
|
sync_xp = "SyncXp"
|
||||||
|
short_role_name = "ShortRoleName"
|
||||||
|
technician_full_access = "TechnicianFullAccess"
|
||||||
|
steam_special_offers = "SteamSpecialOffers"
|
@@ -18,10 +18,17 @@ class FeatureFlagsSettings(ConfigurationModelABC):
|
|||||||
FeatureFlagsEnum.moderator_module.value: False, # 02.10.2022 #48
|
FeatureFlagsEnum.moderator_module.value: False, # 02.10.2022 #48
|
||||||
FeatureFlagsEnum.permission_module.value: True, # 02.10.2022 #48
|
FeatureFlagsEnum.permission_module.value: True, # 02.10.2022 #48
|
||||||
FeatureFlagsEnum.config_module.value: True, # 19.07.2023 #127
|
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
|
||||||
# features
|
# features
|
||||||
FeatureFlagsEnum.api_only.value: False, # 13.10.2022 #70
|
FeatureFlagsEnum.api_only.value: False, # 13.10.2022 #70
|
||||||
FeatureFlagsEnum.presence.value: True, # 03.10.2022 #56
|
FeatureFlagsEnum.presence.value: True, # 03.10.2022 #56
|
||||||
FeatureFlagsEnum.version_in_presence.value: False, # 21.03.2023 #253
|
FeatureFlagsEnum.version_in_presence.value: False, # 21.03.2023 #253
|
||||||
|
FeatureFlagsEnum.game_server.value: False, # 25.09.2023 #366
|
||||||
|
FeatureFlagsEnum.sync_xp.value: False, # 25.09.2023 #366
|
||||||
|
FeatureFlagsEnum.short_role_name.value: False, # 28.09.2023 #378
|
||||||
|
FeatureFlagsEnum.technician_full_access.value: False, # 03.10.2023 #393
|
||||||
|
FeatureFlagsEnum.steam_special_offers.value: False, # 11.10.2023 #188
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, **kwargs: dict):
|
def __init__(self, **kwargs: dict):
|
@@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bot Keksdose bot
|
bot sh-edraft.de Discord bot
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
Discord bot for customers of sh-edraft.de
|
||||||
|
|
||||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
@@ -15,7 +15,7 @@ __title__ = "bot_core.core_extension"
|
|||||||
__author__ = "Sven Heidemann"
|
__author__ = "Sven Heidemann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||||
__version__ = "1.1.4"
|
__version__ = "1.2.0"
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||||
version_info = VersionInfo(major="1", minor="1", micro="4")
|
version_info = VersionInfo(major="1", minor="2", micro="0")
|
@@ -19,4 +19,4 @@ class CoreExtensionModule(ModuleABC):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
|
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
|
||||||
self._dc.add_event(DiscordEventTypesEnum.on_ready.value, CoreExtensionOnReadyEvent)
|
services.add_transient(DiscordEventTypesEnum.on_ready.value, CoreExtensionOnReadyEvent)
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user