This commit is contained in:
shoopea 2020-02-03 14:23:13 +08:00
parent 47229f8849
commit e3e136e660

10
msg.go
View File

@ -280,12 +280,10 @@ func parseSubTypeMessageTributesStatsAck(m *ChatWarsMessage, r *regexp.Regexp) (
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) {
/*
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}"))
log.Printf("parseSubTypeMessageTributesStatsAck : Exp : %s\n", re.ReplaceAllString(l[0], "${Exp}"))
*/
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}"))
log.Printf("parseSubTypeMessageTributesStatsAck : Exp : %s\n", re.ReplaceAllString(l[0], "${Exp}"))
d, err := fromChatWarsDate(re.ReplaceAllString(l[0], "${Date}"))
tribute.Date = d
logOnError(err, "parseSubTypeMessageTributesStatsAck : fromChatWarsDate")