DEV Community

loading...
WayScript

Automatically Share your Tweets with Discord Channels | WayScript Automation

derricksherrill profile image Derrick Sherrill ・2 min read

Introduction

If you are running a messaging channel, you might want the members to not miss any post on your social media.

Using Wayscript, you can integrate Twitter with Discord and share regularly your tweets seamlessly.

Let’s build this script.

Prerequisites

There are no prerequisites for this script. However, here are some documentation you might find useful.

Trigger

We want to post the Tweets regularly in the Discord channel. Let’s choose time so all tweets within 24 hours will be posted automatically in the channels.

Add it as a Trigger.

tutorial step #1

You have a lot of options when configuring the Time Trigger. For this post, the script will run every day. Once you’ve chosen this mode, you will have to set the time. Choose the most suitable time for you.

tutorial step #1

Retrieve Tweets

Wayscript provides a Twitter module with a lot of functionalities for your needs.

Add it as a new step.

tutorial step #1

Now, add your account and choose My Profile Timeline for the mode. This mode pulls data from your timeline.

Once it’s done, you’ll have to choose the outputs. The Tweets outputs will work best here.

Loop through Tweets and Post on Discord

The output (Tweets) we are working with is actually a list of tweets. To better work with it, we’ll use a loop, get each item (Tweets_item) according to the index and post it on Discord.

Fortunately, Wayscript provides many options for loops but here we will use the Loop module.

Add as a new step.

tutorial step #1

This module needs an input (a list) to work. Add the Tweets variable.

tutorial step #1

Now, each Tweets_Item contains information we need for a tweet such as content and link. This will be used in the Discord module.

Add it as a new step in the Loop.

tutorial step #1

The configuration for the Discord module is simple. We want here to only write a message on the channel. Then you can choose the channel, the bot name and write your message.

tutorial step #1

Now, turn on the Trigger and Wayscript will handle the automation of the script for you.

tutorial step #1

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.

Discussion (0)

pic
Editor guide