mirror of
https://github.com/jie65535/mirai-console-jhr-plugin.git
synced 2025-06-02 17:39:16 +08:00
增加 删除事件功能
This commit is contained in:
parent
9d7d1b9cff
commit
ad69807e04
@ -332,6 +332,42 @@ object JHorseRacing : KotlinPlugin(
|
|||||||
}
|
}
|
||||||
subject.sendMessage("OK")
|
subject.sendMessage("OK")
|
||||||
}
|
}
|
||||||
|
msg.startsWith("删除好事") -> {
|
||||||
|
val event = msg.removePrefix("删除好事").trim()
|
||||||
|
if (event.isBlank()) {
|
||||||
|
return@subscribeAlways
|
||||||
|
}
|
||||||
|
if (JHRPluginConfig.goodEvents.remove(event)) {
|
||||||
|
logger.info("已删除好事件'$event'")
|
||||||
|
subject.sendMessage("OK")
|
||||||
|
} else {
|
||||||
|
subject.sendMessage("没有这一项")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
msg.startsWith("删除坏事") -> {
|
||||||
|
val event = msg.removePrefix("删除坏事").trim()
|
||||||
|
if (event.isBlank()) {
|
||||||
|
return@subscribeAlways
|
||||||
|
}
|
||||||
|
if (JHRPluginConfig.badEvents.remove(event)) {
|
||||||
|
logger.info("已删除好事件'$event'")
|
||||||
|
subject.sendMessage("OK")
|
||||||
|
} else {
|
||||||
|
subject.sendMessage("没有这一项")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
msg.startsWith("删除胜利词") -> {
|
||||||
|
val event = msg.removePrefix("删除胜利词").trim()
|
||||||
|
if (event.isBlank()) {
|
||||||
|
return@subscribeAlways
|
||||||
|
}
|
||||||
|
if (JHRPluginConfig.winnerMessage.remove(event)) {
|
||||||
|
logger.info("已删除好事件'$event'")
|
||||||
|
subject.sendMessage("OK")
|
||||||
|
} else {
|
||||||
|
subject.sendMessage("没有这一项")
|
||||||
|
}
|
||||||
|
}
|
||||||
msg == "好事列表" -> {
|
msg == "好事列表" -> {
|
||||||
subject.sendMessage(JHRPluginConfig.goodEvents.joinToString("\n"))
|
subject.sendMessage(JHRPluginConfig.goodEvents.joinToString("\n"))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user