This commit is contained in:
shoopea 2019-07-08 18:31:22 +08:00
parent b8b875748f
commit 2f2441cd9e

7
msg.go
View File

@ -172,7 +172,12 @@ func parseSubTypeMessageGoQuestAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatW
log.Printf("parseSubTypeMessageGoQuestAck : Time : %s\n", r.ReplaceAllString(m.Text, "${Time}"))
*/
cwm.Quest = strings.ToLower(r.ReplaceAllString(m.Text, "${Place}"))
cwm.Duration, _ = strconv.ParseInt(r.ReplaceAllString(m.Text, "${Time}"), 10, 64)
i, err := strconv.ParseInt(r.ReplaceAllString(m.Text, "${Time}"), 10, 64)
if err != nil {
cwm.Duration = i * time.Minute
} else {
cwm.Duration = 0 * time.Minute
}
return &cwm, nil
}