fix
This commit is contained in:
parent
e23e0603c0
commit
1d044301ab
11
msg.go
11
msg.go
@ -278,20 +278,21 @@ func parseSubTypeMessageGStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*Cha
|
||||
func parseSubTypeMessageTributesStatsAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageTributesStatsAck, error) {
|
||||
cwm := ChatWarsMessageTributesStatsAck{}
|
||||
cwm.Msg = m
|
||||
cwm.Tributes = make([]ChatWarsTribute{}, 0)
|
||||
|
||||
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}"))
|
||||
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")
|
||||
tribute.Date = d
|
||||
log.Printf("parseSubTypeMessageTributesStatsAck : Date : %s => %v\n", re.ReplaceAllString(l[0], "${Date}"), tribute.Date)
|
||||
tribute.ItemID64 = getSilentObjItemID(``, re.ReplaceAllString(l[0], "${Item}"))
|
||||
log.Printf("parseSubTypeMessageTributesStatsAck : Item : %s => %d\n", re.ReplaceAllString(l[0], "${Item}"), tribute.ItemID64)
|
||||
tribute.Quantity, _ = strconv.ParseInt(r.ReplaceAllString(l[0], "${Quantity}"), 10, 64)
|
||||
log.Printf("parseSubTypeMessageTributesStatsAck : Quantity : %s => %d\n", re.ReplaceAllString(l[0], "${Quantity}"), tribute.Quantity)
|
||||
tribute.Exp, _ = strconv.ParseInt(r.ReplaceAllString(l[0], "${Exp}"), 10, 64)
|
||||
log.Printf("parseSubTypeMessageTributesStatsAck : Exp : %s => %d \n", re.ReplaceAllString(l[0], "${Exp}"), tribute.Exp)
|
||||
cwm.Tributes = append(cwm.Tributes, tribute)
|
||||
log.Printf("parseSubTypeMessageTributesStatsAck : #%d / #%d : %d + %d (%v)\n", cwm.Msg.TGUserID64, tribute.ItemID64, tribute.Quantity, tribute.Exp, tribute.Date)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user