diff --git a/data/msg_rules.json b/data/msg_rules.json index 5382ab2..aad40bb 100644 --- a/data/msg_rules.json +++ b/data/msg_rules.json @@ -1890,7 +1890,7 @@ { "prio": 5000, "descn": "Shop main ack", - "rule": "^Welcome, to the (?P[a-zA-Z0-9 -]+) #(?P[0-9]+)\\.\\n(?P.+) (?P[0-9]+)\\/(?P[0-9]+)💧the (?P.+) from (?P.+)\\n(?s:.*)$", + "rule": "^Welcome, to the (?P[a-zA-Z0-9 -]+) #(?P[0-9]+)\\.\\n(?P.+) (?P[0-9]+)\\/(?P[0-9]+)💧the (?P.+) from (?P.+)\\n\\n(?P.*)\\n\\n(the (?P.*) Guru\\n\\n){0,1}.* is (?P(open|closed))\\.\\n(?s:.*)$", "msg_type": "msg_shop_main_ack", "chat_id": 0, "user_id": 0 diff --git a/def.go b/def.go index 3070263..00d0d01 100644 --- a/def.go +++ b/def.go @@ -376,6 +376,9 @@ type ChatWarsMessageShopMainAck struct { ManaTotal string `json:"mana_total"` Class string `json:"class"` Castle string `json:"castle"` + Fees string `json:"fees"` + Guru string `json:"guru"` + Status string `json:"status"` } type MessageParsingRule struct { diff --git a/msg.go b/msg.go index 8b394f1..d9e4407 100644 --- a/msg.go +++ b/msg.go @@ -309,6 +309,9 @@ func parseSubTypeMessageShopMainAck(m *ChatWarsMessage, r *regexp.Regexp) (*Chat cwm.ManaTotal = r.ReplaceAllString(m.Text, "${ManaTotal}") cwm.Class = r.ReplaceAllString(m.Text, "${Class}") cwm.Castle = r.ReplaceAllString(m.Text, "${Castle}") + cwm.Fees = r.ReplaceAllString(m.Text, "${Fees}") + cwm.Guru = r.ReplaceAllString(m.Text, "${Guru}") + cwm.Status = r.ReplaceAllString(m.Text, "${Status}") log.Printf("parseSubTypeMessageShopMainAck : Name : %s\n", cwm.Name) log.Printf("parseSubTypeMessageShopMainAck : Number : %s\n", cwm.Number) @@ -317,6 +320,9 @@ func parseSubTypeMessageShopMainAck(m *ChatWarsMessage, r *regexp.Regexp) (*Chat log.Printf("parseSubTypeMessageShopMainAck : ManaTotal : %s\n", cwm.ManaTotal) log.Printf("parseSubTypeMessageShopMainAck : Class : %s\n", cwm.Class) log.Printf("parseSubTypeMessageShopMainAck : Castle : %s\n", cwm.Castle) + log.Printf("parseSubTypeMessageShopMainAck : Fees : %s\n", cwm.Fees) + log.Printf("parseSubTypeMessageShopMainAck : Guru : %s\n", cwm.Guru) + log.Printf("parseSubTypeMessageShopMainAck : Status : %s\n", cwm.Status) return &cwm, nil }