From b339fb0238529bf178afb67f0f32c44badce9ed9 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 17 Feb 2019 17:39:15 +0800 Subject: [PATCH] fix: hide token in CI/CD log (#70) fix https://github.com/appleboy/drone-telegram/issues/65 --- plugin.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin.go b/plugin.go index a36272e..23300d6 100644 --- a/plugin.go +++ b/plugin.go @@ -375,7 +375,11 @@ func (p Plugin) Send(bot *tgbotapi.BotAPI, msg tgbotapi.Chattable) error { log.Println("=====================") } - return err + if err == nil { + return nil + } + + return errors.New(strings.Replace(err.Error(), p.Config.Token, "", -1)) } // Message is plugin default message.