Send Discourse posts to a Discord channel.
- Posts show up in pretty embedded fields that include the author, a link, and the first 80 characters of the post
- Private messages and system messages are ignored
- Discourse gets meaningful HTTP status codes in response to events
- The hook lives in
/docroot
, so you don't have to sully your web root withgit
files - Change one line of code to add more hooks
- PHP 5.5+
- Your own web server
$ git clone https://github.com/ellotheth/distodis
You'll want to check out the Discord and Discourse webhook documentation first.
- Copy
config.php.dist
toconfig.php
. - Add the values for your Discourse and Discord servers.
- Copy
docroot/index.php.dist
todocroot/index.php
. - Point your Discourse webhook at
docroot/index.php
.
-
Copy
config.php.dist
to as many config files as you want hooks. The filename doesn't matter (I likeconfig.<hook identifier>.php
). -
Add the values for all your Discourse/Discord servers.
-
Copy
docroot/index.php.dist
to as many index files as you want hooks. I use<hook identifier>
.php. -
Modify each index file and replace the existing
require '../config.php'
line with the appropriate config filename. For example,docroot/mycoolserver.php
might look like this:<?php require '../config.mycoolserver.php'; require '../hook.php';
-
Point each Discourse webhook at the appropriate index file.