getSlackToken extracts the Slack token from the AppIMSetting.
(setting *storepb.AppIMSetting)
| 21 | |
| 22 | // getSlackToken extracts the Slack token from the AppIMSetting. |
| 23 | func getSlackToken(setting *storepb.AppIMSetting) string { |
| 24 | if setting == nil { |
| 25 | return "" |
| 26 | } |
| 27 | for _, s := range setting.Settings { |
| 28 | if s.Type == storepb.WebhookType_SLACK { |
| 29 | if slack := s.GetSlack(); slack != nil { |
| 30 | return slack.Token |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | return "" |
| 35 | } |
| 36 | |
| 37 | // BlockMarkdown is the API message for Slack webhook block markdown. |
| 38 | type BlockMarkdown struct { |
no test coverage detected