DEV Community

loading...
Play Button Pause Button
GitHub

Making a Twitch bot to connect to GitHub • Pair Programming

mishmanners profile image Michelle Mannering ・2 min read

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 webhook for github and twitch interaction


daftpunktocat

💄git-twitch💋

Wouldn't it be cool to make chat interactions for Twitch on GitHub? This is a webhook for github and twitch to interact with each other.

🍴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 - https://smee.io/

smee.io 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 points it to the new smee channel.

creating a webhook

note: your webhook will need to send json. You will also need to set a secret.

Choose to send selected events and deselect Push events and select…

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.

Discussion (0)

pic
Editor guide