diff --git a/util/slack.go b/util/slack.go index 497d628..c43af80 100644 --- a/util/slack.go +++ b/util/slack.go @@ -4,6 +4,7 @@ import ( "strings" "github.com/lbryio/lbry.go/errors" + "github.com/nlopes/slack" log "github.com/sirupsen/logrus" ) @@ -18,26 +19,6 @@ func InitSlack(token string, channel string, username string) { defaultChannel = channel defaultUsername = username } -func SendToSlackInfo(format string, a ...interface{}) { - message := format - if len(a) > 0 { - message = fmt.Sprintf(format, a...) - } - if slackApi != nil { - sendToSlack(":information_source: " + message) - } - log.Debugln(message) -} -func SendToSlackError(format string, a ...interface{}) { - message := format - if len(a) > 0 { - message = fmt.Sprintf(format, a...) - } - if slackApi != nil { - sendToSlack(":sos: " + message) - } - log.Errorln(message) -} // SendToSlackUser Sends message to a specific user. func SendToSlackUser(user, username, message string) error { @@ -67,6 +48,7 @@ func SendToSlack(message string) error { func sendToSlack(channel, username, message string) error { var err error + if slackApi == nil { err = errors.Err("no slack token provided") } else {