Twitch Announce to Discord Webhook

by Liz Calkins

Version 1 (March 5, 2021)

Download (64 downloads)

Note: Twitch seems to have changed their notifications in a way that breaks this flow. Leaving it up so I can see if they eventually settle on a new notification style I can adapt this to.

This is something I cooked up for my own purposes that I figure is probably of general enough use to also post here.

How to use this flow:

Setting up Twitch:

1. Install the Android Twitch app: https://play.google.com/store/apps/details?id=tv.twitch.android.app
2. Follow every streamer you want to announce and turn on Notifications for them.
3. Go to your Account Settings > Notifications in the Twitch app.
4. In "On Mobile" turn on "Live: When a streamer I follow goes live" and "Send me push notifications".
5. Turn OFF "Enable Smart Notifications", since you want to make sure you always get notifications on mobile even if you're watching Twitch elsewhere.

(Note that Automate currently cannot auto-cancel Twitch notifications thanks to Android limitations, sadly. If that ever changes I'll hopefully remember to make a version that auto-cancels after posting the announce.)

Setting up the actual flow:

1. In the "Set variable streamer" block, the left side is the Twitch channel name (the bit after the http://twitch.tv/ ). The right side is if you want to set a custom display name, or you can just leave it empty if you want to keep the raw channel name. You can have as many or as few entries as you want so long as there's at least one entry.
2. Then start the flow and paste the URL of the Discord channel webhook you want to announce to into the dialog prompt. You can look here: https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks for how to get one.

(Since IMHO it's easier to just hardcode the streamer names than having an extra config file or entering them all again if the flow ever stops, but you obvs don't want your webhooks visible on your phone!)

This is currently set up to output a single embed-style post that displays:

[Streamer Name, linked to the channel]
[Thing they're streaming, linked to the channel]
[Static preview picture, with URL tweak to prevent Discord caching]
[The description the streamer put for their stream.]

If you want to tweak the output, these are good helper sources for Discord webhook coding:
https://birdie0.github.io/discord-webhooks-guide/
https://leovoel.github.io/embed-visualizer/
https://jsonformatter.curiousconcept.com/