chore: remove sensitive word filter
This commit is contained in:
2 files changed
-24
No files matched your search
@@ -75,10 +75,6 @@ class FancyBot : OneBotListener {
|
||||
logger.info("$sender($senderId: $groupId >>> $messageId): $msg")
|
||||
logger.trace("$sender($senderId: $groupId >>> $messageId: $json")
|
||||
|
||||
if (SensitiveWord.containsSensitiveWords(message.text)) {
|
||||
message.reply("你似乎说了一个不能说的词(?)")
|
||||
}
|
||||
|
||||
if (message.message.any { it.type == ArrayMessageType.face && it.data.id.toString() == "419" }) {
|
||||
message.reply("你发牛魔的火车呢, 我直接就是打断")
|
||||
}
|
||||
@@ -281,5 +277,4 @@ suspend fun main() {
|
||||
initSetuIndex()
|
||||
initItems()
|
||||
initBackgroundTasks(instance)
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2024 RTAkland
|
||||
* Author: RTAkland
|
||||
* Date: 2024/11/7
|
||||
*/
|
||||
|
||||
|
||||
package cn.rtast.fancybot.util
|
||||
|
||||
import cn.rtast.fancybot.util.str.proxy
|
||||
|
||||
object SensitiveWord {
|
||||
private val SENSITIVE_WORD_URL =
|
||||
"https://raw.githubusercontent.com/cjh0613/tencent-sensitive-words/refs/heads/main/sensitive_words.txt".proxy
|
||||
private const val SEPARATOR = "、"
|
||||
private val sensitiveWords = Http.get(SENSITIVE_WORD_URL).split(SEPARATOR)
|
||||
|
||||
fun containsSensitiveWords(input: String): Boolean = sensitiveWords.contains(input)
|
||||
}
|
||||
Reference in New Issue
Block a user