This commit is contained in:
shoopea 2020-02-03 14:26:16 +08:00
parent ddfc1faf00
commit 6178e92c51

2
msg.go
View File

@ -277,9 +277,9 @@ func parseSubTypeMessageGStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*Cha
func parseSubTypeMessageTributesStatsAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageTributesStatsAck, error) {
cwm := ChatWarsMessageTributesStatsAck{}
tribute := ChatWarsTribute{}
re := regexp.MustCompile(`(\n(?P<Date>[1-9]{2} [a-zA-Z]+ [0-9]{4} [0-9]{2}:[0-9]{2}) - (?P<Item>[a-zA-Z]+) x (?P<Quantity>[0-9]+), (?P<Exp>[0-9]+)🔥)`)
for _, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Tributes}"), -1) {
tribute := ChatWarsTribute{}
log.Printf("parseSubTypeMessageTributesStatsAck : Date : %s\n", re.ReplaceAllString(l[0], "${Date}"))
log.Printf("parseSubTypeMessageTributesStatsAck : Item : %s\n", re.ReplaceAllString(l[0], "${Item}"))
log.Printf("parseSubTypeMessageTributesStatsAck : Quantity : %s\n", re.ReplaceAllString(l[0], "${Quantity}"))