Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Provide support for < Chrome 41 mainly due to CLR Browser..
- String.prototype.includes || (String.prototype.includes = function() {
- return -1 !== String.prototype.indexOf.apply(this, arguments)
- }), String.prototype.startsWith || (String.prototype.startsWith = function(a, b) {
- return b = b || 0, this.indexOf(a, b) === b
- }), Object.setPrototypeOf || (Object.setPrototypeOf = function(obj, proto) {
- obj.__proto__ = proto;
- return obj;
- });
- module.exports={
- client:require("./lib/client"),
- Client:require("./lib/client")
- };
- //Initial requires.
- var tmi = require('tmi.js');
- //These are the settings for the client to use.
- var options = {
- options: {
- debug: true
- },
- connection: {
- cluster: "aws",
- reconnect: true
- },
- identity: {
- username: "LewdBot__",
- password: "code"
- },
- channels: ["Lacrimosaangel"]
- }
- //This is creating our client connection with settings.
- var client = new tmi.client(options);
- //This connects to the twitch.
- client.connect();
- //This function is executed as soon as the bot has connected to the channel.
- client.on("connected", function(address, port){
- client.action("Lacrimosaangel", "Warming up... Please be gentle! LacriWah");
- });
- //This function is executed everytime someone sends a message in the chat.
- client.on("chat", function(channel, user, message, username){
- //Using this if statement you can check the contents of a message and create commands.
- //This checks the contents of the message to see if they match the given message, this means that the message HAS to be that it cannot just contain that message.
- //This allows you to set commands or even words without worrying if someone was to use the word in a sentence or so on.
- //greetings
- if(message.toLowerCase().includes("hello")){
- client.say("Lacrimosaangel", " Hi " + user["display-name"] + "!")
- }
- if(message.toLowerCase().includes ("goodbye")){
- if(user["display-name"] !== "LewdBot__"){
- client.say("Lacrimosaangel", "Goodbye " + user["display-name"] + "!")
- }}
- //timed commands
- setTimeout(function(){
- client.say("Lacrimosaangel", "Want to hang out after stream? Join our discord over at https://discord.gg/aem6Hzx LacriLove We also have a twitter account at twitter.com/Lacrimosaangel");
- }, 10000);
- setTimeout(function(){
- client.say("Lacrimosaangel", "Tuturu! ~♪♫ TuturuK");
- }, 8520000);
- setTimeout(function(){
- client.say("Lacrimosaangel", "Let's do some 1v1 360 no scopes on rust");
- }, 14400000);
- setTimeout(function(){
- client.say("Lacrimosaangel", "420 blaze it, let's get high and have some fun!");
- }, 15600000);
- //mod/user specific commands
- //for potts
- if(message === "pottsChamp"){
- if (user["display-name"] === "pottsasaurus"){
- client.say("Lacrimosaangel", "Watch out! We're bringing out the banhammer")
- }
- else {
- client.say("Lacrimosaangel", "Sorry, you don't get to spank me today ;)")
- }
- }
- //for mori
- if (message === "meatWave"){
- if (user["display-name"] === "moricath"){
- client.say("Lacrimosaangel", "Hi Mori! meatWave It's lovely to see you again!")
- }
- }
- //for Keanu
- if(message.toLowerCase().includes("butts")){
- if (user["display-name"] === "Keanu23898"){
- client.say("Lacrimosaangel", "So Lewd! Is that you @Keanu23898 ?")
- }
- }
- //for Xanra
- if(message.toLowerCase().includes("VoHiYo")){
- if (user["display-name"]=== "Xanra"){
- client.say("Lacrimosaangel", "Hi Kettle! Nice to have you back, did you spell it correctly today?")
- }
- }
- //help commands
- if (message.indexOf("!help") > -1){
- client.say("Lacrimosaangel", "We have some custom commands on the way soon. At the moment, bot is still very bare! LacriWah Any ideas, please use the suggestions box in discord!")
- }
- //lewd commands go here.
- if(message.toLowerCase().includes("!lewd")){
- client.say("Lacrimosaangel", "So lewd! LacriWah")
- }
- if(message.toLowerCase().includes("spank")){
- if (user["display-name"] !== "LewdBot__"){
- client.say("Lacrimosaangel", "oooh are we spanking people today? Can I join in on the fun " +user["display-name"] + "? LacriPlease ")
- }}
- });
- client.on("ban", function (channel, username, reason) {
- client.say("Lacrimosaangel", "User: " + user[display-name] + " - has been banned.")
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement