Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var tmi = require('tmi.js');
- var channelname = "HappyOtterArt"
- var options = {
- options: {
- debug: true
- },
- connection: {
- cluster= "aws",
- reconnect: true
- },
- identity:{
- username: "BOT ACCOUNT NAME",
- password: "OAUTH KEY " //link provided
- },
- channels:[channelname]
- }
- car client = tmi.client(options);
- client.connect();
- client.on("connected",function(address,port){
- console.log("connected: " + address + ":" + port);
- client.action(channelname,"I am Live");
- })
- client.on("chat", funtion(channel, user, message,self){
- if (self) return;
- var words = message.split(" ");
- var command = words[0];
- var response;
- if (command === '!spooked'){
- if (words.length < 3 && words.length > 1){
- var chance = Math.random();
- if (chance > 0.5) response = user + " has spooked " + words[1]
- if (chance =< 0.5) response = user + " has failed to spook " + words[1]
- }
- }
- client.action(channelname, response);
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement