Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LilyBot 5.0.0 #422

Merged
merged 48 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2ff1f07
Bump detekt from 1.23.1 to 1.23.3 (#362)
dependabot[bot] Nov 16, 2023
57937a0
Bump kotlin from 1.9.10 to 1.9.20 (#363)
dependabot[bot] Nov 16, 2023
bc25aff
Bump org.litote.kmongo:kmongo-coroutine-serialization (#364)
dependabot[bot] Nov 16, 2023
be51c22
Bump io.github.oshai:kotlin-logging from 5.1.0 to 5.1.1 (#366)
dependabot[bot] Dec 22, 2023
d036fd4
Bump AButler/upload-release-assets from 2.0 to 3.0 (#367)
dependabot[bot] Dec 22, 2023
892cbf2
Bump kotlin from 1.9.20 to 1.9.21 (#368)
dependabot[bot] Dec 22, 2023
88aa9f1
Bump detekt from 1.23.3 to 1.23.4 (#369)
dependabot[bot] Dec 22, 2023
5416a21
Bump ch.qos.logback:logback-classic from 1.4.11 to 1.4.14 (#371)
dependabot[bot] Dec 22, 2023
5544413
Bump actions/setup-java from 3 to 4 (#372)
dependabot[bot] Dec 22, 2023
7b439e6
Bump actions/upload-artifact from 3 to 4 (#374)
dependabot[bot] Dec 22, 2023
96a0f33
Update to Kordex 1.7.1-SNAPSHOT
NoComment1105 Dec 22, 2023
dba1bb3
Remove redundant codec
NoComment1105 Jan 31, 2024
34ab851
Update dependencies and upgradle (still hilarious)
NoComment1105 Jan 31, 2024
27b7211
Update dependencies
NoComment1105 Jan 31, 2024
c499974
Fix cancelling reminders with moderation command.
NoComment1105 Feb 8, 2024
631e8e2
Add 'Auto-invite Moderator Role' option (#382)
TheKodeToad Feb 9, 2024
359886e
Fix unpinning/pinning of old messages causing edit log (#381)
NoComment1105 Feb 9, 2024
7b4a987
Update dependencies
NoComment1105 Feb 21, 2024
adc58dd
Merge branch 'main' into develop
NoComment1105 Mar 5, 2024
9ef8397
Merge branch 'main' into develop
NoComment1105 Apr 2, 2024
fbfcde5
Bump org.kohsuke:github-api from 1.318 to 1.319 (#385)
dependabot[bot] Apr 2, 2024
97674b2
Bump kotlin from 1.9.22 to 1.9.23 (#390)
dependabot[bot] Apr 2, 2024
96b3cd6
Bump ch.qos.logback:logback-classic from 1.5.0 to 1.5.3 (#388)
dependabot[bot] Apr 2, 2024
b82f7ef
Create a moderation arguments class to shrink the arguments down
NoComment1105 Apr 2, 2024
aab071a
Revert "Create a moderation arguments class to shrink the arguments d…
NoComment1105 Apr 2, 2024
8799f52
Allow multiple roles to be pinged on auto-threads (#386)
NoComment1105 Apr 4, 2024
1c8b510
Update dependencies
NoComment1105 Apr 10, 2024
a61c526
Implement temporary bans (#391)
NoComment1105 Apr 10, 2024
ce9eac2
Fix permissions being lost by locked channels when unlocked (#395)
NoComment1105 Apr 12, 2024
370c361
Bump ch.qos.logback:logback-classic from 1.5.3 to 1.5.6 (#398)
dependabot[bot] May 12, 2024
1307899
Bump io.github.oshai:kotlin-logging from 6.0.4 to 6.0.9 (#397)
dependabot[bot] May 12, 2024
be6d61c
Merge branch 'refs/heads/main' into develop
NoComment1105 Jun 13, 2024
349ba5f
Merge remote-tracking branch 'origin/develop' into develop
NoComment1105 Jun 13, 2024
56b009f
Fix lily being unable to unlock channels after she locks them
NoComment1105 Jun 13, 2024
b3d1f68
Hopefully avoid funny embeds appearing when messages don't change pro…
NoComment1105 Jun 13, 2024
9c38371
Bump org.kohsuke:github-api from 1.321 to 1.322 (#406)
dependabot[bot] Jun 29, 2024
0680156
Update to Kotlin 2
NoComment1105 Jul 1, 2024
f812228
Update to Java 21 :sunglasses:
NoComment1105 Jul 2, 2024
8fcdb87
Merge branch 'refs/heads/main' into develop
NoComment1105 Jul 9, 2024
c81692f
Merge branch 'refs/heads/main' into develop
NoComment1105 Jul 16, 2024
17872cf
Update dependencies and gradle
NoComment1105 Jul 16, 2024
58143e7
Update KordEx, Kotlin, Gradle, fix small K2 warnings (#413)
gdude2002 Aug 20, 2024
dc16c08
Update to KordEx 2.2.0, other dependencies
NoComment1105 Aug 25, 2024
7d2b6ff
Package restructure (#417)
NoComment1105 Aug 25, 2024
378f224
More event logging (#410)
NoComment1105 Aug 29, 2024
1998d2e
Reduce some duplication here and there
NoComment1105 Aug 29, 2024
22d399f
Dm default false (#421)
NoComment1105 Sep 20, 2024
d3c905c
Well, lets do this I guess
NoComment1105 Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ indent_style = tab

[*.kt]
indent_style = tab
ij_kotlin_name_count_to_use_star_import = 99999
ij_kotlin_name_count_to_use_star_import_for_members = 99999

[*.properties]
indent_style = space
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4

with:
distribution: 'temurin'
java-version: 17
java-version: 21

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build Artifacts
uses: gradle/gradle-build-action@v3
with:
arguments: build --stacktrace
gradle-home-cache-cleanup: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build Project
run: ./gradlew build --stacktrace

- name: Upload build artifacts
uses: actions/upload-artifact@v4
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4

with:
distribution: 'temurin'
java-version: 17
java-version: 21

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build Artifacts
uses: gradle/gradle-build-action@v3
with:
arguments: build --stacktrace
gradle-home-cache-cleanup: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build Project
run: ./gradlew build --stacktrace

- name: Upload build artifacts
uses: actions/upload-artifact@v4
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4

with:
distribution: 'temurin'
java-version: 17
java-version: 21

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build Artifacts
uses: gradle/gradle-build-action@v3
with:
arguments: build --stacktrace
gradle-home-cache-cleanup: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build Project
run: ./gradlew build --stacktrace

- name: Upload artifacts GitHub
uses: AButler/upload-release-assets@v3.0
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ build/
out/
classes/

# kotlin
.kotlin/

# eclipse

*.launch
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:17-jdk-slim
FROM openjdk:21-jdk-slim

RUN mkdir /bot
RUN mkdir /data
Expand Down
20 changes: 16 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ plugins {
}

group = "org.hyacinthbots.lilybot"
version = "4.9.0"
version = "5.0.0"

val className = "org.hyacinthbots.lilybot.LilyBotKt"

repositories {
mavenCentral()
Expand All @@ -30,6 +32,11 @@ repositories {
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}

maven {
name = "Kord Extensions (Snapshots)"
url = uri("https://snapshots-repo.kordex.dev")
}

maven {
name = "JitPack"
url = uri("https://jitpack.io")
Expand Down Expand Up @@ -61,7 +68,7 @@ dependencies {
}

application {
mainClass.set("org.hyacinthbots.lilybot.LilyBotKt")
mainClass.set(className)
}

gitHooks {
Expand All @@ -73,16 +80,21 @@ gitHooks {
tasks {
withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget("17"))
jvmTarget.set(JvmTarget.fromTarget("21"))
languageVersion.set(KotlinVersion.fromVersion(libs.plugins.kotlin.get().version.requiredVersion.substringBeforeLast(".")))
incremental = true
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
}
}

java { // Should match the Kotlin compiler options ideally
sourceCompatibility = JavaVersion.toVersion("21")
targetCompatibility = JavaVersion.toVersion("21")
}

jar {
manifest {
attributes("Main-Class" to "org.hyacinthbots.lilybot.LilyBotKt")
attributes("Main-Class" to className)
}
}

Expand Down
3 changes: 3 additions & 0 deletions detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ formatting:
active: true
autoCorrect: true
NoWildcardImports:
active: false
packagesToUseImportOnDemandProperty: ""
PackageName:
active: true
Expand Down Expand Up @@ -361,3 +362,5 @@ style:
active: true
UseRequireNotNull:
active: true
WildcardImport:
active: false
87 changes: 60 additions & 27 deletions docs/commands.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Slash Commands

### Command name: `about`
**Description**: Learn about this bot

* Arguments:
None
---
### Command name: `auto-threading enable`
**Description**: Automatically create a thread for each message sent in this channel.

Expand Down Expand Up @@ -37,6 +43,28 @@ None
* **Arguments**:
* `channel` - The channel to view the auto-threading settings for. - Channel

---
### Command name: `auto-threading add-roles`
**Description**: Add extra to threads in auto-threaded channels

**Additional Information**: This command will add roles to be pinged alongside the default ping role for this auto-threaded channel

**Required Member Permissions**: Manage Channels

* **Arguments**:
* `role` - A role to invite to threads in this channel - Optional Role

---
### Command name: `auto-threading remove-roles`
**Description**: Remove extra from threads in auto-threaded channels

**Additional Information**: This command will remove roles that have been added to be pinged alongside the default ping role for this auto-threaded channel

**Required Member Permissions**: Manage Channels

* **Arguments**:
* `role` - A role to invite to threads in this channel - Optional Role

---
### Command name: `clear count`
**Description**: Clear a specific count of messages
Expand Down Expand Up @@ -80,21 +108,6 @@ None
* `before` - The ID of the message to clear before - Snowflake
* `author` - The author of the messages to clear - Optional User

---
### Command name: `config moderation`
**Description**: Configure Lily's moderation system

**Required Member Permissions**: Manage Server

* **Arguments**:
* `enable-moderation` - Whether to enable the moderation system - Boolean
* `moderator-role` - The role of your moderators, used for pinging in message logs. - Optional Role
* `action-log` - The channel used to store moderator actions. - Optional Channel
* `quick-timeout-length` - The length of timeouts to use for quick timeouts - Coalescing Optional Duration
* `warn-auto-punishments` - Whether to automatically punish users for reach a certain threshold on warns - Optional Boolean
* `log-publicly` - Whether to log moderation publicly or not. - Optional Boolean
* `ban-dm-message` - A custom message to send to users when they are banned. - Optional String

---
### Command name: `config logging`
**Description**: Configure Lily's logging system
Expand All @@ -110,6 +123,22 @@ None
* `member-log` - The channel for logging members joining and leaving the guild - Optional Channel
* `public-member-log` - The channel for the public logging of members joining and leaving the guild - Optional Channel

---
### Command name: `config moderation`
**Description**: Configure Lily's moderation system

**Required Member Permissions**: Manage Server

* **Arguments**:
* `enable-moderation` - Whether to enable the moderation system - Boolean
* `moderator-role` - The role of your moderators, used for pinging in message logs. - Optional Role
* `action-log` - The channel used to store moderator actions. - Optional Channel
* `quick-timeout-length` - The length of timeouts to use for quick timeouts - Coalescing Optional Duration
* `warn-auto-punishments` - Whether to automatically punish users for reach a certain threshold on warns - Optional Boolean
* `log-publicly` - Whether to log moderation publicly or not. - Optional Boolean
* `ban-dm-message` - A custom message to send to users when they are banned. - Optional String
* `auto-invite-moderator-role` - Silently ping moderators to invite them to new threads. - Optional Boolean

---
### Command name: `config utility`
**Description**: Configure Lily's utility settings
Expand Down Expand Up @@ -211,12 +240,6 @@ None
### Command name: `help`
**Description**: Get help with using Lily!

* Arguments:
None
---
### Command name: `info`
**Description**: Learn about Lily, and get uptime data!

* Arguments:
None
---
Expand Down Expand Up @@ -322,22 +345,32 @@ None
* `user` - Person to ban - User
* `delete-message-days` - The number of days worth of messages to delete - Int
* `reason` - The reason for the ban - Defaulting String
* `soft-ban` - Weather to soft-ban this user (unban them once messages are deleted) - Defaulting Boolean
* `dm` - Whether to send a direct message to the user about the ban - Defaulting Boolean
* `image` - An image you'd like to provide as extra context for the action - Optional Attachment

---
### Command name: `soft-ban`
**Description**: Soft-bans a user.
### Command name: `temp-ban add`
**Description**: Temporarily bans a user

**Required Member Permissions**: Ban Members

* Arguments:
* `user` - Person to Soft ban - User
* `delete-message-days` - The number of days worth of messages to delete - Optional Int/Long
* **Arguments**:
* `user` - Person to ban - User
* `delete-message-days` - The number of days worth of messages to delete - Int
* `duration` - The duration of the temporary ban. - Coalescing Duration
* `reason` - The reason for the ban - Defaulting String
* `dm` - Whether to send a direct message to the user about the soft-ban - Defaulting Boolean
* `dm` - Whether to send a direct message to the user about the ban - Defaulting Boolean
* `image` - An image you'd like to provide as extra context for the action - Optional Attachment

---
### Command name: `temp-ban view-all`
**Description**: View all temporary bans for this guild

**Required Member Permissions**: Ban Members

* **Arguments**:
None
---
### Command name: `unban`
**Description**: Unbans a user.
Expand Down
27 changes: 14 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
[versions]
# Plugins
kotlin = "1.9.22"
kotlin = "2.0.10"
shadow = "8.1.1"
detekt = "1.23.5"
detekt = "1.23.7"
git-hooks = "0.0.2"
grgit = "5.2.2"
blossom = "2.1.0"

# Libraries
kord-extensions = "1.8.0-20240319.115836-21"
logging = "6.0.3"
logback = "1.5.0"
github-api = "1.318"
kmongo = "4.11.0"
docgenerator = "0.1.5-SNAPSHOT"
kord-extensions = "2.2.0-20240824.203242-3"
logging = "7.0.0"
logback = "1.5.8"
github-api = "1.325"
kmongo = "5.1.0"
docgenerator = "0.2.2-SNAPSHOT"

[libraries]
kord-extensions-core = { module = "com.kotlindiscord.kord.extensions:kord-extensions", version.ref = "kord-extensions" }
kord-extensions-phishing = { module = "com.kotlindiscord.kord.extensions:extra-phishing", version.ref = "kord-extensions" }
kord-extensions-pluralkit = { module = "com.kotlindiscord.kord.extensions:extra-pluralkit", version.ref = "kord-extensions"}
kord-extensions-unsafe = { module = "com.kotlindiscord.kord.extensions:unsafe", version.ref = "kord-extensions"}
kord-extensions-welcome = { module = "com.kotlindiscord.kord.extensions:extra-welcome", version.ref = "kord-extensions"}
kord-extensions-core = { module = "dev.kordex:kord-extensions", version.ref = "kord-extensions" }
kord-extensions-phishing = { module = "dev.kordex.modules:func-phishing", version.ref = "kord-extensions" }
kord-extensions-pluralkit = { module = "dev.kordex.modules:pluralkit", version.ref = "kord-extensions"}
kord-extensions-unsafe = { module = "dev.kordex.modules:dev-unsafe", version.ref = "kord-extensions"}
kord-extensions-welcome = { module = "dev.kordex.modules:func-welcome", version.ref = "kord-extensions"}

kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib" }
logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
logging = { module = "io.github.oshai:kotlin-logging", version.ref = "logging" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
Loading