DEV Community

Play Button Pause Button
Michelle Mannering for GitHub

Posted on • Updated on

Making a Twitch bot to connect to GitHub • Pair Programming

When you want to learn something, doing it with a friend is so much easier. A colleague is also a perfect fit. That's what myself and Bdougie did on our recent Open Source Friday live stream.

Since we both work on the Developer Relations team at GitHub, we thought this would be the perfect opportunity to learn and showcase awesome GitHub features simultaneously. Brian has been working with the GitHub API for a long time and I have been doing a lot of streaming. What better way to work together than use the GitHub API to make Twitch integrations and use them for the GitHub Twitch channel.

Twitch bot and the GitHub API

Making a Twitch bot and using the GitHub API is no trivial task. Luckily, Bdougie has been doing some work on it already. He put together an open source repo which utilises webhooks to talk to Twitch. By forking this repo and following the instructions, you can make the Twitch bot work for your channel.

GitHub logo bdougie / git-twitch

This is a service for GitHub and twitch interaction



(gif created by @pifafu)

This is a service for github and twitch to interact with each other. The use case for this git-twitch interaction between Twitch and GitHub through webhooks. If you are new to Twitch Chat interactions, you can check out my original chatbot, the beybot. In the README you will find further explanation on how Twitch interactions work.

🍴Setup for local development

1. Fork this repo (optional, open a Codespace)

The fastest way to get started is by forking this repo. PRs are welcomed if you find anything missing or unclear.

2. Start a new smee channel - is a Webhook payload delivery service. It receives payloads then sends them to your locally (development) running application. Smee is not meant to be used in production.

smee channel

3. Create a webhook

In your newly forked repo, create a webhook from the repo settings that…

This is exactly what we did on the live stream. We took it from the top and showed viewers how to fork a repo, use various editors to make changes, and then add to OBS. We showed off Codespaces, GitHub Desktop, and how to use (plus hide) secrets.

If you missed the stream you can watch the full recording:

Open Source Fridays

Does this type of content sound really cool to you? Do you like the idea of pair programming? Want to learn more about open source projects? Come along to our Open Source Friday live streams. We go live on the GitHub Twitch Channel most Fridays. Join the Meetup Group to stay up to date and see the topics each week. Join the conversation from last week's stream on our GitHub Community Forum.

See you next stream, and in the meantime: happy coding. Don't forget to fork Bdougie's repo to make your own bot and play around with some open source code.

Top comments (0)