From 96ef468f747167415dca543f0702aa3716b8f6e2 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sun, 5 Jan 2020 17:44:49 +0800 Subject: [PATCH] test --- bot.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/bot.go b/bot.go index be012c2..1b90246 100644 --- a/bot.go +++ b/bot.go @@ -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