test vault deposit

This commit is contained in:
shoopea 2019-10-11 13:42:33 +08:00
parent dfab9bb46c
commit 6a017befdc

21
bot.go
View File

@ -711,7 +711,7 @@ func botVaultOther(m *tb.Message) {
botVault(m, l) botVault(m, l)
} }
func botVault(m *tb.Message, l []int64) { func botVault(m *tb.Message, itemTypeList []int64) {
/* /*
b, _ := json.Marshal(m) b, _ := json.Marshal(m)
log.Printf("botVault (msg) :\n%s\n", string(b)) log.Printf("botVault (msg) :\n%s\n", string(b))
@ -725,13 +725,30 @@ func botVault(m *tb.Message, l []int64) {
return return
} }
p := JobPayloadVaultStatus{
MsgID64: int64(m.ID),
ChatID64: m.Chat.ID,
UserListID64: nil,
ItemTypeListID64: nil,
DepositChatID64: cfg.Bot.Depositchat,
}
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{ c := TGCommand{
Type: commandReplyMsg, Type: commandReplyMsg,
Text: "Not coded yet.", Text: fmt.Sprintf("%s", err),
FromMsgID64: int64(m.ID), FromMsgID64: int64(m.ID),
FromChatID64: m.Chat.ID, FromChatID64: m.Chat.ID,
} }
TGCmdQueue <- c TGCmdQueue <- c
}
return
} }
func botGDepositAll(m *tb.Message) { func botGDepositAll(m *tb.Message) {