Skip to content

How to Automatically Share Top News Headlines on Discord using OpenAI

  • by

Let us explore how you can integrate OpenAI with Discord and automatically share the top news headlines of the day on the Discord channel of your choice using OpenAI.
This automation requires a one-time setup, for which we will use Pabbly Connect.
We will first add a Schedule trigger to the workflow to set a specific time for posting the news, then link Pabbly Connect with OpenAI to capture the latest news, and lastly, share the news on Discord.

Steps to Automatically Share Top News Headlines on Discord using OpenAI

1. Sign In / Sign Up to Pabbly Connect and Create a Workflow
2. Add Schedule as the Trigger App to Set Time to Post News
3. Add Date / Time Formatter to capture the Current Date
4. Setup OpenAI as the Action App to Generate Latest News
5. Setup Discord as the Action App to Send Channel Messages

Step 1:- Sign In / Sign Up to Pabbly Connect and Create a Workflow

A. Sign In / Sign Up

To begin this process, visit Pabbly Connect and create your account by clicking on the ‘Sign Up Free’ button. You can also click on Sign In if you already have an account.

Click on the Pabbly Connect ‘Access Now’ button

B. Create Workflow

To create a new workflow, click the ‘Create Workflow’ button.

Name your workflow, and click on ‘Create’.

Step 2:- Add Schedule as the Trigger App to Set Time to Post News

Trigger is the app that executes the workflow. Since we want to post news and execute the workflow at a specific time, in our case it would be Schedule by Pabbly.

Choose ‘Schedule by Pabbly’ as the Trigger App, select how often you want to send the message, set a Date and time to execute the workflow, and click on ‘Save’.
Note: Make sure to check your Time Zone.

Step 3:- Add Date / Time Formatter to capture the Current Date

Let us now add a Date / Time Formatter to our workflow to fetch the current date and feed it to OpenAI to generate the latest news.

Choose ‘Date/Time Formatter by Pabbly’ as the Action App, select ‘Current Date’ as an Action App, and click on ‘Connect’.

Select a Basic Format, choose whether you want to Include Time in Response, and click on ‘Save & Send Test Request’.

Step 4:- Setup OpenAI as the Action App to Generate Latest News

Action allows us to choose the application that will get executed by the workflow trigger.
Since we want to generate the latest news of the day using OpenAI – it will be our Action App.

Add another Action step to your workflow by clicking the ‘+’ button.

A. Action App

Choose ‘OpenAI’ as the Action App, select ‘Generate Content’ as an Action Event, and click on ‘Connect’.

B. Connect OpenAI Account

To connect with your OpenAI account, select ‘Add New Connection’. You will be prompted to enter your API Token. Find your API Token by clicking on the ‘OpenAI API Keys page’ button.

Generate and copy your API Token, paste it into its given field, and click on ‘Save & Send Test Request’.

Select the AI Model you want to use for generating the article.

C. Enter / Map the Necessary Fields

Now that you have connected your OpenAI account, all you need is to map the necessary details from the step above. Mapping ensures our data remains dynamic and changes as per the received responses.

Compose a Prompt by mapping the details from the step above.

Similarly, select/enter other fields, leaving the unnecessary ones empty, and click on ‘Save & Send Test Request’.

As soon as you click on Save & Send Test Request, the latest news will automatically be captured using OpenAI.

Step 5:- Setup Discord as the Action App to Send Channel Messages

Action allows us to choose the application that will get executed by the workflow trigger.
We essentially want to share the captured latest news on a Discord channel. Therefore, Discord will be our Action App.

Add another Action Step to your workflow by clicking the + button.

A. Action App

Choose ‘Discord’ as the Action App, select ‘Send Channel Message (Markdown)’ as an Action Event, and click on ‘Connect’.

B. Connect Discord Account

To connect with your Discord account, you need a Webhook URL. Follow these steps to generate the Webhook URL, copy the Webhook URL and paste it into its given field – This will establish a connection between Discord and Pabby Connect.

C. Map the Message

Map the Message to be posted from the step above.

Similarly, map the other fields, leaving the unnecessary ones empty, and click on ‘Save & Send Test Request’.

The moment you click on Save & Send Test Request, news will be shared on your Discord channel.

Our automation is complete. We have successfully integrated OpenAI with Discord. Now, each day the latest news headlines will automatically be generated in OpenAI and shared via Discord.

Sign Up for a free Pabbly Connect account, and start automating your business
Subscribe to our Youtube Channel for more such automation
For any other queries, visit our forum