slacknotifier: handle slack.Attachment pointer

This commit is contained in:
c9s 2024-02-21 15:24:45 +08:00
parent 35b15c35e6
commit ac181959e5
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

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