From c9e202cccea92bd24672c8d0cb08d4854244ec8d Mon Sep 17 00:00:00 2001 From: shoopea Date: Sun, 28 Jun 2020 11:34:35 +0200 Subject: [PATCH] update quality --- msg.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/msg.go b/msg.go index 82c2968..02dfdb1 100644 --- a/msg.go +++ b/msg.go @@ -365,6 +365,7 @@ func parseSubTypeMessageGStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*Cha } } re = regexp.MustCompile(`\n(u[0-9]+)([ᵃᵇᶜᵈᵉ]{0,1}) (.*)`) + rq = regexp.MustCompile(`[u][0-9]+(?P[ᵃᵇᶜᵈᵉ]+)`) for _, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Stock}"), -1) { i := getObjItemID(``, l[3]) if i != 0 { @@ -374,6 +375,10 @@ func parseSubTypeMessageGStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*Cha ItemID64: i, Quantity: 1, } + if rq.MatchString(l[1]) { + item.Quality = rq.ReplaceAllString(l[1], "${Quality}") + } + log.Printf("Item : %s - %s : %s\n", item.Code, item.Name, item.Quality) stock = append(stock, item) } }