mirror of https://github.com/velour/catbase.git
git: don't unfurl links
This commit is contained in:
parent
bca96b6dcd
commit
c4605cfb77
|
@ -37,6 +37,8 @@ const (
|
||||||
|
|
||||||
type EphemeralID string
|
type EphemeralID string
|
||||||
|
|
||||||
|
type UnfurlLinks bool
|
||||||
|
|
||||||
type ImageAttachment struct {
|
type ImageAttachment struct {
|
||||||
URL string
|
URL string
|
||||||
AltTxt string
|
AltTxt string
|
||||||
|
|
|
@ -281,6 +281,12 @@ func (s *SlackApp) sendMessage(channel, message string, meMessage bool, args ...
|
||||||
ImageURL: a.URL,
|
ImageURL: a.URL,
|
||||||
Text: a.AltTxt,
|
Text: a.AltTxt,
|
||||||
})
|
})
|
||||||
|
case bot.UnfurlLinks:
|
||||||
|
if a {
|
||||||
|
options = append(options, slack.MsgOptionEnableLinkUnfurl())
|
||||||
|
} else {
|
||||||
|
options = append(options, slack.MsgOptionDisableLinkUnfurl())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,6 @@ func (p *GitPlugin) giteaEvent(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
chs := p.c.GetArray(fmt.Sprintf("gitea.%s.%s.channels", org, repo), []string{})
|
chs := p.c.GetArray(fmt.Sprintf("gitea.%s.%s.channels", org, repo), []string{})
|
||||||
for _, ch := range chs {
|
for _, ch := range chs {
|
||||||
p.b.Send(p.b.DefaultConnector(), bot.Message, ch, msg)
|
p.b.Send(p.b.DefaultConnector(), bot.Message, ch, msg, bot.UnfurlLinks(false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,6 +145,6 @@ func (p *GitPlugin) githubEvent(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
chs := p.c.GetArray(fmt.Sprintf("github.%s.%s.channels", owner, repo), []string{})
|
chs := p.c.GetArray(fmt.Sprintf("github.%s.%s.channels", owner, repo), []string{})
|
||||||
for _, ch := range chs {
|
for _, ch := range chs {
|
||||||
p.b.Send(p.b.DefaultConnector(), bot.Message, ch, msg)
|
p.b.Send(p.b.DefaultConnector(), bot.Message, ch, msg, bot.UnfurlLinks(false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,6 @@ func (p *GitPlugin) gitlabEvent(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
chs := p.c.GetArray(fmt.Sprintf("gitlab.%s.channels", owner), []string{})
|
chs := p.c.GetArray(fmt.Sprintf("gitlab.%s.channels", owner), []string{})
|
||||||
for _, ch := range chs {
|
for _, ch := range chs {
|
||||||
p.b.Send(p.b.DefaultConnector(), bot.Message, ch, msg)
|
p.b.Send(p.b.DefaultConnector(), bot.Message, ch, msg, bot.UnfurlLinks(false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue