Add a log message to Slack topic extraction

This commit is contained in:
Duco van Amstel
2018-11-26 08:59:49 +00:00
committed by GitHub
parent 497deff0b0
commit b28c22ce46

View File

@@ -271,7 +271,7 @@ var (
func extractTopicOrPurpose(text string) (string, string) {
r := topicOrPurposeRE.FindStringSubmatch(text)
if len(r) >= 5 {
if len(r) == 5 {
action, updateType, extracted := r[2], r[3], r[4]
switch action {
case "set":
@@ -280,7 +280,8 @@ func extractTopicOrPurpose(text string) (string, string) {
return updateType, ""
}
}
return "unknown", ""
b.Log.Warnf("Encountered channel topic or purpose change message with unexpected format: %s", text)
return "unknown, ""
}
// @see https://api.slack.com/docs/message-formatting#linking_to_channels_and_users