little work on vault limit
This commit is contained in:
parent
2645f8d092
commit
0b6bba71bd
5
def.go
5
def.go
@ -40,6 +40,11 @@ type Config struct {
|
|||||||
Mainchat int64 `json:"main_chat_id"`
|
Mainchat int64 `json:"main_chat_id"`
|
||||||
Depositchat int64 `json:"deposit_chat_id"`
|
Depositchat int64 `json:"deposit_chat_id"`
|
||||||
Reportchat int64 `json:"report_chat_id"`
|
Reportchat int64 `json:"report_chat_id"`
|
||||||
|
VaultLimit []struct {
|
||||||
|
Item string `json:"item"`
|
||||||
|
Min int64 `json:"min_qty"`
|
||||||
|
Max int64 `json:"max_qty"`
|
||||||
|
} `json:"vault_limit"`
|
||||||
} `json:"bot"`
|
} `json:"bot"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
job.go
9
job.go
@ -2142,8 +2142,13 @@ func jobCheckVaultLimit(j Job) {
|
|||||||
if p.Status == 0 {
|
if p.Status == 0 {
|
||||||
p2.JobCallbackID64 = j.ID64
|
p2.JobCallbackID64 = j.ID64
|
||||||
p2.ItemTypeList = make([]int64, 0)
|
p2.ItemTypeList = make([]int64, 0)
|
||||||
p2.ItemTypeList = append(p2.ItemTypeList, cacheObjSubType[`item_res`])
|
|
||||||
p2.ItemTypeList = append(p2.ItemTypeList, cacheObjSubType[`item_alch`])
|
for _, c := range cfg.Bot.VaultLimit {
|
||||||
|
o, err := getObjItem(getSilentObjItemID(c.Item, ``))
|
||||||
|
logOnError(err, "jobCheckVaultLimit : getObjItem")
|
||||||
|
p2.ItemTypeList = append(p2.ItemTypeList, o.ItemTypeID)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
b, err = json.Marshal(p2)
|
b, err = json.Marshal(p2)
|
||||||
logOnError(err, "jobCheckVaultLimit : Marshal(p2)")
|
logOnError(err, "jobCheckVaultLimit : Marshal(p2)")
|
||||||
|
Loading…
Reference in New Issue
Block a user