An automated GitHub-Discord bot

Listen to this article

Today we are making a bot that will automatically update our discord channel with actions from GitHub.

I found it a nice addition to my workflow, where the whole team will get updates on the GitHub repo we are working on.

I know you can also set up the mails, but for some reason, it's almost easier getting them in Discord in that specific team channel.

Making a discord webhook

We first have to own a discord channel to make this work, so go ahead and create one if you don't have one.

Then we should click the settings for that channel.

Discord channel settings

Next, we need to visit the Integrations section and make a new webhook.

Discord create webhook

We need to use the Copy webhook URL button to get the actual webhook.

Webhook URL

Setting up the events in GitHub

Now it's time to move over to GitHub to set up things on that side. Open your project in GitHub and visit the settings page for that project.

Click the webhooks button on the menu.

GitHub settings webhooks

Create a new webhook and paste the URL you just got from Discord.

Important: Add /github to the end of this webhook to omit errors

Set the content-type to application/json. And choose which events you would like to receive.

GitHub webhook settings

Now you can try it out by placing a comment, making a new push, or anything similar to that!

Receiving GitHub actions in Discord bot

And that's it. We now have our Github to Discord bot setup! Super easy, right?

Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

Interested in reading more such articles from Chris Bongers?

Support the author by donating an amount of your choice.

Recent sponsors

Comments (2)

Sai Ansul's photo

Wow! I would definitely try this out. 💯

Chris Bongers's photo

Thank you Sai, definitely a cool addition to try, let me know what you think 👍

Sai Ansul's photo

Absolutely, it's a one must try! I'm actually developing one for my server. Chris Bongers