update g stock
This commit is contained in:
parent
e917e6e47e
commit
3917f2e96c
2
bot.go
2
bot.go
@ -650,7 +650,7 @@ func botGStock(m *tb.Message) {
|
|||||||
}
|
}
|
||||||
b, _ := json.Marshal(p)
|
b, _ := json.Marshal(p)
|
||||||
t := time.Now().UTC().Add(1 * time.Second)
|
t := time.Now().UTC().Add(1 * time.Second)
|
||||||
_, err := createJob(objSubTypeJobGStock, objJobPriority, int64(m.Chat.ID), 0, t, b)
|
_, err := createJob(objSubTypeJobGStock, objJobPriority, cfg.Bot.Admin, 0, t, b)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c := TGCommand{
|
c := TGCommand{
|
||||||
|
12
job.go
12
job.go
@ -717,7 +717,7 @@ func jobGStock(j Job) {
|
|||||||
case 0: // send /g_stock_res
|
case 0: // send /g_stock_res
|
||||||
p.Progress = 1
|
p.Progress = 1
|
||||||
b, _ := json.Marshal(&p)
|
b, _ := json.Marshal(&p)
|
||||||
err = createJobCallback(objSubTypeJobGStock, cfg.Bot.Admin, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
err = createJobCallback(objSubTypeJobGStock, j.UserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
||||||
logOnError(err, "jobGStock : createJobCallback")
|
logOnError(err, "jobGStock : createJobCallback")
|
||||||
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_res")
|
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_res")
|
||||||
case 1: // send /g_stock_alch
|
case 1: // send /g_stock_alch
|
||||||
@ -731,7 +731,7 @@ func jobGStock(j Job) {
|
|||||||
}
|
}
|
||||||
p.Progress = 2
|
p.Progress = 2
|
||||||
b, _ := json.Marshal(&p)
|
b, _ := json.Marshal(&p)
|
||||||
err = createJobCallback(objSubTypeJobGStock, cfg.Bot.Admin, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
err = createJobCallback(objSubTypeJobGStock, j.UserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
||||||
logOnError(err, "jobGStock : createJobCallback")
|
logOnError(err, "jobGStock : createJobCallback")
|
||||||
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_alch")
|
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_alch")
|
||||||
case 2: // send /g_stock_misc
|
case 2: // send /g_stock_misc
|
||||||
@ -745,7 +745,7 @@ func jobGStock(j Job) {
|
|||||||
}
|
}
|
||||||
p.Progress = 3
|
p.Progress = 3
|
||||||
b, _ := json.Marshal(&p)
|
b, _ := json.Marshal(&p)
|
||||||
err = createJobCallback(objSubTypeJobGStock, cfg.Bot.Admin, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
err = createJobCallback(objSubTypeJobGStock, j.UserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
||||||
logOnError(err, "jobGStock : createJobCallback")
|
logOnError(err, "jobGStock : createJobCallback")
|
||||||
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_misc")
|
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_misc")
|
||||||
case 3: // send /g_stock_rec
|
case 3: // send /g_stock_rec
|
||||||
@ -759,7 +759,7 @@ func jobGStock(j Job) {
|
|||||||
}
|
}
|
||||||
p.Progress = 4
|
p.Progress = 4
|
||||||
b, _ := json.Marshal(&p)
|
b, _ := json.Marshal(&p)
|
||||||
err = createJobCallback(objSubTypeJobGStock, cfg.Bot.Admin, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
err = createJobCallback(objSubTypeJobGStock, j.UserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
||||||
logOnError(err, "jobGStock : createJobCallback")
|
logOnError(err, "jobGStock : createJobCallback")
|
||||||
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_rec")
|
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_rec")
|
||||||
case 4: // send /g_stock_parts
|
case 4: // send /g_stock_parts
|
||||||
@ -773,7 +773,7 @@ func jobGStock(j Job) {
|
|||||||
}
|
}
|
||||||
p.Progress = 5
|
p.Progress = 5
|
||||||
b, _ := json.Marshal(&p)
|
b, _ := json.Marshal(&p)
|
||||||
err = createJobCallback(objSubTypeJobGStock, cfg.Bot.Admin, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
err = createJobCallback(objSubTypeJobGStock, j.UserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
||||||
logOnError(err, "jobGStock : createJobCallback")
|
logOnError(err, "jobGStock : createJobCallback")
|
||||||
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_parts")
|
clientSendCWMsg(cfg.Bot.Admin, "/g_stock_parts")
|
||||||
case 5: // send /g_stock_other
|
case 5: // send /g_stock_other
|
||||||
@ -787,7 +787,7 @@ func jobGStock(j Job) {
|
|||||||
}
|
}
|
||||||
p.Progress = 6
|
p.Progress = 6
|
||||||
b, _ := json.Marshal(&p)
|
b, _ := json.Marshal(&p)
|
||||||
err = createJobCallback(objSubTypeJobGStock, cfg.Bot.Admin, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
err = createJobCallback(objSubTypeJobGStock, j.UserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user