Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var tmi = require('tmi.js');
- var options = {
- options: {
- debug: true
- },
- connection: {
- reconnect: true
- },
- identity: {
- username: "ChatControler",
- password: "oauth:gbt65e6vfz7czsdy59064qfzblr7dz"
- },
- channels: ["majkkyna"]
- };
- var client = new tmi.client(options);
- client.connect();
- client.on('chat', function (channel, user, message, self) {
- if(message == "!bot"){
- client.say(channel,"Ano. Bot jsem ja :P :D ! Autor: Nicprohubeny(MrPearmen)");
- }else if(message == "!csrank"){
- client.say(channel,"MakkyRank: Silver 4")
- }else if(message == "!majkkyna"){
- client.say(channel,""+user.username+" si mysli, ze majkkyna je nej! <3 <3");
- }else if(message == "!Majkkyna"){
- client.say(channel,""+user.username+" si mysli, ze majkkyna je nej! <3 <3");
- }else if(message.startsWith("ahoj")||message.startsWith("Ahoj")){
- if(!user.username == "ChatControler"){
- client.say(channel, "Ahoj @"+user.username+" HeyGuys ;)");
- }
- }else if(message == "!test"){
- client.say(channel,"Ale funguje <3")
- }
- });
- client.on("clearchat", function (channel) {
- client.action(channel,"Chat byl vymazan moderatorem!");
- client.say(channel,"1. Kappa :D")
- });
- client.on("ban", function (channel, username, reason) {
- if(reason != null){
- client.action(channel,"Uzivatel "+username+" byl zabanovan! Duvod: "+reason);
- }else{
- client.action(channel,"Uzivatel "+username+" byl zabanovan!");
- }
- });
- client.on("action", function (channel, userstate, message, self) {
- // Don't listen to my own messages..
- if (self) return;
- if(message == "gives ChatControler a hug!"){
- if(userstate.username == "makkybot"){
- client.say(channel,"Take vas vsechny obejmu ;) Keepo :D <3");
- }
- }else{
- }
- });
- client.on("timeout", function (channel, username, reason, duration) {
- if(reason != null){
- client.action(channel,username+" byl docasne zabanovan na "+duration+" sekund za: "+reason);
- client.whisper(username,"Byl jsi docasne zabanovan na "+duration+" sekund za: "+reason);
- }else{
- client.action(channel,username+" byl docasne zabanovan na "+duration+" sekund.");
- client.whisper(username,"Byl jsi docasne zabanovan na "+duration+" sekund.");
- }
- });
- client.on('connected', function(adress,port) {
- console.log("ChatControler by nicprohubeny byl uspesne nacten!");
- console.log("pripojeno: "+adress+":"+port);
- })
- client.on("join", function (channel, username, self) {
- if(username != "chatcontroler"){
- console.log("Vitej "+username+ " na streamu!");
- }else console.log(channel,"Byl jsem spusten!");
- });
- client.on("subscription", function (channel, username, method, message, userstate) {
- client.acion(channel,username+" dal subscribe! DEKUJEME!");
- });
- client.on("cheer", function (channel, userstate, message) {
- client.say(channel,":o :o OMG! "+userstate.username+" poslal cheer! ;) Zprava: "+message);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement