Merge pull request #1537 from c9s/c9s/fix-slack-attachment

FIX: [slacknotifier] handle slack.Attachment pointer
This commit is contained in:
c9s 2024-02-21 15:37:26 +08:00 committed by GitHub
commit 9ddd91aea5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,6 +83,13 @@ func filterSlackAttachments(args []interface{}) (slackAttachments []slack.Attach
slackAttachments = append(slackAttachments, a)
case *slack.Attachment:
if firstAttachmentOffset == -1 {
firstAttachmentOffset = idx
}
slackAttachments = append(slackAttachments, *a)
case types.SlackAttachmentCreator:
if firstAttachmentOffset == -1 {
firstAttachmentOffset = idx