How to post in Discord when someone goes live
A stream alert is a bot that checks whether a streamer is live every few minutes and posts when they start. In Buildcord that is a scheduled flow, a request to the Twitch API and a message. Checking every few minutes needs Lite, at $4 a month; the Free plan's schedules run at most once an hour.
Steps
Create a Twitch application
In the Twitch developer console, register an application. Copy its client ID and client secret.
Save them as secrets
In your bot's settings, add the client ID and secret as secrets. Secrets are encrypted and only filled in by the request step, so they can't leak into a message.
Draw a scheduled flow
Add a flow, choose Schedule and set it to run every few minutes, such as
*/3 * * * *.Ask Twitch if the streamer is live
Add two Send an API request steps. The first asks Twitch for an access token with your secrets. The second asks the streams endpoint for the streamer's login name, using that token.
Post once per stream
Add a condition that continues only when Twitch returns a stream. Check a stored value so the bot doesn't post again for the same stream, then send your message with the stream's title and a link.
Deploy
Deploy, then run the flow once from the logs to see each step's result.
Good to know
- Watching several streamers is a loop over a list of names.
- Twitch's rules for apps change from time to time, so check the developer documentation for the current token request.
- The built-in AI agent can draft these steps if you describe the alert you want.
Questions
Does this work with YouTube?
The approach is the same: a scheduled flow that calls the platform's API. The request steps and the way you detect a live stream differ.
More guides
- How to make a Discord bot without coding
- How to build a Discord bot from ChatGPT
- How to set up a ticket system in Discord
- How to give roles automatically in Discord
- How to host a Discord bot 24/7 for free
- How to make custom slash commands in Discord
- How to set up a welcome message in Discord
- How to set up a warning system in Discord
- How to make a Discord reaction role bot
- How to set up auto-moderation on Discord with AI
- How to log deleted messages on Discord
- How to make a poll in Discord with a bot
- How to set up a starboard on Discord
- How to make a Discord reminder bot
- How to make a Discord birthday bot
- How to make a Discord application form
- How to make a counting channel in Discord
- How to post YouTube uploads to Discord automatically
- How to make an AI FAQ bot for your Discord server