all repos — telegram-bot-api @ d8ba9c84c817ae4f7eccb12c98fc764cf8c966f8

Golang bindings for the Telegram Bot API

Refactoring
Gleb Sinyavsky zhulik.gleb@gmail.com
Fri, 20 Nov 2015 15:01:05 +0300
commit

d8ba9c84c817ae4f7eccb12c98fc764cf8c966f8

parent

92ce2aad9403b2ee7918c92f4ed17db403ba9552

1 files changed, 3 insertions(+), 20 deletions(-)

jump to
M bot.gobot.go

@@ -89,6 +89,9 @@ }

var message Message json.Unmarshal(resp.Result, &message) + + bot.DebugLog(endpoint, params, message) + return message, nil }

@@ -189,7 +192,6 @@ func (bot *BotAPI) Send(c Chattable) error {

return nil } - func (bot *BotAPI) DebugLog(context string, v url.Values, message interface{}) { if bot.Debug { log.Printf("%s req : %+v\n", context, v)

@@ -213,8 +215,6 @@

if err != nil { return Message{}, err } - - bot.DebugLog("SendMessage", v, message) return message, nil }

@@ -230,8 +230,6 @@ if err != nil {

return Message{}, err } - bot.DebugLog("ForwardMessage", v, message) - return message, nil }

@@ -252,8 +250,6 @@ message, err := bot.MakeMessageRequest("SendPhoto", v)

if err != nil { return Message{}, err } - - bot.DebugLog("SendPhoto", v, message) return message, nil }

@@ -324,9 +320,6 @@ if err != nil {

return Message{}, err } - - bot.DebugLog("SendAudio", v, message) - return message, nil }

@@ -396,8 +389,6 @@ message, err := bot.MakeMessageRequest("sendDocument", v)

if err != nil { return Message{}, err } - - bot.DebugLog("SendDocument", v, message) return message, nil }

@@ -462,8 +453,6 @@ if err != nil {

return Message{}, err } - bot.DebugLog("SendVoice", v, message) - return message, nil }

@@ -528,8 +517,6 @@ if err != nil {

return Message{}, err } - bot.DebugLog("SendSticker", v, message) - return message, nil }

@@ -590,8 +577,6 @@ message, err := bot.MakeMessageRequest("sendVideo", v)

if err != nil { return Message{}, err } - - bot.DebugLog("SendVideo", v, message) return message, nil }

@@ -651,8 +636,6 @@ message, err := bot.MakeMessageRequest("sendLocation", v)

if err != nil { return Message{}, err } - - bot.DebugLog("SendLocation", v, message) return message, nil }