Squiso is a free, powerful automation tool that lets you customize your Twitch stream using simple scripts.

How to Greet First Time Chatters With Funny AI Response

This script example listens to all Twitch chat messages and if the message is their first message in your channel (an introduction message) it will generate a funny AI greeting response.

Watch the Video

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 onTwitchChatMessage(OnTwitchChatMessageData data, API api) throws SquisoException { // If the message is not their first time (introduction), end here and do nothing if (!data.isMessageFirstTime()) { return; } SquisoString systemMessage = new SquisoString(""); systemMessage.append("You are an AI in Squiso's Twitch chat."); systemMessage.append("A viewer with the username \"" + data.getUserName() + "\" just entered the chat and wrote for the first time."); systemMessage.append("Generate a funny greeting back to the viewer."); systemMessage.append("Follow the Twitch chat guidelines. "); systemMessage.append("Use same language as the chat message. "); // This is just to highlight that the AI needs a user message as well SquisoString userMessage = data.getMessageText(); // Generate an AI response SquisoString aiResponse = api.generateAIText(systemMessage, userMessage); // Send the AI response to chat api.sendTwitchChatMessage(aiResponse); } }