Squiso ir bezmaksas, jaudīgs automatizācijas rīks, kas ļauj pielāgot Twitch straumi, izmantojot vienkāršus skriptus.

Kā sveicināt pirmos tērzētājus ar smieklīgu AI atbildi

Šis skripta piemērs klausās visus Twitch tērzēšanas ziņojumus un, ja ziņojums ir viņu pirmais ziņojums jūsu kanālā (ievadziņa), tas ģenerēs smieklīgu AI sveiciena atbildi.

Skatieties Video

Skripta piemērs

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); } }