update g stock

This commit is contained in:
shoopea 2019-12-13 19:55:46 +08:00
parent 8fa62df8e9
commit e8c284b686

8
job.go
View File

@ -791,6 +791,14 @@ func jobGStock(j Job) {
logOnError(err, "jobGStock : createJobCallback") logOnError(err, "jobGStock : createJobCallback")
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_other") clientSendCWMsg(cfg.Bot.Admin, "/g_stock_other")
case 6: // collate everything and reply case 6: // collate everything and reply
msg, err := getObjMsg(j.Trigger)
logOnError(err, "jobGStock : getObjMsg msg")
rule, err := getMsgParsingRule(msg)
logOnError(err, "jobGStock : getMsgParsingRule")
cwm, err := parseSubTypeMessageGStockAnyAck(msg, rule.re)
for _, v := range cwm.Stock {
p.Stock = append(p.Stock, v)
}
for _, v := range p.Stock { for _, v := range p.Stock {
item, err := getObjItem(v.ItemID64) item, err := getObjItem(v.ItemID64)
logOnError(err, "jobGStock : getObjItem") logOnError(err, "jobGStock : getObjItem")