Skip to content

Commit

Permalink
add: LGZBotCommand: update command
Browse files Browse the repository at this point in the history
  • Loading branch information
guimc233 committed Jan 27, 2024
1 parent 8bf6a56 commit b54b91f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/kotlin/ltd/guimc/lgzbot/command/LGZBotCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ import ltd.guimc.lgzbot.listener.message.MessageFilter
import ltd.guimc.lgzbot.utils.OverflowUtils
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.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 top.mrxiaom.overflow.contact.Updatable
import kotlin.math.roundToInt
import kotlin.time.Duration

Expand Down Expand Up @@ -98,4 +100,16 @@ object LGZBotCommand: CompositeCommand (
messageChain.add(", on=${OverflowUtils.getOnebotServiceProviderName()}, ov=${OverflowUtils.getOnebotServiceProviderVersion()}, oc=${OverflowUtils.getOnebotConnection()}")
sendMessage(messageChain.build())
}

@SubCommand("update")
@Description("清理本群群成员缓存")
suspend fun CommandSender.iI1Ii1I1i1I1i1I1() {
if (!OverflowUtils.checkOverflowCore()) {
sendMessage("该指令仅Overflow adaption可用")
return
}
requireNotNull(getGroupOrNull())
(getGroupOrNull()!! as Updatable).queryUpdate()
sendMessage("ok.")
}
}

0 comments on commit b54b91f

Please sign in to comment.