All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xyz.cssxsh.mirai.arknights.command.ArknightsItemCommand.kt Maven / Gradle / Ivy

There is a newer version: 2.3.1
Show newest version
package xyz.cssxsh.mirai.arknights.command

import net.mamoe.mirai.console.command.*
import xyz.cssxsh.mirai.arknights.*

object ArknightsItemCommand : SimpleCommand(
    owner = ArknightsHelperPlugin,
    "item", "材料",
    description = "明日方舟助手材料指令"
), ArknightsHelperCommand {

    @Handler
    suspend fun CommandSenderOnMessage<*>.handler(name: String, limit: Int = 5, now: Boolean = true) = sendMessage {
        runCatching {
            item(name, limit, now)
        }.recoverCatching {
            sendMessage("查找失败, 尝试自定义别名, ${it.message}")
            item(ItemAlias.getValue(name), limit, now)
        }.getOrThrow()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy