feat: add bad word filter
This commit is contained in:
8 files changed
+49
-4
No files matched your search
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright © 2024 RTAkland
|
||||
* Author: RTAkland
|
||||
* Date: 2024/9/18
|
||||
*/
|
||||
|
||||
|
||||
package cn.rtast.fancybot.util.file
|
||||
|
||||
import cn.rtast.fancybot.util.JsonFileHandler
|
||||
|
||||
class BadWordManager: JsonFileHandler<List<String>>("bd.json", listOf<String>()) {
|
||||
|
||||
fun contain(word: String): Boolean {
|
||||
return this.read<List<String>>().any { word.contains(it) }
|
||||
}
|
||||
}
|
||||
@@ -28,4 +28,5 @@ class ConfigManager : JsonFileHandler<Config>("config.json") {
|
||||
val smtpPassword get() = this.read<Config>().smtpPassword
|
||||
val smtpFromAddress get() = this.read<Config>().smtpFromAddress
|
||||
val admins get() = this.read<Config>().admins
|
||||
val enableAntiRevoke get() = this.read<Config>().enableAntiRevoke
|
||||
}
|
||||
Reference in New Issue
Block a user