fix: mcfish (#743)

This commit is contained in:
方柳煜
2023-09-19 20:19:48 +08:00
committed by GitHub
parent cb52bf6af7
commit 99b14e183a
8 changed files with 333 additions and 98 deletions

View File

@@ -411,10 +411,6 @@ func init() {
return
}
chooseList := strings.Split(nextcmd, " ")
if list[0] == list[1] || list[0] == list[2] || list[1] == list[2] {
ctx.SendChain(message.At(ctx.Event.UserID), message.Text("[0]请输入正确的序号\n", list))
continue
}
first, err := strconv.Atoi(chooseList[0])
if err != nil {
ctx.SendChain(message.Text("[ERROR at pole.go.11.1]:", err))
@@ -430,11 +426,15 @@ func init() {
ctx.SendChain(message.Text("[ERROR at pole.go.11.3]:", err))
return
}
list = []int{first, second, third}
if first == second || first == third || second == third {
ctx.SendChain(message.At(ctx.Event.UserID), message.Text("[0]请输入正确的序号\n", list))
continue
}
if first > max || second > max || third > max {
ctx.SendChain(message.At(ctx.Event.UserID), message.Text("[", max, "]请输入正确的序号\n", list))
continue
}
list = []int{first, second, third}
check = true
}
if check {
@@ -478,7 +478,7 @@ func init() {
}
ctx.Send(
message.ReplyWithMessage(ctx.Event.MessageID,
message.Text(thingName, "合成成功\n属性: ", attribute),
message.Text(thingName, "合成成功", list, "\n属性: ", attribute),
),
)
})