fix job g stock

This commit is contained in:
shoopea 2019-12-15 16:30:33 +08:00
parent 7dca664ba6
commit 228d65b704

12
job.go
View File

@ -724,7 +724,7 @@ func jobGStock(j Job) {
setJobCallback(jobID64, j.UserID64, objSubTypeMessageBattle)
err = setJobTimeout(jobID64, 1*time.Minute)
logOnError(err, "jobGStock : setJobTimeout")
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_res")
clientSendCWMsg(j.UserID64, "/g_stock_res")
case 1: // send /g_stock_alch
msg, err := getObjMsg(j.Trigger)
logOnError(err, "jobGStock : getObjMsg msg")
@ -739,7 +739,7 @@ func jobGStock(j Job) {
b, _ := json.Marshal(&p)
err = createJobCallback(objSubTypeJobGStock, j.UserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
logOnError(err, "jobGStock : createJobCallback")
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_alch")
clientSendCWMsg(j.UserID64, "/g_stock_alch")
} else if rule.MsgTypeID == objSubTypeMessageBusy || rule.MsgTypeID == objSubTypeMessageBattle {
m := TGCommand{
Type: commandReplyMsg,
@ -763,7 +763,7 @@ func jobGStock(j Job) {
b, _ := json.Marshal(&p)
err = createJobCallback(objSubTypeJobGStock, j.UserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
logOnError(err, "jobGStock : createJobCallback")
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_misc")
clientSendCWMsg(j.UserID64, "/g_stock_misc")
case 3: // send /g_stock_rec
msg, err := getObjMsg(j.Trigger)
logOnError(err, "jobGStock : getObjMsg msg")
@ -777,7 +777,7 @@ func jobGStock(j Job) {
b, _ := json.Marshal(&p)
err = createJobCallback(objSubTypeJobGStock, j.UserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
logOnError(err, "jobGStock : createJobCallback")
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_rec")
clientSendCWMsg(j.UserID64, "/g_stock_rec")
case 4: // send /g_stock_parts
msg, err := getObjMsg(j.Trigger)
logOnError(err, "jobGStock : getObjMsg msg")
@ -791,7 +791,7 @@ func jobGStock(j Job) {
b, _ := json.Marshal(&p)
err = createJobCallback(objSubTypeJobGStock, j.UserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
logOnError(err, "jobGStock : createJobCallback")
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_parts")
clientSendCWMsg(j.UserID64, "/g_stock_parts")
case 5: // send /g_stock_other
msg, err := getObjMsg(j.Trigger)
logOnError(err, "jobGStock : getObjMsg msg")
@ -805,7 +805,7 @@ func jobGStock(j Job) {
b, _ := json.Marshal(&p)
err = createJobCallback(objSubTypeJobGStock, j.UserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
logOnError(err, "jobGStock : createJobCallback")
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_other")
clientSendCWMsg(j.UserID64, "/g_stock_other")
case 6: // collate everything and reply
msg, err := getObjMsg(j.Trigger)
logOnError(err, "jobGStock : getObjMsg msg")