This commit is contained in:
shoopea 2020-10-18 11:53:44 +02:00
parent 39f8c082b2
commit bf4344e412

4
msg.go
View File

@ -477,13 +477,13 @@ func parseSubTypeMessageGListAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWar
re := regexp.MustCompile(`\n#(?P<Id>[0-9]+) (?P<Class1>(⚒|⚗️|📦|🏹|⚔️|🛡))(?P<Class2>(⚒|⚗️|📦|🏹|⚔️|🛡){0,1})(?P<Level>[0-9]+) \[(?P<Status>.*)\] (?P<Name>[a-zA-z0-9 ]+)`)
for _, l := range re.FindAllString(r.ReplaceAllString(m.Text, "${Members}"), -1) {
log.Printf("parseSubTypeMessageGListAck : %s\n", l)
//log.Printf("parseSubTypeMessageGListAck : %s\n", l)
m := ChatWarsGuildMember{}
m.Name = re.ReplaceAllString(l, "${Name}")
m.Class1 = re.ReplaceAllString(l, "${Class1}")
m.Class2 = re.ReplaceAllString(l, "${Class2}")
m.Status = re.ReplaceAllString(l, "${Status}")
i, _ := strconv.ParseInt(r.ReplaceAllString(l, "${Level}"), 10, 64)
i, _ := strconv.ParseInt(re.ReplaceAllString(l, "${Level}"), 10, 64)
m.Level = int(i)
log.Printf("parseSubTypeMessageGListAck : %s : %s/%s [%d] => %s\n", m.Name, m.Class1, m.Class2, m.Level, m.Status)
cwm.Members = append(cwm.Members, m)