Convert markdown to slack markdown
This commit is contained in:
1
go.mod
1
go.mod
@@ -33,6 +33,7 @@ require (
|
||||
github.com/antchfx/xmlquery v1.3.17 // indirect
|
||||
github.com/antchfx/xpath v1.2.4 // indirect
|
||||
github.com/dlclark/regexp2 v1.10.0 // indirect
|
||||
github.com/eritikass/githubmarkdownconvertergo v0.1.10 // indirect
|
||||
github.com/go-logr/logr v1.3.0 // indirect
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
|
||||
github.com/gobwas/glob v0.2.3 // indirect
|
||||
|
||||
2
go.sum
2
go.sum
@@ -34,6 +34,8 @@ github.com/dslipak/pdf v0.0.2 h1:djAvcM5neg9Ush+zR6QXB+VMJzR6TdnX766HPIg1JmI=
|
||||
github.com/dslipak/pdf v0.0.2/go.mod h1:2L3SnkI9cQwnAS9gfPz2iUoLC0rUZwbucpbKi5R1mUo=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/eritikass/githubmarkdownconvertergo v0.1.10 h1:mL93ADvYMOeT15DcGtK9AaFFc+RcWcy6kQBC6yS/5f4=
|
||||
github.com/eritikass/githubmarkdownconvertergo v0.1.10/go.mod h1:BdpHs6imOtzE5KorbUtKa6bZ0ZBh1yFcrTTAL8FwDKY=
|
||||
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
|
||||
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
|
||||
|
||||
@@ -14,6 +14,8 @@ import (
|
||||
"github.com/slack-go/slack/socketmode"
|
||||
|
||||
"github.com/slack-go/slack"
|
||||
|
||||
"github.com/eritikass/githubmarkdownconvertergo"
|
||||
"github.com/slack-go/slack/slackevents"
|
||||
)
|
||||
|
||||
@@ -117,6 +119,8 @@ func (t *Slack) Start(a *agent.Agent) {
|
||||
agent.WithText(message),
|
||||
)
|
||||
|
||||
res.Response = githubmarkdownconvertergo.Slack(res.Response)
|
||||
|
||||
_, _, err = api.PostMessage(ev.Channel,
|
||||
slack.MsgOptionText(res.Response, false),
|
||||
slack.MsgOptionPostMessageParameters(slack.PostMessageParameters{LinkNames: 1, Markdown: true}),
|
||||
@@ -176,6 +180,8 @@ func (t *Slack) Start(a *agent.Agent) {
|
||||
agent.WithConversationHistory(threadMessages),
|
||||
)
|
||||
|
||||
res.Response = githubmarkdownconvertergo.Slack(res.Response)
|
||||
|
||||
if ts != "" {
|
||||
_, _, err = api.PostMessage(ev.Channel,
|
||||
slack.MsgOptionText(res.Response, false),
|
||||
|
||||
Reference in New Issue
Block a user