Send chat messages on a timer
Create reusable scheduled chat announcements for Twitch, YouTube, or any other supported messaging service.
AlphaResult
You will create a timer automation that posts a message to chat every 10 minutes. This guide uses a Twitch message promoting a Discord server as a concrete example:
Join my Discord {vars.discord_link}
The message itself can contain anything: links, stream schedules, reminders, commands, sponsor messages, or community information. You can also replace Twitch with YouTube or any other supported integration that provides an action for sending messages.
The example URL is stored in a project variable, so it can be updated without editing the action. At the end, you will limit the timer to periods when your channel is live.
Before you start
You need an account for Twitch, YouTube, or another supported service to which Streaming Hub can send messages. Make sure you can sign in to the selected service when its connection window opens.
Step 1. Start with the default automation
Open Streaming Hub and create a new project. A new project already contains one enabled automation with a Timer Tick signal and a Log action.
Change the automation name from New Automation to Join Discord so its purpose is easy to recognize later.
Step 2. Set the timer to 10 minutes
Expand Signal Context at the top of the automation and configure the timer:
| Field | Value |
|---|---|
| Interval | 10 |
| Unit | Minutes |
Step 3. Replace the Log action
- Delete the existing Log action with its trash button.
- Under Add Step, select + Add.
- Open the Twitch category or search for
send. - Select Send Message.
If you are using another service, open its category and select the equivalent message action instead.
Your sequence should now contain only one action: Send Message.
Step 4. Add the message and Discord variable
Select Send Message and enter this text in its Message field:
Join my Discord {vars.discord_link}
In the Variables panel on the right:
- Select Add.
- Create a string variable named
discord_link. - Set its value to your Discord invite URL, for example
https://discord.gg/your-server.
Streaming Hub replaces {vars.discord_link} with the current value of the project variable every time the action runs. Keeping the link in a variable makes it reusable in other automations and easy to change in one place.
Step 5. Connect your Twitch broadcaster account
Open Twitch settings in either of these ways:
- select Services, then Twitch, from the main menu; or
- double-click Twitch in the status bar at the bottom of the main window.
Then:
- Set Chat Account to Broadcaster.
- Select Connect Broadcaster.
- Complete the Twitch sign-in and authorization in the browser window that opens.
- Return to Streaming Hub and select Save in the lower-right corner of Project Settings.
This setup sends the message from your channel account. Later, you can connect a separate bot and change Chat Account if you prefer messages to come from that bot.
Step 6. Test the automation
At the top of the automation, select Test. You do not need to wait 10 minutes for this manual check.
Your Twitch chat should receive the completed message from the selected chat account.
The log panel at the bottom of Streaming Hub shows the run in order: the automation starts, Send Message runs, Twitch queues the message, and the automation finishes.
Step 7. Send messages only while live
The timer currently runs whenever Streaming Hub and the project are open. To prevent promotional messages while your channel is offline, first configure the app's source of live-status information.
Open App Settings, then General, or double-click Live State at the lower-right of the status bar. Under Live State Source, choose Twitch Stream State, then save the settings.
Return to the automation, expand Signal Context, enable Only When Stream Online, and save your project.
Twitch is only the source used in this example. The online-only option reads the global Live State Source, so you can base it on another installed service when that service provides stream-state information. The service used to detect whether you are live does not have to be the same service that receives the message.
Verify the finished automation
Your automation is ready when all of the following are true:
- the signal is Timer Tick with an interval of 10 minutes;
- Only When Stream Online is enabled;
- the sequence contains one Send Message action for your selected service;
- the message uses
{vars.discord_link}; - the
discord_linkvariable contains your own invite URL; - the selected messaging service is connected;
- an appropriate provider is selected as the app's Live State Source.
During a live stream, the timer will now post the message once every 10 minutes. While the channel is offline, scheduled timer ticks are ignored.
If it does not work
- No message appears: check the service indicator in the status bar and reconnect the selected account if necessary.
- The literal text
{vars.discord_link}appears: verify that the variable is named exactlydiscord_linkand has a string value. - The timer does not run while live: confirm that the status bar reports the channel as live and that the correct Live State Source is selected.
- The test fails: inspect the log panel for the first warning or error from the selected service or the automation.
Adapt it
- Change the interval to match the pace of your channel. Avoid sending repeated messages too frequently.
- Bind Interval to a numeric variable when you want to adjust the timing in one place or change it from another automation.
- Replace the copy and variable to promote your schedule, donation page, social profiles, or community rules.
- Create several timer automations with different intervals instead of placing every promotion in one long message.
Related
Download the ready-made script
Import it into Streaming Hub, then follow this guide to add your own variables and connect the required services.
Download the Twitch example script