This commit is contained in:
shoopea 2020-02-09 16:17:41 +08:00
parent 898901b9d1
commit 0ca972c6cf

6
msg.go
View File

@ -178,11 +178,11 @@ func parseSubTypeMessageReportAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa
log.Printf("parseSubTypeMessageReport : Extra : %s\n", r.ReplaceAllString(m.Text, "${Extra}"))
re := regexp.MustCompile(`((?P<Cry>Your battle cries were successful)|(You were outplayed by (?P<Outplayer>.*))|(?P<Stamina>🔋Stamina restored)|.+)`)
for i, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Extra}"), -1) {
if re.ReplaceAllString(l[0], "${Cry}") != nil {
if len(re.ReplaceAllString(l[0], "${Cry}")) != 0 {
log.Printf("parseSubTypeMessageReport : Extra[%d] : Cry\n", i)
} else if re.ReplaceAllString(l[0], "${Outplayer}") != nil {
} else if len(re.ReplaceAllString(l[0], "${Outplayer}")) != 0 {
log.Printf("parseSubTypeMessageReport : Extra[%d] : Outplayer\n", i)
} else if re.ReplaceAllString(l[0], "${Stamina}") != nil {
} else if len(re.ReplaceAllString(l[0], "${Stamina}")) != 0 {
log.Printf("parseSubTypeMessageReport : Extra[%d] : Stamina\n", i)
} else {
log.Printf("parseSubTypeMessageReport : Extra[%d] : %s\n", i, l[0])