{"id":52033,"date":"2021-07-20T13:26:01","date_gmt":"2021-07-20T13:26:01","guid":{"rendered":"https:\/\/barrycarlyon.co.uk\/wordpress\/?p=52033"},"modified":"2021-07-20T13:26:01","modified_gmt":"2021-07-20T13:26:01","slug":"twitch-to-discord-notifications","status":"publish","type":"post","link":"https:\/\/barrycarlyon.co.uk\/wordpress\/2021\/07\/20\/twitch-to-discord-notifications\/","title":{"rendered":"Twitch to Discord Notifications"},"content":{"rendered":"\n<p>This post is about a thing I built that has been public for a while, but I never wrote up a blog post about it.<\/p>\n\n\n\n<p>A common question that comes up in various places, is &#8220;How do I notify my Discord that my Twitch Stream went live&#8221;, so since I had some time and wanted to build a demo project that shows people how do to that, since it&#8217;s a common thing, it&#8217;s easier to point people to an example.<\/p>\n\n\n\n<p>I decided to build <a rel=\"noreferrer noopener\" href=\"https:\/\/twitch.discord.barrycarlyon.co.uk\/\" target=\"_blank\">BarryCarlyon&#8217;s Super Simple Discord Notifications Platform<\/a>. <\/p>\n\n\n\n<p>It&#8217;s a super simple implementation of Twitch <a rel=\"noreferrer noopener\" href=\"https:\/\/dev.twitch.tv\/docs\/eventsub\" target=\"_blank\">EventSub<\/a> to notify a Discord Channel that a Twitch Stream has gone live.<\/p>\n\n\n\n<p>The long and short of it is fairly straight forward<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>a Twitch EventSub message arrives into server<\/li><li>the Server parses that message<\/li><li>the Server checks if the target channel is live or not (just in case it&#8217;s a duplicate message)<\/li><li>if the checks pass, build a Discord Webhook message<\/li><li>Send that message to the linked Discord Channel via Discord Webhooks<\/li><\/ul>\n\n\n\n<p>The project is fully open source and licensed under &#8220;<a href=\"http:\/\/www.wtfpl.net\/\" data-type=\"URL\" data-id=\"http:\/\/www.wtfpl.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">WTFPL \u2013 Do What the Fuck You Want to Public License<\/a>&#8221; and can be found at the following places<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Use the System yourself as a streamer &#8211; <a rel=\"noreferrer noopener\" href=\"https:\/\/twitch.discord.barrycarlyon.co.uk\/\" target=\"_blank\">https:\/\/twitch.discord.barrycarlyon.co.uk\/<\/a><\/li><li>Review or clone the source code &#8211; <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/BarryCarlyon\/twitch_discord_barrycarlyon_co_uk\" target=\"_blank\">https:\/\/github.com\/BarryCarlyon\/twitch_discord_barrycarlyon_co_uk<\/a><\/li><li>Upvote it on Reddit &#8211; <a rel=\"noreferrer noopener\" href=\"https:\/\/www.reddit.com\/r\/Twitch\/comments\/n1smwa\/barrycarlyons_super_simple_discord_notifications\/\" target=\"_blank\">https:\/\/www.reddit.com\/r\/Twitch\/comments\/n1smwa\/barrycarlyons_super_simple_discord_notifications\/<\/a><\/li><\/ul>\n\n\n\n<p>The live version of the project only allows the logged in Twitch user to link their Twitch to a Discord, so you can&#8217;t login as you and say &#8220;I want to know when Lirik goes live&#8221;, this means that my EventSub cost is zero since you logged in as you and only looking to notify for your own stream. So I fit easily into the EventSub limit since the cost is zero. If you were cloning the project\/logic to use your own ClientID then you don&#8217;t need to worry about getting auth since you probably are not gonna link 3000 or so streamers go lives into the same Discord channel!<\/p>\n\n\n\n<p>So in summary, check out the <a rel=\"noreferrer noopener\" href=\"https:\/\/twitch.discord.barrycarlyon.co.uk\/\" target=\"_blank\">Project<\/a>, use it for your own stream\/discord if you want, or borrow the logic flow from <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/BarryCarlyon\/twitch_discord_barrycarlyon_co_uk\" target=\"_blank\">GitHub<\/a> to do your own stuff with EventSub to Discord. And as always all feature requests and suggestions welcome! It was already requested to allow a Customised Discord message to <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/BarryCarlyon\/twitch_discord_barrycarlyon_co_uk\/issues\/9\" target=\"_blank\">support new\/multiple lines in the message<\/a> and that went in last week!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is about a thing I built that has been public for a while, but I never wrote up a blog post about it. A common question that comes up in various places, is &#8220;How do I notify my Discord that my Twitch Stream went live&#8221;, so since I had some time and wanted &hellip; <a href=\"https:\/\/barrycarlyon.co.uk\/wordpress\/2021\/07\/20\/twitch-to-discord-notifications\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Twitch to Discord Notifications&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":52036,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[244,312],"tags":[376,344,375],"class_list":["post-52033","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-applications","category-twitch","tag-discord-notifcations","tag-eventsub","tag-twitch-notifications"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/barrycarlyon.co.uk\/wordpress\/wp-content\/uploads\/2021\/07\/logo.png?fit=300%2C300&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/52033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/comments?post=52033"}],"version-history":[{"count":3,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/52033\/revisions"}],"predecessor-version":[{"id":52037,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/52033\/revisions\/52037"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/media\/52036"}],"wp:attachment":[{"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/media?parent=52033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/categories?post=52033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/tags?post=52033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}