Skip to content

Commit

Permalink
fuck you gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
guimc233 committed Feb 24, 2024
1 parent 0dcdb02 commit e3a6fb7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ dependencies {
compileOnly("xyz.cssxsh.mirai:mirai-hibernate-plugin:2.8.0")
testConsoleRuntime("top.mrxiaom:overflow-core:$overflow_version")
testImplementation("xyz.cssxsh.mirai:mirai-hibernate-plugin:2.8.0")

compileOnly(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
}

mirai {
Expand Down
Binary file added libs/mirai-hibernate-plugin-2.8.0.jar
Binary file not shown.
1 change: 1 addition & 0 deletions src/main/kotlin/ltd/guimc/lgzbot/PluginMain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ object PluginMain : KotlinPlugin(
"LgzBot",
){
author("BakaBotTeam")
dependsOn("xyz.cssxsh.mirai.plugin.mirai-hibernate-plugin", false)
}
) {
lateinit var bypassMute: Permission
Expand Down
31 changes: 11 additions & 20 deletions src/main/kotlin/ltd/guimc/lgzbot/command/LGZBotCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,12 @@ import ltd.guimc.lgzbot.utils.LL4JUtils
import ltd.guimc.lgzbot.utils.MessageUtils.getPlainText
import ltd.guimc.lgzbot.utils.OverflowUtils
import ltd.guimc.lgzbot.word.WordUtils
import net.mamoe.mirai.console.command.CommandSender
import net.mamoe.mirai.console.command.CompositeCommand
import net.mamoe.mirai.console.command.getGroupOrNull
import net.mamoe.mirai.console.command.isConsole
import net.mamoe.mirai.console.command.*
import net.mamoe.mirai.contact.Member
import net.mamoe.mirai.contact.NormalMember
import net.mamoe.mirai.message.data.At
import net.mamoe.mirai.message.data.MessageChainBuilder
import net.mamoe.mirai.message.data.PlainText
import net.mamoe.mirai.message.data.QuoteReply
import net.mamoe.mirai.message.data.*
import top.mrxiaom.overflow.contact.Updatable
import xyz.cssxsh.mirai.hibernate.MiraiHibernateRecorder
import kotlin.math.roundToInt
import kotlin.time.Duration

Expand Down Expand Up @@ -121,8 +116,14 @@ object LGZBotCommand : CompositeCommand(

@SubCommand("check")
@Description("使用模型检测一段文本是否合规")
suspend fun CommandSender.iI1I1i1I1i1I(string: String) {
if (LL4JUtils.predict(string)) {
suspend fun CommandSenderOnMessage<*>.iI1I1i1I1i1I(string: String) {
var str = string
if (string == "reply") {
val quote = fromEvent.message.findIsInstance<QuoteReply>() ?: return
val raw = MiraiHibernateRecorder[quote.source] as MessageChain
str = raw.getPlainText()
}
if (LL4JUtils.predict(str)) {
sendMessage("不合规")
} else {
sendMessage("合规")
Expand All @@ -135,14 +136,4 @@ object LGZBotCommand : CompositeCommand(
LL4JUtils.learn(type, string)
sendMessage("Done.")
}

@SubCommand("check")
@Description("使用模型检测一段文本是否合规")
suspend fun CommandSender.iI1I1i1I1i1I(string: QuoteReply) {
if (LL4JUtils.predict(string.source.originalMessage.getPlainText())) {
sendMessage("不合规")
} else {
sendMessage("合规")
}
}
}

0 comments on commit e3a6fb7

Please sign in to comment.