diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..b78e497
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,2 @@
+[*.{kt,kts}]
+ktlint_disabled_rules = import-ordering
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 70cd94f..a38e2c5 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,14 +1,15 @@
---
-name: πͺ² Bugs report
-about: Π‘ΠΎΠ·Π΄Π°ΠΉΡΠ΅ ΠΎΡΡΠ΅Ρ ΠΎΠ± ΠΎΡΠΈΠ±ΠΊΠ΅, ΡΡΠΎΠ±Ρ ΠΌΡ ΠΌΠΎΠ³Π»ΠΈ Π·Π°Π½ΡΡΡΡΡ ΡΠ»ΡΡΡΠ΅Π½ΠΈΠ΅ΠΌ
-title: '[BUG] ΠΠΎΡΠΎΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΠΎΡΠΈΠ±ΠΊΠΈ.'
-labels: 'type: bug, priority: low, status: backlog'
-assignees: 'SmithyVL'
-
+name: πͺ² ΠΡΠΈΠ±ΠΊΠ°
+about: Π‘ΠΎΠ·Π΄Π°ΠΉΡΠ΅ Π·Π°Π΄Π°ΡΡ Ρ ΠΏΠΎΠ΄ΡΠΎΠ±Π½ΡΠΌ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ΠΌ ΠΎΡΠΈΠ±ΠΊΠΈ, ΡΡΠΎΠ±Ρ ΠΌΡ ΠΌΠΎΠ³Π»ΠΈ Π·Π°Π½ΡΡΡΡΡ ΠΈΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ΠΌ
+title: "ΠΠΎΡΠΎΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅"
+labels: ["type: bug"]
+projects: ["HogwartsSchoolOfMagic/projects/2"]
+assignees:
+ - SmithyVL
---
**ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΡΠΈΠ±ΠΊΠΈ**
-Π§Π΅ΡΠΊΠΎΠ΅ ΠΈ ΠΊΡΠ°ΡΠΊΠΎΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΡΠΈΠ±ΠΊΠΈ.
+Π§Π΅ΡΠΊΠΎΠ΅ ΠΈ ΠΊΡΠ°ΡΠΊΠΎΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅.
**ΠΠΎΡΠΏΡΠΎΠΈΠ·Π²Π΅Π΄Π΅Π½ΠΈΠ΅**
Π¨Π°Π³ΠΈ ΠΏΠΎ Π²ΠΎΡΠΏΡΠΎΠΈΠ·Π²Π΅Π΄Π΅Π½ΠΈΡ ΠΏΠΎΠ²Π΅Π΄Π΅Π½ΠΈΡ:
@@ -27,4 +28,4 @@ assignees: 'SmithyVL'
ΠΡΠ»ΠΈ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ, ΠΏΠΎΠΆΠ°Π»ΡΠΉΡΡΠ°, ΠΏΡΠΈΠΊΡΠ΅ΠΏΠΈΡΠ΅ ΡΠΊΡΠΈΠ½ΡΠΎΡΡ, ΡΡΠΎΠ±Ρ ΠΎΠ±ΡΡΡΠ½ΠΈΡΡ Π²Π°ΡΡ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ.
**ΠΠΎΠΏΠΎΠ»Π½ΠΈΡΠ΅Π»ΡΠ½ΡΠΉ ΠΊΠΎΠ½ΡΠ΅ΠΊΡΡ**
-ΠΠΎΠ±Π°Π²ΡΡΠ΅ ΡΡΠ΄Π° Π»ΡΠ±ΠΎΠΉ Π΄ΡΡΠ³ΠΎΠΉ ΠΊΠΎΠ½ΡΠ΅ΠΊΡΡ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ.
\ No newline at end of file
+ΠΠΎΠ±Π°Π²ΡΡΠ΅ ΡΡΠ΄Π° Π»ΡΠ±ΠΎΠΉ Π΄ΡΡΠ³ΠΎΠΉ ΠΊΠΎΠ½ΡΠ΅ΠΊΡΡ.
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/configuration_issues.md b/.github/ISSUE_TEMPLATE/configuration_issues.md
index fd9ef60..75fbdbe 100644
--- a/.github/ISSUE_TEMPLATE/configuration_issues.md
+++ b/.github/ISSUE_TEMPLATE/configuration_issues.md
@@ -1,14 +1,15 @@
---
-name: π§° Configuration issues
-about: Π Π°Π·Π»ΠΈΡΠ½ΡΠ΅ ΠΏΡΠ΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΡ ΠΏΠΎ Π½Π°ΡΡΡΠΎΠΉΠΊΠ΅ ΠΏΡΠΎΠ΅ΠΊΡΠ°
-title: '[CONFIGURATION] ΠΡΠ°ΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ Π½ΠΎΠ²ΠΎΠΉ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ.'
-labels: 'type: configuration, status: backlog, priority: low'
-assignees: 'SmithyVL'
-
+name: π§° ΠΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ
+about: Π Π°Π·Π»ΠΈΡΠ½ΡΠ΅ ΠΏΡΠ΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΡ ΠΏΠΎ Π½Π°ΡΡΡΠΎΠΉΠΊΠ΅ ΠΏΡΠΎΠ΅ΠΊΡΠ° ΠΈ ΡΠ΅ΡΠ²ΠΈΡΠΎΠ² Π²Π½ΡΡΡΠΈ Π½Π΅Π³ΠΎ
+title: "ΠΡΠ°ΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅"
+labels: ["type: configuration"]
+projects: ["HogwartsSchoolOfMagic/projects/2"]
+assignees:
+ - SmithyVL
---
**ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ**
-Π§Π΅ΡΠΊΠΎΠ΅ ΠΈ ΠΊΡΠ°ΡΠΊΠΎΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΡΠΎΠ³ΠΎ, ΡΡΠΎ Π²Ρ Ρ
ΠΎΡΠΈΡΠ΅, ΡΡΠΎΠ±Ρ ΠΏΡΠΎΠΈΠ·ΠΎΡΠ»ΠΎ.
+Π§Π΅ΡΠΊΠΎΠ΅ ΠΈ ΠΊΡΠ°ΡΠΊΠΎΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΡΠΎΠ³ΠΎ, ΡΡΠΎ Π²Ρ Ρ
ΠΎΡΠΈΡΠ΅, ΡΡΠΎΠ±Ρ Π΄ΠΎΠ±Π°Π²ΠΈΠ»ΠΎΡΡ.
**ΠΠΏΠΈΡΠΈΡΠ΅ Π°Π»ΡΡΠ΅ΡΠ½Π°ΡΠΈΠ²Π½ΡΠ΅ Π²Π°ΡΠΈΠ°Π½ΡΡ**
Π§Π΅ΡΠΊΠΎΠ΅ ΠΈ ΠΊΡΠ°ΡΠΊΠΎΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ Π»ΡΠ±ΡΡ
Π°Π»ΡΡΠ΅ΡΠ½Π°ΡΠΈΠ²Π½ΡΡ
ΡΠ΅ΡΠ΅Π½ΠΈΠΉ ΠΈΠ»ΠΈ ΡΡΠ½ΠΊΡΠΈΠΉ, ΠΊΠΎΡΠΎΡΡΠ΅ Π²Ρ ΡΠ°ΡΡΠΌΠΎΡΡΠ΅Π»ΠΈ.
diff --git a/.github/ISSUE_TEMPLATE/docs_issues.md b/.github/ISSUE_TEMPLATE/docs_issues.md
index 51814f4..0563eb8 100644
--- a/.github/ISSUE_TEMPLATE/docs_issues.md
+++ b/.github/ISSUE_TEMPLATE/docs_issues.md
@@ -1,10 +1,11 @@
---
-name: π Docs issues
+name: π ΠΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ
about: Π£Π»ΡΡΡΠ΅Π½ΠΈΡ ΠΈΠ»ΠΈ Π΄ΠΎΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ ΠΊ Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ
-title: '[DOCS] ΠΡΠ°ΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΡΠ°Π±ΠΎΡ ΠΏΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ½ΠΎΠΉ Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ.'
-labels: 'type: documentation, status: backlog, priority: low'
-assignees: 'SmithyVL'
-
+title: "ΠΡΠ°ΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅"
+labels: ["type: documentation"]
+projects: ["HogwartsSchoolOfMagic/projects/2"]
+assignees:
+ - SmithyVL
---
**ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ**
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index ffdc2dd..ab85b71 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -1,10 +1,11 @@
---
-name: π Feature request
+name: π ΠΠΎΠ²Π°Ρ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»ΡΠ½ΠΎΡΡΡ
about: ΠΡΠ΅Π΄Π»ΠΎΠΆΠΈΡΠ΅ ΠΈΠ΄Π΅Ρ Π΄Π»Ρ ΡΡΠΎΠ³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ°
-title: '[FEATURE] ΠΡΠ°ΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»ΡΠ½ΠΎΡΡΠΈ.'
-labels: 'type: feature, status: backlog, priority: low'
-assignees: 'SmithyVL'
-
+title: "ΠΡΠ°ΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅"
+labels: ["type: feature"]
+projects: ["HogwartsSchoolOfMagic/projects/2"]
+assignees:
+ - SmithyVL
---
**ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»ΡΠ½ΠΎΡΡΠΈ**
diff --git a/.github/ISSUE_TEMPLATE/refactoring_issues.md b/.github/ISSUE_TEMPLATE/refactoring_issues.md
index 8717f8a..1537631 100644
--- a/.github/ISSUE_TEMPLATE/refactoring_issues.md
+++ b/.github/ISSUE_TEMPLATE/refactoring_issues.md
@@ -1,10 +1,11 @@
---
-name: π§Ύ Refactoring issues
+name: π§Ύ Π Π΅ΡΠ°ΠΊΡΠΎΡΠΈΠ½Π³
about: ΠΠΏΡΠΈΠΌΠΈΠ·Π°ΡΠΈΡ, ΡΠ»ΡΡΡΠ΅Π½ΠΈΠ΅ ΠΈ ΡΠΎΡΠΌΠ°ΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΠΊΠΎΠ΄Π°
-title: '[REFACTORING] ΠΡΠ°ΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΡΠ°Π±ΠΎΡ ΠΏΠΎ ΡΠ΅ΡΠ°ΠΊΡΠΎΡΠΈΠ½Π³Ρ.'
-labels: 'type: refactoring, status: backlog, priority: low'
-assignees: 'SmithyVL'
-
+title: "ΠΡΠ°ΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅"
+labels: ["type: refactoring"]
+projects: ["HogwartsSchoolOfMagic/projects/2"]
+assignees:
+ - SmithyVL
---
**ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΡΠ΅ΡΠ°ΠΊΡΠΎΡΠΈΠ½Π³Π°**
diff --git a/.github/ISSUE_TEMPLATE/testing_issues.md b/.github/ISSUE_TEMPLATE/testing_issues.md
index 2608180..0bd8c97 100644
--- a/.github/ISSUE_TEMPLATE/testing_issues.md
+++ b/.github/ISSUE_TEMPLATE/testing_issues.md
@@ -1,10 +1,11 @@
---
-name: π§ͺ Testing issues
+name: π§ͺ Π’Π΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅
about: Π’Π΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΠΊΠΎΠ΄Π°
-title: '[TESTING] ΠΡΠ°ΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΡΠ°Π±ΠΎΡ ΠΏΠΎ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ.'
-labels: 'type: testing, status: backlog, priority: low'
-assignees: 'SmithyVL'
-
+title: "ΠΡΠ°ΡΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅"
+labels: ["type: testing"]
+projects: ["HogwartsSchoolOfMagic/projects/2"]
+assignees:
+ - SmithyVL
---
**ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΊΠ΅ΠΉΡΠ° Π΄Π»Ρ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ**
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 508df18..a9950ad 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,9 +2,6 @@ name: CI
on:
workflow_dispatch:
- #push:
- # branches:
- # - master
pull_request:
types: [ opened, synchronize, reopened ]
@@ -14,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: π¦ Checkout
- uses: actions/checkout@v3
- - name: βοΈ Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° JDK 17
- uses: actions/setup-java@v3
+ uses: actions/checkout@v4
+ - name: βοΈ Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° JDK 21
+ uses: actions/setup-java@v4
with:
- java-version: 17
+ java-version: 21
distribution: "temurin"
cache: 'gradle'
- name: π Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΡΠ°Π·ΡΠ΅ΡΠ΅Π½ΠΈΠΉ Π½Π° gradlew
@@ -31,11 +28,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: π¦ Checkout
- uses: actions/checkout@v3
- - name: βοΈ Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° JDK 17
- uses: actions/setup-java@v3
+ uses: actions/checkout@v4
+ - name: βοΈ Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° JDK 21
+ uses: actions/setup-java@v4
with:
- java-version: 17
+ java-version: 21
distribution: "temurin"
cache: 'gradle'
- name: π Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΡΠ°Π·ΡΠ΅ΡΠ΅Π½ΠΈΠΉ Π½Π° gradlew
@@ -48,19 +45,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: π¦ Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- - name: βοΈ Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° JDK 17
- uses: actions/setup-java@v3
+ - name: βοΈ Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° JDK 21
+ uses: actions/setup-java@v4
with:
- java-version: 17
+ java-version: 21
distribution: "temurin"
cache: 'gradle'
- name: π Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΡΠ°Π·ΡΠ΅ΡΠ΅Π½ΠΈΠΉ Π½Π° gradlew
run: chmod +x ./gradlew
- name: π ΠΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ SonarCloud
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml
index f126ade..45d71dc 100644
--- a/.github/workflows/release_draft.yml
+++ b/.github/workflows/release_draft.yml
@@ -14,6 +14,6 @@ jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- - uses: release-drafter/release-drafter@v5
+ - uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 8ff09bd..7c7b760 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,18 @@
### Indellij Idea ###
**.iml
-.idea/
+.idea/git_toolbox_blame.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/kotlinc.xml
+.idea/ktlint-plugin.xml
+.idea/misc.xml
+.idea/workspace.xml
+.idea/.gitignore
+.idea/inspectionProfiles/
+.idea/gradle.xml
+.idea/sonarlint.xml
+.idea/vcs.xml
+.idea/git_toolbox_prj.xml
### Gradle ###
**/.gradle/
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..baeacf2
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..20e311c
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/icon.svg b/.idea/icon.svg
new file mode 100644
index 0000000..138d328
--- /dev/null
+++ b/.idea/icon.svg
@@ -0,0 +1,155 @@
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/ProtegoTotalumBotApp.xml b/.idea/runConfigurations/ProtegoTotalumBotApp.xml
new file mode 100644
index 0000000..df50123
--- /dev/null
+++ b/.idea/runConfigurations/ProtegoTotalumBotApp.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/assemble.xml b/.idea/runConfigurations/assemble.xml
new file mode 100644
index 0000000..9e9bfd3
--- /dev/null
+++ b/.idea/runConfigurations/assemble.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/ktlintCheck.xml b/.idea/runConfigurations/ktlintCheck.xml
new file mode 100644
index 0000000..ee7a8ec
--- /dev/null
+++ b/.idea/runConfigurations/ktlintCheck.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/.run/assemble.run.xml b/.run/assemble.run.xml
deleted file mode 100644
index 3d8d7a3..0000000
--- a/.run/assemble.run.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
- false
-
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
deleted file mode 100644
index e408836..0000000
--- a/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-### π ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅
-
-___
-ΠΠΎΠΊΠ° Π½Π΅ Π½Π°ΠΏΠΈΡΠ°Π½ΠΎ
-
-### π ΠΠ½ΡΡΡΡΠΊΡΠΈΠΈ ΠΏΠΎ Π·Π°ΠΏΡΡΠΊΡ
-
-___
-ΠΠΎΠΊΠ° Π½Π΅ Π½Π°ΠΏΠΈΡΠ°Π½ΠΎ
-
-### β ΠΠΊΠ»ΡΡΠ°Π΅Ρ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»ΡΠ½ΠΎΡΡΡ
-
-___
-ΠΠΎΠΊΠ° Π½Π΅ Π½Π°ΠΏΠΈΡΠ°Π½ΠΎ
-
-### π¨ Π‘ΡΠ΅ΠΊ ΡΠ΅Ρ
Π½ΠΎΠ»ΠΎΠ³ΠΈΠΉ
-
-___
-ΠΠΎΠΊΠ° Π½Π΅ Π½Π°ΠΏΠΈΡΠ°Π½ΠΎ
-
-### π« ΠΠΈΡΠ΅Π½Π·ΠΈΡ
-
-___
-
-**[Apache License Version 2.0](https://github.com/HogwartsSchoolOfMagic/ConfigurationService/blob/master/LICENSE)**
-
-_Copyright Β©2023, ΠΠ»Π°Π΄ΠΈΡΠ»Π°Π² [[SmithyVL]](https://github.com/SmithyVL) ΠΡΠ·Π½Π΅ΡΠΎΠ²_
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
index 1cf68c9..920177b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -10,7 +10,7 @@ plugins {
sonarqube {
properties {
- property("sonar.projectKey", "HogwartsSchoolOfMagic_DiscordLeoBot")
+ property("sonar.projectKey", "HogwartsSchoolOfMagic_ProtegoTotalumBot")
property("sonar.organization", "hogwarts-school-of-magic")
property("sonar.host.url", "https://sonarcloud.io")
}
@@ -43,4 +43,4 @@ subprojects {
configure {
debug.set(true)
}
-}
\ No newline at end of file
+}
diff --git a/buildSrc/src/main/kotlin/dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt
similarity index 78%
rename from buildSrc/src/main/kotlin/dependencies.kt
rename to buildSrc/src/main/kotlin/Dependencies.kt
index 16a87ce..fd4d58f 100644
--- a/buildSrc/src/main/kotlin/dependencies.kt
+++ b/buildSrc/src/main/kotlin/Dependencies.kt
@@ -2,24 +2,24 @@
* ΠΠΎΠ½ΡΡΠ°Π½ΡΡ Ρ Π½Π°Π·Π²Π°Π½ΠΈΡΠΌΠΈ Π³ΡΡΠΏΠΏ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊ.
*/
object Groups {
- /* Spring */
+ // Spring
const val SPRING_BOOT = "org.springframework.boot"
- /* ΠΠ°Π·Ρ Π΄Π°Π½Π½ΡΡ
*/
+ // ΠΠ°Π·Ρ Π΄Π°Π½Π½ΡΡ
const val POSTGRES = "org.postgresql"
const val LIQUIBASE = "org.liquibase"
- const val R2DBC = "io.r2dbc"
+ const val R2DBC = "org.postgresql"
- /* Reactor */
+ // Reactor
const val NETTY = "io.netty"
- /* Discord */
+ // Discord
const val KORD = "dev.kord"
- /* Π‘Π΅ΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΡ */
+ // Π‘Π΅ΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΡ
const val JACKSON = "com.fasterxml.jackson.module"
- /* Kotlin */
+ // Kotlin
const val KTX = "org.jetbrains.kotlinx"
const val REACTOR_KT = "io.projectreactor.kotlin"
const val KT = "org.jetbrains.kotlin"
@@ -29,24 +29,24 @@ object Groups {
* ΠΠΎΠ½ΡΡΠ°Π½ΡΡ Ρ Π½Π°Π·Π²Π°Π½ΠΈΡΠΌΠΈ Π°ΡΡΠ΅ΡΠ°ΠΊΡΠΎΠ² Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊ.
*/
object Artifacts {
- /* Spring */
+ // Spring
const val SPRING_BOOT = "spring-boot"
const val SPRING_BOOT_STARTER = "${SPRING_BOOT}-starter"
const val SPRING_BOOT_DATA_R2DBC = "${SPRING_BOOT}-starter-data-r2dbc"
const val SPRING_BOOT_DATA_WEBFLUX = "${SPRING_BOOT}-starter-webflux"
- /* ΠΠ°Π·Ρ Π΄Π°Π½Π½ΡΡ
*/
+ // ΠΠ°Π·Ρ Π΄Π°Π½Π½ΡΡ
const val POSTGRES = "postgresql"
const val LIQUIBASE = "liquibase-core"
const val PG_R2DBC = "r2dbc-postgresql"
- /* Reactor */
+ // Reactor
const val NETTY_CODEC = "netty-codec-http"
- /* Discord */
+ // Discord
const val KORD_CORE = "kord-core"
- /* Kotlin */
+ // Kotlin
const val KTX_REACTOR = "kotlinx-coroutines-reactor"
const val JACKSON_KT = "jackson-module-kotlin"
const val REACTOR_KT_EXT = "reactor-kotlin-extensions"
@@ -57,48 +57,48 @@ object Artifacts {
* ΠΠΎΠ½ΡΡΠ°Π½ΡΡ Ρ Π²Π΅ΡΡΠΈΡΠΌΠΈ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊ.
*/
object Versions {
- /* Spring */
- const val SPRING_BOOT = "3.0.4"
+ // Spring
+ const val SPRING_BOOT = "3.3.1"
- /* ΠΠ°Π·Ρ Π΄Π°Π½Π½ΡΡ
*/
- const val PG_R2DBC = "0.8.13.RELEASE"
+ // ΠΠ°Π·Ρ Π΄Π°Π½Π½ΡΡ
+ const val PG_R2DBC = "1.0.5.RELEASE"
- /* Reactor */
- const val NETTY_CODEC = "4.1.89.Final"
+ // Reactor
+ const val NETTY_CODEC = "4.1.111.Final"
- /* Discord */
- const val KORD_CORE = "0.8.0-M17"
+ // Discord
+ const val KORD_CORE = "0.14.0"
- /* Kotlin */
- const val KT = "1.8.10"
- const val KT_LINT = "11.3.1"
+ // Kotlin
+ const val KT = "1.9.22"
+ const val KT_LINT = "12.1.1"
- /* Sonar */
- const val SONAR = "3.5.0.2730"
+ // Sonar
+ const val SONAR = "5.0.0.4638"
}
/**
* ΠΠΎΠ½ΡΡΠ°Π½ΡΡ Ρ ΠΏΠΎΠ»Π½ΡΠΌ ΠΈΠΌΠ΅Π½Π΅ΠΌ ΠΏΠΎΠ΄ΠΊΠ»ΡΡΠ°Π΅ΠΌΠΎΠΉ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ.
*/
object Libs {
- /* Spring */
+ // Spring
const val SPRING_BOOT = "${Groups.SPRING_BOOT}:${Artifacts.SPRING_BOOT}"
const val SPRING_BOOT_STARTER = "${Groups.SPRING_BOOT}:${Artifacts.SPRING_BOOT_STARTER}"
const val SPRING_BOOT_DATA_R2DBC = "${Groups.SPRING_BOOT}:${Artifacts.SPRING_BOOT_DATA_R2DBC}"
const val SPRING_BOOT_DATA_WEBFLUX = "${Groups.SPRING_BOOT}:${Artifacts.SPRING_BOOT_DATA_WEBFLUX}"
- /* ΠΠ°Π·Ρ Π΄Π°Π½Π½ΡΡ
*/
+ // ΠΠ°Π·Ρ Π΄Π°Π½Π½ΡΡ
const val PG_R2DBC = "${Groups.R2DBC}:${Artifacts.PG_R2DBC}:${Versions.PG_R2DBC}"
const val POSTGRES = "${Groups.POSTGRES}:${Artifacts.POSTGRES}"
const val LIQUIBASE = "${Groups.LIQUIBASE}:${Artifacts.LIQUIBASE}"
- /* Discord */
+ // Discord
const val KORD_CORE = "${Groups.KORD}:${Artifacts.KORD_CORE}:${Versions.KORD_CORE}"
- /* Reactor */
+ // Reactor
const val NETTY_CODEC = "${Groups.NETTY}:${Artifacts.NETTY_CODEC}:${Versions.NETTY_CODEC}"
- /* Kotlin */
+ // Kotlin
const val KOTLINX_REACTOR = "${Groups.KTX}:${Artifacts.KTX_REACTOR}"
const val JACKSON_KT = "${Groups.JACKSON}:${Artifacts.JACKSON_KT}"
const val REACTOR_KT_EXT = "${Groups.REACTOR_KT}:${Artifacts.REACTOR_KT_EXT}"
@@ -109,18 +109,18 @@ object Libs {
* ΠΠΎΠ½ΡΡΠ°Π½ΡΡ Ρ Π½Π°Π·Π²Π°Π½ΠΈΡΠΌΠΈ ΠΏΠ»Π°Π³ΠΈΠ½ΠΎΠ².
*/
object Plugins {
- /* Spring */
+ // Spring
const val SPRING_ALIAS = "plugin.spring"
const val SPRING = "${Groups.KT}.${SPRING_ALIAS}"
const val SPRING_BOOT = Groups.SPRING_BOOT
const val SPRING_DEPS = "io.spring.dependency-management"
- /* Kotlin */
+ // Kotlin
const val JVM = "jvm"
const val KT = "kotlin"
const val KT_LINT = "org.jlleitschuh.gradle.ktlint"
- /* Sonar */
+ // Sonar
const val SONAR = "org.sonarqube"
}
@@ -129,7 +129,7 @@ object Plugins {
*/
object Common {
const val PROJECT_GROUP = "io.github.hogwartsschoolofmagic"
- const val PROJECT_VERSION = "2023.1"
- const val JDK_VERSION = "17"
+ const val PROJECT_VERSION = "0.0.1-SNAPSHOT"
+ const val JDK_VERSION = "21"
const val JSR305 = "-Xjsr305=strict"
-}
\ No newline at end of file
+}
diff --git a/dlb-discord/Dockerfile b/dlb-discord/Dockerfile
deleted file mode 100644
index 2a06283..0000000
--- a/dlb-discord/Dockerfile
+++ /dev/null
@@ -1,6 +0,0 @@
-FROM eclipse-temurin:17-jdk-alpine
-MAINTAINER Vladislav Kuznetsov
-VOLUME /tmp
-ADD build/libs/dlb-discord-2023.1.jar discord-leo-bot.jar
-EXPOSE 8080
-ENTRYPOINT ["java", "-jar", "discord-leo-bot.jar"]
\ No newline at end of file
diff --git a/docker/.env b/docker/.env
index 5aed45c..17fa423 100644
--- a/docker/.env
+++ b/docker/.env
@@ -1 +1 @@
-COMPOSE_PROJECT_NAME = leo-bot
\ No newline at end of file
+COMPOSE_PROJECT_NAME = protego-totalum-bot
\ No newline at end of file
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index ff2ce52..4b7ee41 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -1,10 +1,3 @@
-version: "3.9"
-
-networks:
- leo-network:
- name: $APPLICATION_NAME-network
- external: false
-
services:
database:
container_name: $APPLICATION_NAME-postgres
@@ -18,22 +11,27 @@ services:
POSTGRES_USER: $PG_USER
POSTGRES_PASSWORD: $PG_PASSWORD
networks:
- - leo-network
- leo-bot:
+ - protego-totalum-network
+ protego-totalum-bot:
container_name: $APPLICATION_NAME-bot
depends_on:
- database
build:
- context: ../dlb-discord
+ context: ../pt-discord
dockerfile: ./Dockerfile
ports:
- "8080:8080"
command:
- - discord-leo-bot.jar
+ - protego-totalum-bot.jar
environment:
- LEO_DB_HOST: database
- LEO_DB_PORT: 5432
+ PROTEGO_TOTALUM_DB_HOST: database
+ PROTEGO_TOTALUM_DB_PORT: 5432
networks:
- - leo-network
+ - protego-totalum-network
env_file:
- - ignore.env
\ No newline at end of file
+ - ignore.env
+
+networks:
+ protego-totalum-network:
+ name: $APPLICATION_NAME-network
+ external: false
\ No newline at end of file
diff --git a/docker/env.bat b/docker/env.bat
index fded3fa..c47d00a 100644
--- a/docker/env.bat
+++ b/docker/env.bat
@@ -1,6 +1,6 @@
-set APPLICATION_NAME=leo
+set APPLICATION_NAME=protego-totalum
-set PG_DBNAME=leo_db
-set PG_USER=leo_login
-set PG_PASSWORD=leo_password
+set PG_DBNAME=protego_totalum
+set PG_USER=protego_totalum
+set PG_PASSWORD=protego_totalum
set PG_PORT=5123
\ No newline at end of file
diff --git a/docker/postgres/create_schemas.sql b/docker/postgres/create_schemas.sql
index 39b0c1c..b1b558e 100644
--- a/docker/postgres/create_schemas.sql
+++ b/docker/postgres/create_schemas.sql
@@ -1,2 +1,3 @@
-\connect leo_db
-create schema if not exists leo_bot_schema;
\ No newline at end of file
+\connect protego_totalum
+create schema if not exists protego_totalum;
+create schema if not exists liquibase;
\ No newline at end of file
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000..17cccfd
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,43 @@
+
+
+
+
+
+### π ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅
+
+___
+ΠΠΎΠΊΠ° Π½Π΅ Π½Π°ΠΏΠΈΡΠ°Π½ΠΎ
+
+### π ΠΠ½ΡΡΡΡΠΊΡΠΈΠΈ ΠΏΠΎ Π·Π°ΠΏΡΡΠΊΡ
+
+___
+ΠΠΎΠΊΠ° Π½Π΅ Π½Π°ΠΏΠΈΡΠ°Π½ΠΎ
+
+### β ΠΠΊΠ»ΡΡΠ°Π΅Ρ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»ΡΠ½ΠΎΡΡΡ
+
+___
+ΠΠΎΠΊΠ° Π½Π΅ Π½Π°ΠΏΠΈΡΠ°Π½ΠΎ
+
+### π¨ Π‘ΡΠ΅ΠΊ ΡΠ΅Ρ
Π½ΠΎΠ»ΠΎΠ³ΠΈΠΉ
+
+___
+ΠΠΎΠΊΠ° Π½Π΅ Π½Π°ΠΏΠΈΡΠ°Π½ΠΎ
+
+### π« ΠΠΈΡΠ΅Π½Π·ΠΈΡ
+
+___
+
+**[Apache License Version 2.0](https://github.com/HogwartsSchoolOfMagic/ConfigurationService/blob/master/LICENSE)**
+
+_Copyright Β©2023, ΠΠ»Π°Π΄ΠΈΡΠ»Π°Π² [[SmithyVL]](https://github.com/SmithyVL) ΠΡΠ·Π½Π΅ΡΠΎΠ²_
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 774fae8..48c0a02 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/dlb-util/build.gradle.kts b/pt-common/build.gradle.kts
similarity index 89%
rename from dlb-util/build.gradle.kts
rename to pt-common/build.gradle.kts
index 1a705be..e5ed201 100644
--- a/dlb-util/build.gradle.kts
+++ b/pt-common/build.gradle.kts
@@ -7,6 +7,6 @@ tasks.findByName("bootJar")?.apply {
}
dependencies {
- /* Spring */
+ // Spring
compileOnly(Libs.SPRING_BOOT)
}
diff --git a/dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt b/pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt
similarity index 62%
rename from dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt
rename to pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt
index f214b9c..b63bfe1 100644
--- a/dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt
+++ b/pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt
@@ -11,18 +11,10 @@ import kotlin.reflect.KClass
*/
@PropertySource
annotation class YamlPropertySource(
- @get: AliasFor(annotation = PropertySource::class)
+ @get:AliasFor(annotation = PropertySource::class)
val name: String = "",
-
- @get: AliasFor(annotation = PropertySource::class)
+ @get:AliasFor(annotation = PropertySource::class)
val value: Array = [],
-
- @get: AliasFor(annotation = PropertySource::class)
- val ignoreResourceNotFound: Boolean = false,
-
- @get: AliasFor(annotation = PropertySource::class)
- val encoding: String = "",
-
- @get: AliasFor(annotation = PropertySource::class)
- val factory: KClass = YamlPropertySourceFactory::class
+ @get:AliasFor(annotation = PropertySource::class)
+ val factory: KClass = YamlPropertySourceFactory::class,
)
diff --git a/dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt b/pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt
similarity index 63%
rename from dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt
rename to pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt
index 28b549f..aebcb0d 100644
--- a/dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt
+++ b/pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt
@@ -9,6 +9,11 @@ import org.springframework.core.io.support.PropertySourceFactory
* Π€Π°Π±ΡΠΈΠΊΠ° Π΄Π»Ρ Π·Π°Π³ΡΡΠ·ΠΊΠΈ ΡΠ°ΠΉΠ»ΠΎΠ² ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ ΡΠΎΡΠΌΠ°ΡΠ° yml/yaml.
*/
internal class YamlPropertySourceFactory : PropertySourceFactory {
- override fun createPropertySource(name: String?, resource: EncodedResource): PropertySource<*> =
- YamlPropertySourceLoader().load(name ?: resource.resource.description, resource.resource).first()
+ override fun createPropertySource(
+ name: String?,
+ resource: EncodedResource,
+ ): PropertySource<*> =
+ resource.resource.let { innerRes ->
+ YamlPropertySourceLoader().load(name ?: innerRes.description, innerRes).first()
+ }
}
diff --git a/dlb-database/build.gradle.kts b/pt-database/build.gradle.kts
similarity index 54%
rename from dlb-database/build.gradle.kts
rename to pt-database/build.gradle.kts
index f963ecc..4fb65ba 100644
--- a/dlb-database/build.gradle.kts
+++ b/pt-database/build.gradle.kts
@@ -7,11 +7,11 @@ tasks.findByName("bootJar")?.apply {
}
dependencies {
- /* Spring */
+ // ΠΠ°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ, ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΠΌΡΠ΅ ΠΏΡΠΈ Π·Π°ΠΏΡΡΠΊΠ΅ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ.
+ // Spring.
runtimeOnly(Libs.SPRING_BOOT_STARTER)
- /* ΠΠ°Π·Π° Π΄Π°Π½Π½ΡΡ
*/
- implementation(Libs.SPRING_BOOT_DATA_R2DBC)
+ // ΠΠ°Π·Ρ Π΄Π°Π½Π½ΡΡ
.
runtimeOnly(Libs.POSTGRES)
runtimeOnly(Libs.LIQUIBASE)
runtimeOnly(Libs.PG_R2DBC) {
@@ -19,9 +19,13 @@ dependencies {
}
runtimeOnly(Libs.NETTY_CODEC)
- /* Kotlin */
+ // ΠΠ°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ, ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΠΌΡΠ΅ ΠΏΡΠΈ ΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΈΠΈ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ.
+ // ΠΠ°Π·Π° Π΄Π°Π½Π½ΡΡ
.
+ implementation(Libs.SPRING_BOOT_DATA_R2DBC)
+
+ // Kotlin.
implementation(Libs.KOTLINX_REACTOR)
- /* ΠΡΠΎΠ΅ΠΊΡΠ½ΡΠ΅ ΠΌΠΎΠ΄ΡΠ»ΠΈ */
- implementation(project(":dlb-util"))
+ // ΠΡΠΎΠ΅ΠΊΡΠ½ΡΠ΅ ΠΌΠΎΠ΄ΡΠ»ΠΈ.
+ implementation(project(":pt-common"))
}
diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DatabaseAutoConfiguration.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DatabaseAutoConfiguration.kt
similarity index 100%
rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DatabaseAutoConfiguration.kt
rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DatabaseAutoConfiguration.kt
diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt
similarity index 95%
rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt
rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt
index 8491d6a..54802ed 100644
--- a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt
+++ b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt
@@ -20,5 +20,5 @@ data class CommandsEntity(
val serverDiscordId: Long,
val name: String,
val description: String?,
- val isActive: Boolean? = true
+ val isActive: Boolean? = true,
)
diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt
similarity index 94%
rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt
rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt
index 5a68424..f42e957 100644
--- a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt
+++ b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt
@@ -16,5 +16,5 @@ data class ServersEntity(
@Id val id: Long? = null,
val discordId: Long,
val premiumLevel: Long? = 0,
- val isDeleted: Boolean? = false
+ val isDeleted: Boolean? = false,
)
diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt
similarity index 85%
rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt
rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt
index e8c5871..e4750e0 100644
--- a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt
+++ b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt
@@ -17,5 +17,8 @@ internal interface CommandsRepository : CoroutineCrudRepository
+ fun findByDiscordIdAndServerDiscordId(
+ commandDiscordId: Long,
+ serverDiscordId: Long,
+ ): Flow
}
diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/ServersRepository.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/ServersRepository.kt
similarity index 100%
rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/ServersRepository.kt
rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/ServersRepository.kt
diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt
similarity index 77%
rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt
rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt
index d355b07..19396ad 100644
--- a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt
+++ b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt
@@ -22,9 +22,12 @@ class CommandsService {
* @param serverDiscordId ΠΈΠ΄Π΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΎΡ ΡΠ΅ΡΠ²Π΅ΡΠ° Π² Discord.
* @return TRUE, Π΅ΡΠ»ΠΈ ΠΊΠΎΠΌΠ°Π½Π΄Π° Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½Π° ΠΈΠ»ΠΈ Π°ΠΊΡΠΈΠ²Π½Π°, ΠΈΠ½Π°ΡΠ΅ FALSE.
*/
- fun isActiveCommand(commandDiscordId: Long, serverDiscordId: Long) =
- commandsRepo.findByDiscordIdAndServerDiscordId(commandDiscordId, serverDiscordId)
- .take(1)
- .map { it.isActive == true }
- .onEmpty { emit(true) }
+ fun isActiveCommand(
+ commandDiscordId: Long,
+ serverDiscordId: Long,
+ ) = commandsRepo
+ .findByDiscordIdAndServerDiscordId(commandDiscordId, serverDiscordId)
+ .take(1)
+ .map { it.isActive == true }
+ .onEmpty { emit(true) }
}
diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/ServersService.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/ServersService.kt
similarity index 100%
rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/ServersService.kt
rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/ServersService.kt
diff --git a/dlb-database/src/main/resources/META-INF/spring.factories b/pt-database/src/main/resources/META-INF/spring.factories
similarity index 100%
rename from dlb-database/src/main/resources/META-INF/spring.factories
rename to pt-database/src/main/resources/META-INF/spring.factories
diff --git a/dlb-database/src/main/resources/database.yml b/pt-database/src/main/resources/database.yml
similarity index 100%
rename from dlb-database/src/main/resources/database.yml
rename to pt-database/src/main/resources/database.yml
diff --git a/pt-discord/Dockerfile b/pt-discord/Dockerfile
new file mode 100644
index 0000000..c3de601
--- /dev/null
+++ b/pt-discord/Dockerfile
@@ -0,0 +1,7 @@
+FROM openjdk:21
+USER 65534
+LABEL org.opencontainers.image.authors="Vladislav Kuznetsov "
+VOLUME /tmp
+ADD build/libs/pt-discord-0.0.1-SNAPSHOT.jar protego-totalum-bot.jar
+EXPOSE 8080
+ENTRYPOINT ["java", "-jar", "protego-totalum-bot.jar"]
\ No newline at end of file
diff --git a/dlb-discord/build.gradle.kts b/pt-discord/build.gradle.kts
similarity index 59%
rename from dlb-discord/build.gradle.kts
rename to pt-discord/build.gradle.kts
index debba73..e6fe11b 100644
--- a/dlb-discord/build.gradle.kts
+++ b/pt-discord/build.gradle.kts
@@ -3,18 +3,18 @@ plugins {
}
dependencies {
- /* ΠΡΠ½ΠΎΠ²Π½Π°Ρ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ° Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ Ρ Discord API */
+ // ΠΡΠ½ΠΎΠ²Π½Π°Ρ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ° Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ Ρ Discord API
implementation(Libs.KORD_CORE)
- /* Spring */
+ // Spring
implementation(Libs.SPRING_BOOT_DATA_WEBFLUX)
- /* Kotlin */
+ // Kotlin
implementation(Libs.JACKSON_KT)
implementation(Libs.REACTOR_KT_EXT)
implementation(Libs.KT_REFLECT)
implementation(Libs.KOTLINX_REACTOR)
- /* ΠΡΠΎΠ΅ΠΊΡΠ½ΡΠ΅ ΠΌΠΎΠ΄ΡΠ»ΠΈ */
- implementation(project(":dlb-database"))
+ // ΠΡΠΎΠ΅ΠΊΡΠ½ΡΠ΅ ΠΌΠΎΠ΄ΡΠ»ΠΈ
+ implementation(project(":pt-database"))
}
diff --git a/dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/LeoBotApp.kt b/pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/LeoBotApp.kt
similarity index 100%
rename from dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/LeoBotApp.kt
rename to pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/LeoBotApp.kt
diff --git a/dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/Command.kt b/pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/Command.kt
similarity index 100%
rename from dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/Command.kt
rename to pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/Command.kt
diff --git a/dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt b/pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt
similarity index 73%
rename from dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt
rename to pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt
index d9ba293..766c7b5 100644
--- a/dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt
+++ b/pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt
@@ -4,7 +4,7 @@ import dev.kord.core.Kord
import dev.kord.core.behavior.interaction.response.respond
import dev.kord.core.event.interaction.GuildChatInputCommandInteractionCreateEvent
import dev.kord.core.on
-import dev.kord.rest.builder.interaction.int
+import dev.kord.rest.builder.interaction.integer
import org.springframework.stereotype.Component
/**
@@ -18,10 +18,10 @@ class PlusCommand : Command() {
override suspend fun create(kord: Kord) {
kord.createGlobalChatInputCommand(getName(), getDescription()) {
- int(ARG1_NAME, ARG1_DESC) {
+ integer(ARG1_NAME, ARG1_DESC) {
required = true
}
- int(ARG2_NAME, ARG2_DESC) {
+ integer(ARG2_NAME, ARG2_DESC) {
required = true
}
}
@@ -36,9 +36,13 @@ class PlusCommand : Command() {
commandsService.isActiveCommand(commandDiscordId, serverDiscordId)
.collect {
if (it) {
- val first = command.integers[ARG1_NAME]!!
- val second = command.integers[ARG2_NAME]!!
- response.respond { content = "$first + $second = ${first + second}" }
+ val first = command.integers.getOrDefault(ARG1_NAME, null)
+ val second = command.integers.getOrDefault(ARG2_NAME, null)
+ if (first != null && second != null) {
+ response.respond { content = "$first + $second = ${first.plus(second)}" }
+ } else {
+ response.respond { content = "ΠΠ΄ΠΈΠ½ ΠΈΠ· ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΠΎΠ² Π½Π΅ ΠΏΠ΅ΡΠ΅Π΄Π°Π½" }
+ }
} else {
response.respond { content = "ΠΠΎΠΌΠ°Π½Π΄Π°: ${command.data.name} Π²ΡΠΊΠ»ΡΡΠ΅Π½Π° Π΄Π»Ρ ΡΡΠΎΠ³ΠΎ ΡΠ΅ΡΠ²Π΅ΡΠ°!" }
}
diff --git a/dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DiscordConfig.kt b/pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DiscordConfig.kt
similarity index 100%
rename from dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DiscordConfig.kt
rename to pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DiscordConfig.kt
diff --git a/dlb-discord/src/main/resources/application.yml b/pt-discord/src/main/resources/application.yml
similarity index 100%
rename from dlb-discord/src/main/resources/application.yml
rename to pt-discord/src/main/resources/application.yml
diff --git a/dlb-discord/src/main/resources/db/changelog/2023.1/db.2023.1-create_tables.yaml b/pt-discord/src/main/resources/db/changelog/2023.1/db.2023.1-create_tables.yaml
similarity index 100%
rename from dlb-discord/src/main/resources/db/changelog/2023.1/db.2023.1-create_tables.yaml
rename to pt-discord/src/main/resources/db/changelog/2023.1/db.2023.1-create_tables.yaml
diff --git a/dlb-discord/src/main/resources/db/changelog/2023.1/db.2023.1-master.yaml b/pt-discord/src/main/resources/db/changelog/2023.1/db.2023.1-master.yaml
similarity index 100%
rename from dlb-discord/src/main/resources/db/changelog/2023.1/db.2023.1-master.yaml
rename to pt-discord/src/main/resources/db/changelog/2023.1/db.2023.1-master.yaml
diff --git a/dlb-discord/src/main/resources/db/changelog/db.changelog-master.yaml b/pt-discord/src/main/resources/db/changelog/db.changelog-master.yaml
similarity index 100%
rename from dlb-discord/src/main/resources/db/changelog/db.changelog-master.yaml
rename to pt-discord/src/main/resources/db/changelog/db.changelog-master.yaml
diff --git a/settings.gradle.kts b/settings.gradle.kts
index be240ab..4f35a8a 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -1,7 +1,7 @@
-rootProject.name = "DiscordLeoBot"
+rootProject.name = "ProtegoTotalumBot"
include(
- "dlb-util",
- "dlb-database",
- "dlb-discord"
-)
\ No newline at end of file
+ "pt-common",
+ "pt-database",
+ "pt-discord",
+)