DEV Community

Derrick Sherrill for WayScript

Posted on

How to Automate Tweets/Discord from Twitch Live Streams

Introduction

Live Streaming is one of the most entertaining media on Earth. With more than 90,000 channels live daily, Twitch is the number one platform for Streamers.

Today, with Wayscript we are going to build a script to post on Twitter and Discord about current live Streams.

Prerequisites

No prerequisites for this post, but here is some documentation you might find useful.

Trigger

For this tutorial, we’ll use Time Trigger and choose an appropriate time. Then, the script will automatically run at this precise time.

Add Time Trigger as a trigger.

Adding Time Trigger

Then set the script to run every dat at 8:00 pm.

Configuring the Trigger

Get Current Live Streams

Wayscript provides a Twitch module that you can use to get data about channels, users, or streams. Add the module as a new step.

Addint Twich Module

Once it’s done, you’ll have to choose a model. For this post, we’ll get a list of the current top streams. This list will contain the top 10.

Configuring Twitch module

The next step is to choose the output we are going to work with.

Choosing outputs

Posting on Twitter and Discord

If you noticed, the output containing the current live streams is a list. It means that to properly post on Twitter and Discord, we have a loop through it and work with each item.

Add a loop as a new step.

Adding loop

As I said earlier, we must loop through the list.

Adding the variable

Great. Once it’s done we can now add Discord and Twitter modules to the party.

Adding Discord and Twich modules

If you have an account on Twitter, add it and set the mode to Post a Twitter status. The message will simply be List_Of_Top_Streamers_Item.

Twitter configuration

Once you’ve finished with it, we can configure the Discord module. You’ll also need to add an account and choose the channel into which you want to write the message.

Discord configuration

Wayscript lets you provide a lot of useful inputs such as the name of the bot posting the message in the channel and an image URL.

Message in Discord channel

Great! The script is now ready to run automatically, so be sure you have the Time Trigger switched on. :)

Conclusion

Questions about this script or anything else? Join our Discord. We're always around to help. If you want to work with the full script template, just find it here

Top comments (0)