-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #297 from HyacinthBots/develop
4.4.0
- Loading branch information
Showing
34 changed files
with
2,123 additions
and
1,471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Security Policy | ||
|
||
This policy details how to report vulnerabilities and the steps taken to ensure vulnerabilities are mitigated. | ||
|
||
## Supported Versions | ||
We only support the latest version of LilyBot, as this is the version used in our production bot environment. If you are using an outdated version, please update and see if the vulnerability is still present. | ||
|
||
## Reporting a Vulnerability | ||
|
||
When reporting a vulnerability, we request that you gather all the information you can about the vulnerability and compile it into a document before sending it to us via email at hyacinthbots@outlook.com. | ||
|
||
You will receive a response quickly declaring that we have received your email and the contents of it and are now aware of the vulnerability. We will proceed to make inquiries into the severity of the vulnerability and determine the speed and course of action to take. | ||
|
||
You will receive updates on the vulnerability as and when we have them. You will be regularly informed of what we find and the course of action we are taking. | ||
|
||
Upon removal of the vulnerability you will receive an email detailing this and a new release will be created, containing a fix for the vulnerability, to ensure that everyone is made safe. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# LilyBot 4.4.0 | ||
|
||
This update fixes a number of exceptions thrown by the bot under certain conditions, as well as changes to info commands | ||
and the moderation commands. | ||
You can find the full changelog below. | ||
|
||
New: | ||
* Completely rewritten moderation commands, now with a Message command for quick moderation actions. This also comes with | ||
complete PluralKit support out of the box | ||
* A Security Policy has been written to show users where to send security reports if necessary | ||
|
||
Change: | ||
* Info commands have been rewritten and restructured to make more sense and provide useful information | ||
* auto-ban anyone who says the word Kotlin | ||
|
||
Fix: | ||
* Fixes for reminders to reduce the amount of exceptions thrown | ||
* Switch to using `OrNull` statements and catching nulls rather than letting exceptions fly | ||
* Update KordEx to fix an issue with PluralKit Extension | ||
|
||
|
||
You can find a list of all the commits in this update [here](https://github.com/hyacinthbots/LilyBot/compare/v4.3.0...v4.4.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/main/kotlin/org/hyacinthbots/lilybot/database/collections/UptimeCollection.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.hyacinthbots.lilybot.database.collections | ||
|
||
import com.kotlindiscord.kord.extensions.koin.KordExKoinComponent | ||
import kotlinx.datetime.Instant | ||
import org.hyacinthbots.lilybot.database.Database | ||
import org.hyacinthbots.lilybot.database.entities.UptimeData | ||
import org.koin.core.component.inject | ||
import org.litote.kmongo.ne | ||
import org.litote.kmongo.setValue | ||
|
||
/** | ||
* Stores the functions for interacting with [the uptime database][UptimeData]. This class contains the functions for | ||
* getting, setting and updating the data | ||
* | ||
* @see get | ||
* @see set | ||
* @see update | ||
* @since 4.2.0 | ||
*/ | ||
class UptimeCollection : KordExKoinComponent { | ||
private val db: Database by inject() | ||
|
||
@PublishedApi | ||
internal val collection = db.mainDatabase.getCollection<UptimeData>() | ||
|
||
/** | ||
* Gets the uptime data from the database. | ||
* | ||
* @return the main metadata | ||
* @author NoComment1105 | ||
* @since 4.2.0 | ||
*/ | ||
suspend fun get(): UptimeData? = | ||
collection.findOne() | ||
|
||
/** | ||
* Sets the on time. | ||
* | ||
* @author NoComment1105 | ||
* @since 4.2.0 | ||
*/ | ||
suspend fun set(onTime: Instant) = | ||
collection.insertOne(UptimeData(onTime)) | ||
|
||
/** | ||
* Updates the uptime data in the database with the new [data][UptimeData]. | ||
* | ||
* @author NoComment1105 | ||
* @since 4.2.0 | ||
*/ | ||
suspend fun update(onTime: Instant) = | ||
collection.updateOne(UptimeData::onTime ne null, setValue(UptimeData::onTime, onTime)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/kotlin/org/hyacinthbots/lilybot/database/entities/UptimeData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.hyacinthbots.lilybot.database.entities | ||
|
||
import kotlinx.datetime.Instant | ||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* The data to help calculate bot uptime. | ||
* | ||
* @property onTime The instant the bot turned on | ||
* @since 4.2.0 | ||
*/ | ||
@Serializable | ||
data class UptimeData( | ||
val onTime: Instant | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/org/hyacinthbots/lilybot/database/migrations/config/configV2.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.hyacinthbots.lilybot.database.migrations.config | ||
|
||
import org.hyacinthbots.lilybot.database.entities.ModerationConfigData | ||
import org.litote.kmongo.coroutine.CoroutineDatabase | ||
import org.litote.kmongo.exists | ||
import org.litote.kmongo.setValue | ||
|
||
suspend fun configV2(db: CoroutineDatabase) { | ||
with(db.getCollection<ModerationConfigData>("moderationConfigData")) { | ||
updateMany( | ||
ModerationConfigData::quickTimeoutLength exists false, | ||
setValue(ModerationConfigData::quickTimeoutLength, null) | ||
) | ||
|
||
updateMany( | ||
ModerationConfigData::autoPunishOnWarn exists false, | ||
setValue(ModerationConfigData::autoPunishOnWarn, null) | ||
) | ||
} | ||
} |
Oops, something went wrong.