laravel / slack-notification-channel

Slack Notification Channel for laravel.
https://laravel.com/docs/notifications#slack-notifications
MIT License
864 stars 59 forks source link

Adding Discord Slack style notification support #59

Closed N3rdP1um23 closed 1 year ago

N3rdP1um23 commented 1 year ago

The following PR allows support for Discord "Slack" notifications out of the box. Discord allows sending webhooks in the style of Slack (referenced here in their developer docs), with a slight modification to the webhook URL (appending /slack).

In this PR, the change checks to see if the routeNotificationForSlack return a url that includes a Discord host (a list of hosts can be found here in one of their support articles; which is dependent on the client version the developer creates the webhook from). From there, it also checks to make sure that the developer hasn't already appended the /slack url "flag". If both cases are true, /slack is appended to the notification url automatically allowing developers to use this repo to support sending notifications to Discord on top of slack.

While most webhook properties are supported, there are a few to note that aren't supported (as listed on the developer docs page listed above)

I do understand this is slightly out of the scope of "slack" and if it's not accepted, no worries. 🙂

driesvints commented 1 year ago

This will indeed be out of scope for this package. It's best that you build your own Discord notification channel instead. Also, tests are failing. Sorry