From 1cb80243d86e4f6b6221b1944ce81cf134281054 Mon Sep 17 00:00:00 2001 From: shoopea Date: Wed, 9 Oct 2019 10:12:19 +0800 Subject: [PATCH] update g_withdraw --- bot.go | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/bot.go b/bot.go index a65e5ab..a840b7b 100644 --- a/bot.go +++ b/bot.go @@ -735,29 +735,26 @@ func botGWithdraw(m *tb.Message) { b, _ := json.Marshal(p) t := time.Now().UTC() _, err := createJob(objSubTypeJobGWithdraw, objJobPriority, int64(m.Chat.ID), 0, t, b) - - } - if false { - c := TGCommand{ - Type: commandReplyMsg, - //Text: fmt.Sprintf("%s", err), - Text: "error", - 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 } - TGCmdQueue <- c + } else { c := TGCommand{ Type: commandReplyMsg, - Text: "Withdrawal started", + Text: "Wrong format", FromMsgID64: int64(m.ID), FromChatID64: m.Chat.ID, } TGCmdQueue <- c } - //log.Printf("botGDepositAll : json : %s\n", string(b)) - return }