Has any one tried webhooks with Discord?


(@SenpaiMass) #1

Discord recently released webhooks

I am having 400 errors after exactly following the procedure layed out by the discord team.
Is any one successful of achieveing the webhook with discord?


(Rafael dos Santos Silva) #3

Looks like Discord need something like this:

curl -X POST --data '{ "embeds": [{"title": "Topic Title", "url": "https://example.com", "description": "This is a test for webhooks", "type": "link", "thumbnail": {"url": "https://meta-s3-cdn.freetls.fastly.net/original/3X/c/b/cb4bec8901221d4a646e45e1fa03db3a65e17f59.png"}}] }' -H "Content-Type: application/json"  https://canary.discordapp.com/api/webhooks/url

that results:

You will need a plugin to format Discourse Webhook properly, or convince Discord to parse our webhook format (they already do exceptions for Github and Slack).


Setting up webhooks
(Rafael dos Santos Silva) #4

Update:

Using Zapier as the middleman, it’s pretty easy to integrate a Discourse webhook to Discord!

Use this template for new topics:

Result:


#5

Thanks. The problem with Zapier is they are not free. You have to start paying after a low amount of Zap triggers.


(Daniel Marquard) #6

I’ve made one you can use, you just need a web server running PHP to receive and process the webhooks from Discourse before sending them to Discord.


(David Taylor) #7

Another option is the new discourse-chat-integration plugin I’m working on - it can post new topics to Discord without Zapier or scripts on any other server.