changedetection.io icon indicating copy to clipboard operation
changedetection.io copied to clipboard

[feature] Snapshot images in Slack notifications

Open jonfairbanks opened this issue 9 months ago • 6 comments

Version and OS v0.49.4 on Docker

Is your feature request related to a problem? Please describe. I currently have ChangeDetection integrated with Browserless for taking snapshots of websites to detect changes. I also have a notification integration with Slack and have toggled the Attach screenshot to notification option.

Unfortunately, when notifications come into Slack, they do not contain a screenshot. The Slack API does support attachments in messages posted via their API however.

Describe the solution you'd like When a change is detected and Slack is notified, a snapshot is shared in the Slack message body.

Describe the use-case and give concrete real-world examples Notification body:

There's a new update available!

{{watch_url}}

If any additional details or examples are needed, please let me know!

jonfairbanks avatar Mar 15 '25 00:03 jonfairbanks

Hmm where in the API docs does slack say it supports images on the message? https://api.slack.com/methods/chat.postMessage

dgtlmoon avatar Mar 16 '25 12:03 dgtlmoon

it looks like theres two ways

  • slack doesnt support adding an image with a message, BUT you can link to some external image URL
  • slack will let you upload a file, get the file URL, and then link the file (using the file URL) from a slack message

i dont think this is supported in caronc/apprise

dgtlmoon avatar Mar 17 '25 11:03 dgtlmoon

Yea, these would probably have to go as a file.upload with an included comment.

https://api.slack.com/methods/files.upload/code

jonfairbanks avatar Mar 17 '25 18:03 jonfairbanks

Any chance you can add me to your slack? it looks like apprise does actually support it when in self.mode is SlackMode.BOT:

https://github.com/caronc/apprise/blob/efd9d5cd676304a198d3d993ee1face8b7f6d55c/apprise/plugins/slack.py#L644-L680

dgtlmoon avatar Mar 27 '25 07:03 dgtlmoon

@jonfairbanks any chance you could find a way to add me to your slack organisation or some private channel only to test this?

dgtlmoon avatar Mar 31 '25 10:03 dgtlmoon

Can you share your email and I'll get you onboarded?

I also see an open PR on apprise mentioning support for the latest Slack API. Perhaps these changes are needed to support that.

https://github.com/caronc/apprise/pull/1295

jonfairbanks avatar Apr 01 '25 20:04 jonfairbanks