update deposit all

This commit is contained in:
shoopea 2020-01-23 14:09:07 +08:00
parent 16b3a70c96
commit 8abb3bc2d2
2 changed files with 25 additions and 0 deletions

1
bot.go
View File

@ -880,6 +880,7 @@ func botGDepositAll(m *tb.Message) {
}
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`03`, `Pelt`))
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`04`, `Bone`))
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`05`, `Coal`))
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`07`, `Powder`))
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`08`, `Iron Ore`))
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`09`, `Cloth`))

24
job.go
View File

@ -1612,6 +1612,30 @@ func jobGWithdraw(j Job) {
if err == nil {
p.CleanupMsg = append(p.CleanupMsg, *m)
}
for _, req := range p.Items {
if req.Inspect {
p2 = JobPayloadMsgDel{
MsgTypeID64: cacheObjSubType[`msg_g_inspect_req`],
Delay: (10 * time.Second),
ObjMsgID64: 0,
}
b2, _ = json.Marshal(p2)
createJobCallback(cacheObjSubType[`job_msg_del`], j.UserID64, p2.MsgTypeID64, b2, time.Minute)
p.Inspecting = req.Code
b, _ := json.Marshal(p)
id, err := createJob(cacheObjSubType[`job_gwithdraw`], objJobPriority, j.UserID64, 0, time.Unix(maxUnixTimestamp, 0).UTC(), b)
logOnError(err, "jobGWithdraw : createJob")
setJobCallback(id, int64(bot.Me.ID), cacheObjSubType[`msg_invalid_action`])
setJobCallback(id, int64(bot.Me.ID), cacheObjSubType[`msg_inspect_ack`])
clientSendCWMsg(j.UserID64, fmt.Sprintf("/g_inspect_%s", p.Inspecting))
err = setJobDone(j.ID64)
logOnError(err, "jobGWithdraw : setJobDone")
return
}
}
} else if id == cacheObjSubType[`msg_msg_job_gwithdraw_ack`] {
m, err := getObjMsg(j.Trigger)
logOnError(err, "jobGWithdraw : getObjMsg")