This commit is contained in:
shoopea 2019-06-02 21:27:53 +08:00
parent 6848fef023
commit d568ab7078
2 changed files with 2 additions and 5 deletions

5
msg.go
View File

@ -35,10 +35,7 @@ func parseSubTypeMessageGStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*Cha
items := []ChatWarsItems{} items := []ChatWarsItems{}
re := regexp.MustCompile(`\n([0-9a-z]+) (.*) x ([0-9]+)`) re := regexp.MustCompile(`\n([0-9a-z]+) (.*) x ([0-9]+)`)
for _, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Stock}"), -1) { for _, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Stock}"), -1) {
i := getObjItemID(l[1]) i := getObjItemID(l[1], l[2])
if i == 0 {
getObjItemID(l[2])
}
q, _ := strconv.ParseInt(l[3], 10, 64) q, _ := strconv.ParseInt(l[3], 10, 64)
if i != 0 { if i != 0 {
item := ChatWarsItems{ item := ChatWarsItems{

2
obj.go
View File

@ -497,7 +497,7 @@ func getObjItemID(c string, n string) int64 {
} else { } else {
w := TGCommand{ w := TGCommand{
Type: commandSendMsg, Type: commandSendMsg,
Text: fmt.Sprintf("Object unknown : %s\n", s), Text: fmt.Sprintf("Object unknown : %s - %s\n", c, n),
ToUserID64: cfg.Bot.Admin, ToUserID64: cfg.Bot.Admin,
} }
TGCmdQueue <- w TGCmdQueue <- w