diff --git a/bot.go b/bot.go index da0ec67..6923a08 100644 --- a/bot.go +++ b/bot.go @@ -711,7 +711,7 @@ func botVaultOther(m *tb.Message) { botVault(m, l) } -func botVault(m *tb.Message, l []int64) { +func botVault(m *tb.Message, itemTypeList []int64) { /* b, _ := json.Marshal(m) log.Printf("botVault (msg) :\n%s\n", string(b)) @@ -725,13 +725,30 @@ func botVault(m *tb.Message, l []int64) { return } - c := TGCommand{ - Type: commandReplyMsg, - Text: "Not coded yet.", - FromMsgID64: int64(m.ID), - FromChatID64: m.Chat.ID, + p := JobPayloadVaultStatus{ + MsgID64: int64(m.ID), + ChatID64: m.Chat.ID, + UserListID64: nil, + ItemTypeListID64: nil, + DepositChatID64: cfg.Bot.Depositchat, } - TGCmdQueue <- c + p.UserListID64 = append(p.UserListID64, int46(m.Sender.ID)) + p.ItemTypeListID64 = append(p.ItemTypeListID64, itemTypeList) + + b, _ := json.Marshal(p) + t := time.Now().UTC() + _, err := createJob(objSubTypeJobVaultStatus, objJobPriority, int64(m.User.ID), 0, t, b) + + if err != nil { + c := TGCommand{ + Type: commandReplyMsg, + Text: fmt.Sprintf("%s", err), + FromMsgID64: int64(m.ID), + FromChatID64: m.Chat.ID, + } + TGCmdQueue <- c + } + return } func botGDepositAll(m *tb.Message) {