This commit is contained in:
shoopea 2019-05-18 15:46:34 +08:00
parent bade7a4f78
commit 3db1933f38
2 changed files with 17 additions and 14 deletions

4
bot.go
View File

@ -3,10 +3,12 @@ package main
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
tb "gopkg.in/tucnak/telebot.v2"
"log" "log"
"regexp" "regexp"
"strconv"
"time" "time"
tb "gopkg.in/tucnak/telebot.v2"
) )
func BotHandlers(b *tb.Bot) { func BotHandlers(b *tb.Bot) {

27
msg.go
View File

@ -2,6 +2,7 @@ package main
import ( import (
"fmt" "fmt"
"log"
"regexp" "regexp"
"strconv" "strconv"
"time" "time"
@ -9,19 +10,19 @@ import (
func parseSubTypeMessageReport(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageReport, error) { func parseSubTypeMessageReport(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageReport, error) {
cwm := ChatWarsMessageReport{} cwm := ChatWarsMessageReport{}
log.Printf("SQLIdentifyMsgWorker[" + strconv.Itoa(id) + "] : War report identified\n") log.Printf("parseSubTypeMessageReport : War report identified\n")
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Castle : %s\n", r.ReplaceAllString(m.Text, "${Castle}")) log.Printf("parseSubTypeMessageReport : Castle : %s\n", r.ReplaceAllString(m.Text, "${Castle}"))
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Guild : %s\n", r.ReplaceAllString(m.Text, "${Guild}")) log.Printf("parseSubTypeMessageReport : Guild : %s\n", r.ReplaceAllString(m.Text, "${Guild}"))
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : User : %s\n", r.ReplaceAllString(m.Text, "${User}")) log.Printf("parseSubTypeMessageReport : User : %s\n", r.ReplaceAllString(m.Text, "${User}"))
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Attack : %s\n", r.ReplaceAllString(m.Text, "${Attack}")) log.Printf("parseSubTypeMessageReport : Attack : %s\n", r.ReplaceAllString(m.Text, "${Attack}"))
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : AttackMod : %s\n", r.ReplaceAllString(m.Text, "${AttackMod}")) log.Printf("parseSubTypeMessageReport : AttackMod : %s\n", r.ReplaceAllString(m.Text, "${AttackMod}"))
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Defense : %s\n", r.ReplaceAllString(m.Text, "${Defense}")) log.Printf("parseSubTypeMessageReport : Defense : %s\n", r.ReplaceAllString(m.Text, "${Defense}"))
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Level : %s\n", r.ReplaceAllString(m.Text, "${Level}")) log.Printf("parseSubTypeMessageReport : Level : %s\n", r.ReplaceAllString(m.Text, "${Level}"))
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Exp : %s\n", r.ReplaceAllString(m.Text, "${Exp}")) log.Printf("parseSubTypeMessageReport : Exp : %s\n", r.ReplaceAllString(m.Text, "${Exp}"))
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Gold : %s\n", r.ReplaceAllString(m.Text, "${Gold}")) log.Printf("parseSubTypeMessageReport : Gold : %s\n", r.ReplaceAllString(m.Text, "${Gold}"))
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Stock : %s\n", r.ReplaceAllString(m.Text, "${Stock}")) log.Printf("parseSubTypeMessageReport : Stock : %s\n", r.ReplaceAllString(m.Text, "${Stock}"))
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Stamina : %s\n", r.ReplaceAllString(m.Text, "${Stamina}")) log.Printf("parseSubTypeMessageReport : Stamina : %s\n", r.ReplaceAllString(m.Text, "${Stamina}"))
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Crit : %s\n", r.ReplaceAllString(m.Text, "${Crit}")) log.Printf("parseSubTypeMessageReport : Crit : %s\n", r.ReplaceAllString(m.Text, "${Crit}"))
return &cwm, err return &cwm, err
} }