Skip to content

Instantly share code, notes, and snippets.

@VaclavElias
Last active April 2, 2023 13:03
Show Gist options
  • Save VaclavElias/4b7dab4eaf39c64de5f91132792d6241 to your computer and use it in GitHub Desktop.
Save VaclavElias/4b7dab4eaf39c64de5f91132792d6241 to your computer and use it in GitHub Desktop.
Stack Exchange and Discord Integration

Yes, you can set up a notification system to push new entries and comments tagged with 'stride' from Stack Exchange to your Discord channel. One way to achieve this is by using a webhook combined with an RSS feed from Stack Exchange.

Follow these steps to set up the notification system:

Create a webhook in your Discord channel:

  1. Go to your Discord server settings.
  2. Click on "Integrations" and then click "Create Webhook."
  3. Customize the webhook's name, avatar, and choose the desired channel for notifications.
  4. Copy the webhook URL, as you'll need it in the next steps.

Get the RSS feed for the 'stride' tag on Stack Exchange:

Visit https://gamedev.stackexchange.com/feeds/tag?tagnames=stride&sort=newest to get the RSS feed for questions tagged with 'stride'. Copy the URL.

Use a service to send RSS feed updates to Discord:

There are several services that can send RSS feed updates to Discord, such as Zapier or Integromat. For this example, we'll use Zapier.

  1. Sign up for a free account at https://zapier.com/.
  2. Click on "Make a Zap."
  3. For the trigger app, search for "RSS" and choose "RSS by Zapier."
  4. Choose the "New Item in Feed" trigger event and click "Continue."
  5. Paste the RSS feed URL you copied earlier into the "Feed URL" field, then click "Continue."
  6. Test the trigger to ensure it's working and click "Continue."
  7. For the action app, search for "Webhooks" and choose "Webhooks by Zapier."
  8. Choose "POST" as the action event and click "Continue."
  9. Paste the webhook URL you copied from Discord into the "URL" field.
  10. Set "Content Type" to "application/json."
  11. In the "Data" field, create a JSON payload that Discord will understand. For example:
{
  "content": "New question on GameDev StackExchange with 'stride' tag: {{title}} - {{link}}"
}
  1. Click "Continue" and test the action to ensure it's working.
  2. Finally, click "Turn on Zap" to activate the notification system.

Now, whenever a new question or comment tagged with 'stride' is posted on Stack Exchange, you'll receive a notification in your Discord channel. You may need to adjust the JSON payload or filter the feed to include comments if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment