diff --git a/bot.go b/bot.go index d80b7d8..2c6e87d 100644 --- a/bot.go +++ b/bot.go @@ -574,15 +574,26 @@ func botGStock(m *tb.Message) { } b, _ := json.Marshal(p) t := time.Now().UTC().Add(1 * time.Second) - objID64, err := createJob(objSubTypeJobGStock, objJobPriority, int64(m.Chat.ID), t, b) + _, err := createJob(objSubTypeJobGStock, objJobPriority, int64(m.Chat.ID), t, b) - c := TGCommand{ - Type: commandReplyMsg, - Text: "Stock requested", - FromMsgID64: int64(m.ID), - FromChatID64: m.Chat.ID, + if err != nil { + c := TGCommand{ + Type: commandReplyMsg, + Text: fmt.Sprintf("%s", err), + FromMsgID64: int64(m.ID), + FromChatID64: m.Chat.ID, + } + TGCmdQueue <- c + } else { + c := TGCommand{ + Type: commandReplyMsg, + Text: "Stock requested", + FromMsgID64: int64(m.ID), + FromChatID64: m.Chat.ID, + } + TGCmdQueue <- c } - TGCmdQueue <- c + return }