MCPcopy Create free account
hub / github.com/bytebase/bytebase / getSlackToken

Function getSlackToken

backend/plugin/webhook/slack/slack.go:23–35  ·  view source on GitHub ↗

getSlackToken extracts the Slack token from the AppIMSetting.

(setting *storepb.AppIMSetting)

Source from the content-addressed store, hash-verified

21
22// getSlackToken extracts the Slack token from the AppIMSetting.
23func 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.
38type BlockMarkdown struct {

Callers 1

postDirectMessageFunction · 0.85

Calls 1

GetSlackMethod · 0.45

Tested by

no test coverage detected