Squiso is a free, powerful automation tool that lets you customize your Twitch stream using simple scripts.
How to Send a Twitch Going Live Discord Message
This is a simple example that listens to your stream starts and ends and sends a message to a Discord channel using a webhook.
Script Example
import com.squiso.*;
import com.squiso.exception.*;
import com.squiso.scripting.*;
import com.squiso.scripting.data.*;
import com.squiso.keyboard.*;
import com.squiso.twitch.*;
import com.squiso.datatypes.*;
import com.squiso.utils.*;
// Important - Please do not change the row below - otherwise you will get a compilation error!
public class Script_Example extends SquisoScript {
@Override
public void onTwitchStreamStarted(OnTwitchStreamStartedData data, API api) throws SquisoException {
SquisoString discordWebhookURL = new SquisoString("https://discord.com/api/webhooks/123/abc");
// Compose the message to Discord
SquisoString message = new SquisoString("");
message.append("Hey @everyone! I am now live!");
message.append("\n");
message.append("\n");
message.append("https://twitch.tv/twitch");
api.sendSimpleDiscordMessage(discordWebhookURL, message);
}
@Override
public void onTwitchStreamEnded(OnTwitchStreamEndedData data, API api) throws SquisoException {
SquisoString discordWebhookURL = new SquisoString("https://discord.com/api/webhooks/123/abc");
// Compose the message to Discord
SquisoString message = new SquisoString("");
message.append("Stream ended! Thanks for watching everyone!");
api.sendSimpleDiscordMessage(discordWebhookURL, message);
}
}