This commit is contained in:
shoopea 2020-01-05 17:44:49 +08:00
parent 7219be55c3
commit 96ef468f74

16
bot.go
View File

@ -940,15 +940,13 @@ func botGWithdraw(m *tb.Message) {
items := []ChatWarsItems{}
for _, l := range rx.FindAllStringSubmatch(m.Payload, -1) {
log.Printf("botGWithdraw : %v\n", l)
/*
i := r.ReplaceAllString(l, "${Item}")
q, _ := strconv.ParseInt(r.ReplaceAllString(l, "${Quantity}"), 10, 64)
item := ChatWarsItems{
Item: i,
Quantity: q,
}
items = append(items, item)
*/
i := r.ReplaceAllString(l[0], "${Item}")
q, _ := strconv.ParseInt(r.ReplaceAllString(l[0], "${Quantity}"), 10, 64)
item := ChatWarsItems{
Item: i,
Quantity: q,
}
items = append(items, item)
}
p.Request = items