This commit is contained in:
shoopea 2020-02-03 12:18:51 +08:00
parent c44d6749cb
commit 690295e044

1
msg.go
View File

@ -278,6 +278,7 @@ func parseSubTypeMessageGStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*Cha
func parseSubTypeMessageTributesStatsAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageTributesStatsAck, error) {
cwm := ChatWarsMessageTributesStatsAck{}
tribute := ChatWarsTribute{}
log.Printf("parseSubTypeMessageTributesStatsAck : tributes :\n%s\n", r.ReplaceAllString(m.Text, "${Tributes}"))
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) {
log.Printf("parseSubTypeMessageTributesStatsAck : Date : %s\n", re.ReplaceAllString(l[0], "${Date}"))