Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const tmi = require('tmi.js');
- // Define configuration options
- const opts = {
- connection: {
- cluster: "aws",
- reconnect: true
- },
- identity: {
- username: "kfeevollautomat",
- password: "oauth:1w9d02r6oy2wc0lf83mmhxc1zcdg0t",
- },
- channels: ["rubizockt"]
- };
- // Create a client with our options
- const client = new tmi.Client(opts);
- // Register our event handlers (defined below)
- //Special User - Special Greetings after join
- client.on('join', function(channel, username, self) {
- if (username === "rubishelfer") {
- client.say("rubizockt", "Helferlein, was willst du denn hier?")};
- if (username === "rubizockt") {
- client.say("rubizockt", "Schön, dass der Streamer auch da ist")};
- if (username === "izzer_") {
- client.say("rubizockt", "Da izzer_ ja Kappa")};
- if (username === "deadlynightling") {
- client.say("rubizockt", "Da schleicht ein Deadly rum, Hallo =)")};
- if (username === "themavkis") {
- client.say("rubizockt", "Da ist 1 Mavis - ich freu mich :) ")};
- if (username === "dotex97x") {
- client.say("rubizockt", "Dot.exe wird ausgeführt - Sei Gegrüßt WholeWheat")};
- if (username === "fraeulein_jumpcut") {
- client.say("rubizockt", "Begrüßen Sie die Schwester. Hallo Fräulein Jumpcut. Kappa")};
- if (username === "daemonic_medusa") {
- client.say("rubizockt", "Hello to the Netherlands. Welcome Medusa! ")};
- if (username === "ptk_panthers") {
- client.say("rubizockt", "Na Panther, alles fresh? ")};
- if (username === "migsy_") {
- client.say("rubizockt", "Hola Migsy_, muy buenas, como estas mi amor?")};
- });
- client.on('message', onMessageHandler);
- client.on('connected', onConnectedHandler);
- // Connect to Twitch:
- client.connect();
- // Called every time a message comes in
- function onMessageHandler (target, context, msg, self) {
- if (self) { return; } // Ignore messages from the bot
- // Remove whitespace from chat message
- const commandName = msg.trim();
- // If the command is known, let's execute it
- if (commandName === '!dice') {
- const num = rollDice();
- client.say(target, `Du hast eine ${num} gewürfelt`);
- console.log(`* Executed ${commandName} command`);
- }
- if (commandName === '!kaffee') {
- client.say(target, `Ist unterwegs!`);
- console.log(`* Executed ${commandName} command`);
- }
- if (commandName === 'rubizoCof') {
- client.say(target, `Ich glaube er braucht einen neuen Kaffee ^^`);
- console.log(`* Executed ${commandName} command`);
- }
- if (commandName === '!dampf') {
- client.say(target, `Dampf ablassen ist bloss ein Kosewort für's Rauchen am offenen Fenster. Nix für eure Augen und Ohren Kappa`);
- console.log(`* Executed ${commandName} command`);
- }
- if (commandName === '!teamspeak') {
- client.say(target, `Teamspeak? Ham wa: 87.106.147.176:9990 Und dann ab in den Raum RubiZockt!! Kappa`);
- console.log(`* Executed ${commandName} command`);
- }
- var patt = new RegExp("Hund"); // Suchwort : Hund
- var res = patt.test(commandName); // <<durchsucht commandName(twitch-chat-nachricht) & liefert bei Treffer true zurück
- if (res == true) { // true erfüllt also ab an die Kommandos
- client.say(target, `Wuff!! Pogdog`); // << Wuff! in den Chat ;)
- }
- var patt = new RegExp("Katze"); // Suchwort : Katze
- var res = patt.test(commandName); // <<durchsucht commandName(twitch-chat-nachricht) & liefert bei Treffer true zurück
- if (res == true) { // true erfüllt also ab an die Kommandos
- client.say(target, `Miau!! CoolCat`); // << Wuff! in den Chat ;)
- }
- var patt = new RegExp("mitspielen"); // Suchwort : mitspielen
- var res = patt.test(commandName); // <<durchsucht commandName(twitch-chat-nachricht) & liefert bei Treffer true zurück
- if (res == true) { // true erfüllt also ab an die Kommandos
- client.say(target, `Ich glaub er sagt Bescheid, wenn er jemanden braucht TwitchLit TwitchUnity`); // << Antwort ;)
- }
- var patt = new RegExp("Krake"); // Suchwort : Krake
- var res = patt.test(commandName); // <<durchsucht commandName(twitch-chat-nachricht) & liefert bei Treffer true zurück
- if (res == true) { // true erfüllt also ab an die Kommandos
- client.say(target, ` Squid1 Squid2 Squid3 Squid4`); // << Antwort ;)
- }
- var patt = new RegExp("xD"); // Suchwort : Krake
- var res = patt.test(commandName); // <<durchsucht commandName(twitch-chat-nachricht) & liefert bei Treffer true zurück
- if (res == true) { // true erfüllt also ab an die Kommandos
- client.say(target, ` xD ist so 90er Digga PixelBob `); // << Antwort ;)
- }
- var patt = new RegExp("Fortnite"); // Suchwort : mitspielen
- var res = patt.test(commandName); // <<durchsucht commandName(twitch-chat-nachricht) & liefert bei Treffer true zurück
- if (res == true) { // true erfüllt also ab an die Kommandos
- client.say(target, `Fort-WAS? Bist du des Wahnsinns? SoonerLater NotLikeThis KappaPride Ich glaub das ist nicht dein Stream hier ... Schade Kappa`); // << Antwort ;)
- }
- var patt = new RegExp("knorke"); // Suchwort : mitspielen
- var res = patt.test(commandName); // <<durchsucht commandName(twitch-chat-nachricht) & liefert bei Treffer true zurück
- if (res == true) { // true erfüllt also ab an die Kommandos
- client.say(target, `Hat er gerade ernsthaft "knorke" benutzt? FailFish FailFish FailFish`); // << Antwort ;)
- }
- }
- // Function called when the "dice" command is issued
- function rollDice () {
- const sides = 6;
- return Math.floor(Math.random() * sides) + 1;
- }
- // Called every time the bot connects to Twitch chat
- function onConnectedHandler (addr, port) {
- console.log(`* Connected to ${addr}:${port}`);
- client.say("rubizockt", `Hallo Zusammen DendiFace`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement