更新依赖版本

修复错误的注解
增加随机押马 `马? 100`
This commit is contained in:
2022-04-05 19:49:36 +08:00
parent 48a79c8629
commit 1b03074c6c
3 changed files with 9 additions and 5 deletions

View File

@ -3,7 +3,7 @@ plugins {
kotlin("jvm") version kotlinVersion kotlin("jvm") version kotlinVersion
kotlin("plugin.serialization") version kotlinVersion kotlin("plugin.serialization") version kotlinVersion
id("net.mamoe.mirai-console") version "2.9.2" id("net.mamoe.mirai-console") version "2.10.1"
} }
group = "top.jie65535" group = "top.jie65535"

View File

@ -9,7 +9,7 @@ object JHRCommand : CompositeCommand(
description = "HorseRacing Commands" description = "HorseRacing Commands"
) { ) {
@SubCommand @SubCommand
@Deprecated("开启赛马") @Description("开启赛马")
suspend fun CommandSender.enable(group: Long) { suspend fun CommandSender.enable(group: Long) {
if (JHRPluginConfig.enabledGroups.indexOf(group) == -1) if (JHRPluginConfig.enabledGroups.indexOf(group) == -1)
JHRPluginConfig.enabledGroups.add(group) JHRPluginConfig.enabledGroups.add(group)
@ -17,13 +17,13 @@ object JHRCommand : CompositeCommand(
} }
@SubCommand @SubCommand
@Deprecated("开启赛马") @Description("开启赛马")
suspend fun CommandSender.disable(group: Long) { suspend fun CommandSender.disable(group: Long) {
JHRPluginConfig.enabledGroups.remove(group) JHRPluginConfig.enabledGroups.remove(group)
sendMessage("OK") sendMessage("OK")
} }
@SubCommand @SubCommand
@Deprecated("重载配置") @Description("重载配置")
suspend fun CommandSender.reload() { suspend fun CommandSender.reload() {
JHorseRacing.reloadPluginConfig(JHRPluginConfig) JHorseRacing.reloadPluginConfig(JHRPluginConfig)
sendMessage("OK") sendMessage("OK")

View File

@ -328,7 +328,11 @@ object JHorseRacing : KotlinPlugin(
if (p.size != 2) { if (p.size != 2) {
return@subscribeAlways return@subscribeAlways
} }
val no = p[0].toIntOrNull() val no = if (p[0] == "?" || p[0] == "") {
Random.nextInt(horseCount) + 1
} else {
p[0].toIntOrNull()
}
if (no == null || no < 1 || no > horseCount) { if (no == null || no < 1 || no > horseCount) {
subject.sendMessage("没有这个编号的选手") subject.sendMessage("没有这个编号的选手")
return@subscribeAlways return@subscribeAlways