Skip to content

Slack/Discord webhook support #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
May 19, 2025
Merged

Slack/Discord webhook support #72

merged 22 commits into from
May 19, 2025

Conversation

ChrisPenner
Copy link
Contributor

@ChrisPenner ChrisPenner commented May 16, 2025

Overview

We know we want Slack/Discord webhook support as a delivery mechanism for notifications. I knew I'd have to build out the translation layer for our own hooks anyways so I figured why not build it directly into Share to make it easier for everyone.

The end result is that you can just paste your Slack/Discord webhook URL in directly and Share will do the right thing and format a nice message for the webhook.

Implementation notes

  • Analyse webhook URLs at delivery time to see if matches a Discord or Slack webhook
  • Use the hydrated webhook payloads to construct and send a nice slack/discord message.

Interesting/controversial decisions

Q: Should we be auto-intercepting these?
A: Yes, if the user were to paste one of these webhook handlers without special handling it would always fail since the default Share webhook payload isn't compatible with these webhook handlers, so we loose nothing by doing this automatically and gain a nice pain-free experience for the end-user. If they want to construct their own webhooks they can still easily do that with a Unison Cloud Service or wherever, which will have a URL that's not intercepted by the slack/discord webhook detector.

Test coverage

None at the moment, this is pretty tough to make tests for; I may re-visit the webhook payload test capturing server at some point, but it was quite unreliable last time I tried.

We'll be dogfooding these in Slack/Discord, so should notice if they drop out 🤞🏼

@ChrisPenner ChrisPenner marked this pull request as ready for review May 19, 2025 20:11
@ChrisPenner ChrisPenner merged commit 557ff5f into main May 19, 2025
4 checks passed
@ChrisPenner ChrisPenner deleted the cp/slack-webhooks branch May 19, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant