Cara Mengumumkan Sosial Media Anda Secara Berkala di Twitch Chat
Contoh skrip ini membuat daftar kemungkinan pengumuman obrolan dan kemudian setiap 20 menit mengirimkan salah satunya secara acak sebagai pengumuman obrolan Twitch.
Tonton Videonya
Contoh Skrip
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 onEveryMinute(OnEveryMinuteData data, API api) throws SquisoException {
// Every 20 minutes
if (data.is(20)) {
// Create a list of different text messages to send
SquisoList<SquisoString> list = new SquisoList<>();
// Compose and add the first message into the list
SquisoString message1 = new SquisoString("Please follow me on socials! youtube.com/squiso ⭐ twitter.com/squiso ⭐ tiktok.com/squiso");
list.add(message1);
// Compose and add the first message into the list
SquisoString message2 = new SquisoString("Have you checked out my latest YouTube? 🤩 https://www.youtube.com/watch?v=2F-SnbeaBUw");
list.add(message2);
// Get a random message from the list
SquisoString messageToSend = list.getRandom();
// Send it in chat
api.sendTwitchChatAnnouncement(messageToSend);
}
}
}