From 3887cfd70a04c7daf76bf12d0194e6d58e3c04dc Mon Sep 17 00:00:00 2001 From: yusufaytas Date: Sun, 4 Jan 2026 20:58:10 +0000 Subject: [PATCH] Updated opsorch-core to 0.0.4 --- .gitignore | 1 + go.mod | 2 +- integ/messaging.go | 6 ++++++ messaging/slack_provider.go | 7 +++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 33c4f76..5135e7f 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ coverage.* *.coverprofile profile.cov +.env.local # Build output bin/ diff --git a/go.mod b/go.mod index 4080d7a..5a0a1cd 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/opsorch/opsorch-slack-adapter go 1.22 require ( - github.com/opsorch/opsorch-core v0.0.4 + github.com/opsorch/opsorch-core v0.4.0 github.com/slack-go/slack v0.12.5 ) diff --git a/integ/messaging.go b/integ/messaging.go index d1e448f..2e9a10b 100644 --- a/integ/messaging.go +++ b/integ/messaging.go @@ -45,6 +45,9 @@ func main() { log.Printf("❌ Failed to send simple message: %v", err) } else { fmt.Printf("✅ Sent simple message. ID: %s, Timestamp: %s\n", res.ID, res.SentAt) + if res.URL != "" { + fmt.Printf(" URL: %s\n", res.URL) + } } // Test 2: Send a rich message with blocks @@ -67,5 +70,8 @@ func main() { log.Printf("❌ Failed to send rich message: %v", err) } else { fmt.Printf("✅ Sent rich message. ID: %s, Timestamp: %s\n", res.ID, res.SentAt) + if res.URL != "" { + fmt.Printf(" URL: %s\n", res.URL) + } } } diff --git a/messaging/slack_provider.go b/messaging/slack_provider.go index 365dc32..69b7dac 100644 --- a/messaging/slack_provider.go +++ b/messaging/slack_provider.go @@ -87,10 +87,17 @@ func (p *SlackProvider) Send(ctx context.Context, msg schema.Message) (schema.Me return schema.MessageResult{}, err } + // Get permalink for the message + permalink, _ := p.client.GetPermalinkContext(ctx, &slack.PermalinkParameters{ + Channel: channelID, + Ts: timestamp, + }) + return schema.MessageResult{ ID: timestamp, Channel: channelID, SentAt: time.Now(), + URL: permalink, }, nil }