This commit is contained in:
shoopea 2020-01-27 12:41:58 +08:00
parent cc68ddb0d0
commit ac9a38ef81

9
bot.go
View File

@ -727,8 +727,13 @@ func botCraftItem(m *ChatWarsMessage, r *regexp.Regexp) {
}
p.ObjItemID64, err = getCraftItemID(r.ReplaceAllString(m.Text, "${Cmd}"))
logOnError(err, "botCraftItem : getCraftItemID")
p.Quantity, err = strconv.ParseInt(r.ReplaceAllString(m.Text, "${Quantity}"), 10, 64)
logOnError(err, "botCraftItem : ParseInt")
if r.ReplaceAllString(m.Text, "${Quantity}") != nil {
p.Quantity, err = strconv.ParseInt(r.ReplaceAllString(m.Text, "${Quantity}"), 10, 64)
logOnError(err, "botCraftItem : ParseInt")
} else {
p.Quantity = 1
}
if err != nil {
c := TGCommand{