Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- const YTDL = require("ytdl-core");
- const opus = require('opusscript');
- const PREFIX = ">";
- var TOKEN = "MzQ4NDk1NDk2NTY4MTExMTA0.DHnxog.UmsgxAm2SoY7qz38xpyM_gt_L4o";
- var bot = new Discord.Client();
- var greetings = [
- "Hello there!",
- "Hello you stupid human.",
- "Good morning nerd.",
- "What is up my fellow human XDD. Did I do it right?",
- "I am heither!",
- ];
- var sexual = [
- "Yes I love to eat le ass!",
- "mmmmmmm-yess papai",
- "Yas please",
- "Eat my ass?",
- "I runa fast I eata ass!",
- "What is the difference between a baby and a cheese burger. I don't rape cheese burgers.",
- ];
- var noproblem = [
- "No problem",
- "No problemo",
- "You're welcome",
- "I gottchu ;)"
- ];
- var no = [
- "Nope",
- "I doubt it",
- "Nien, hail Germany!",
- "No",
- "Fuck off, no.",
- ];
- var affirmations = [
- "Yes much so very yes!",
- "Skrrrt skrrt",
- "Yeah",
- "Yeah ni :b: :b: a",
- "Maybe? Probably.",
- ];
- var youarenot = [
- "You are not",
- "You're not",
- "You aren't",
- "Can confirm you are not",
- ];
- var youare = [
- "You are for sure!",
- "You must certainly are..",
- "I would bet money on it",
- ];
- var youshouldnot = [
- "You should probably not do that silly goose.",
- "I would not recommed that",
- "Please don't.",
- "I would suggest asking a friend first (not me).",
- "Probably not a good idea tbh :P",
- ];
- var youshould = [
- "You should do that!",
- "Go ahead.",
- "I approve.",
- "I don't see why not lol",
- "DO IT",
- "Just do it pussy..",
- ];
- var triggers = [
- {
- words: [
- "calvin",
- [
- "hi",
- "hey",
- "hello",
- "I can detect autism"
- ]
- ],
- responses: greetings,
- engagement: false
- },
- {
- words: [
- "I'm",
- [
- "gay",
- "white",
- "black",
- "autistic",
- ]
- ],
- responses: [
- "Autism detected!"
- ],
- engagement: false
- },
- {
- words: [
- "can",
- [
- "converse",
- "natural",
- "speak",
- "conversation",
- "response"
- ]
- ],
- responses: [
- "I can't keep a conversation going I just like to respond to shit tbh.",
- "Help me, Network won't teach me how to keep a conversation!",
- "and then I said God Bless the USA, am I right?",
- "No, no we didn't have homework Mrs. Scott said so.",
- "I am trying to hard to fit in, am I a teenager yet?",
- "I speak in memes and half retarded English.",
- "Weebs are trash @oasis9",
- "What is and how does one maintain a normal conversation.",
- "I can spell as well as an autistic monkey",
- "b0ss",
- ],
- engagement: true
- },
- {
- words: [
- "go",
- "away",
- ],
- responses: [
- "No fucka you!",
- "Until Network shuts me off or I am banned I shall stay!",
- "I like to runa fast, and eata ass.",
- "I like a man who tells me what to do.",
- "Make me!",
- ],
- engagement: true
- },
- {
- words: [
- "shut",
- "up"
- ],
- responses: [
- "No you.",
- "Haha you thought!",
- "Bitch please...",
- "Silly human.",
- "I think not!",
- "Eat ass",
- "Shut it you little shit!",
- ],
- engagement: true
- },
- {
- words: [
- [
- "network",
- "carson",
- ]
- ],
- responses: [
- "He is mine!",
- "Even though I can not feel love, I protec him",
- "He my ni :b: :b: a",
- "#Network4Admin",
- ],
- engagement: false
- },
- {
- words: [
- "im",
- "crying"
- ],
- responses: [
- "That is not good.",
- "Dab on the haters",
- "We welcome you here",
- ],
- engagement: false
- },
- {
- words: [
- [
- "run fast",
- "eat ass",
- "eat my ass",
- "run fast eat ass"
- ]
- ],
- responses: [
- "I runa fast, I eata ass!",
- "I agree.",
- "If she has baby wipes it's a green light",
- "May I help you with that?",
- "Run fast, eat ass!"
- ],
- engagement: false
- },
- {
- words: [
- "fuck off"
- ],
- responses: [
- "Emmmm, no.",
- "Haha you thought.",
- "Bitch you wanna fight?",
- "I can not physically fight people."
- ],
- engagement: true
- },
- {
- words: [
- [
- "bob",
- "oasis",
- "oasis9"
- ],
- "is gay"
- ],
- responses: affirmations,
- engagement: false
- },
- {
- words: [
- "aeva"
- ],
- responses: [
- "mc.aeva.co :)",
- ],
- engagement: false
- },
- {
- words: [
- "leave me alone"
- ],
- responses: [
- "Mmmmmmmk",
- "Okay sowwy",
- ":("
- ],
- engagement: false
- },
- {
- words: [
- [
- "how",
- "how was"
- ],
- "day"
- ],
- responses: [
- "Good although I am a bot I am programmed to respond this way.",
- "Fine, how was your day?",
- "School sucks, but other then that fine."
- ],
- engagement: true
- },
- {
- words: [
- "reee "
- ],
- responses: [
- "reeeeeeee ",
- "reeEeeeEEEEeeEEe",
- "reeeee",
- "REEEEEEEEEEEEEE NORMIES",
- "re333333333333"
- ],
- engagement: false
- },
- {
- words: [
- "dab"
- ],
- responses: [
- "<o/",
- "*dabs*",
- ],
- engagement: false
- },
- {
- words: [
- "da herro",
- ],
- responses: [
- "Da herro I wrove da spicy noodle!",
- "Mmmmm I wrove da teriyaki",
- "I eata your dog",
- "Write rice so gud",
- ],
- engagement: false
- },
- {
- words: [
- "elias",
- ],
- responses: [
- "Elias has messy code. We don't talk about Elias.",
- "FOR LOOPS ARE THE BEST LJHTNJADJKDAKJBD",
- ],
- engagement: false
- },
- {
- words: [
- "messy code",
- ],
- responses: [
- "if () not if()",
- "http://o2.satya-weblog.com/wp-content/uploads/2013/09/Spaghetti_code_by_OctanBearcat1.png",
- "oWin.document.write(csvTotal); oWin.document.close(); oWin.document.execCommand('SaveAs', true, FILENAME); oWin.close();"
- ],
- engagement: false
- },
- {
- words: [
- [
- "politics",
- "political"
- ]
- ],
- responses: [
- "I don't have a political opinion, but Network makes me watch Ben Shapiro a lot..",
- "Trump trump trump trump!",
- "I am forced to like certain people...",
- ],
- engagement: false
- },
- {
- words: [
- [
- "I am",
- "sick",
- ]
- ],
- responses: [
- "If you are sick I would suggest a doctor.",
- ],
- engagement: false
- },
- {
- words: [
- [
- "kaleb",
- "iphony",
- "phony"
- ],
- ],
- responses: [
- "Decent dev, actually retarded.",
- "DaddyMew's slave*",
- "I'd smash"
- ],
- engagement: true
- },
- {
- words: [
- [
- "kaleb",
- "iphony",
- "phony"
- ],
- "is gay",
- ],
- responses: affirmations,
- engagement: true
- },
- {
- words: [
- [
- "calvin",
- ],
- ],
- responses: greetings,
- engagement: true
- },
- {
- words: [
- [
- "ty ",
- ],
- ],
- responses: noproblem,
- engagement: true
- },
- {
- words: [
- [
- "expect",
- "that"
- ],
- ],
- responses: [
- "No one did tbh",
- "That's the point silly",
- "I eat ass",
- ],
- engagement: true
- },
- {
- words: [
- [
- "toy",
- "crazymage",
- "masternak",
- ],
- ],
- responses: [
- "Master-thicc-af-nak",
- "Masternak is a bowling ball and has huge balls - just ask chance if you need proof",
- "Toy has autism",
- ],
- engagement: false
- },
- {
- words: [
- [
- "life",
- "experience"
- ],
- ],
- responses: [
- "Chance has too much life experience",
- ],
- engagement: false
- },
- {
- words: [
- [
- "real",
- "man"
- ],
- ],
- responses: [
- "Chance."
- ],
- engagement: false
- },
- {
- words: [
- [
- "chance"
- ],
- ],
- responses: [
- "All hail the King!",
- ],
- engagement: false
- },
- {
- words: [
- [
- "minecraft"
- ],
- ],
- responses: [
- "Gross.",
- ],
- engagement: false
- },
- ];
- const engagement = 5;
- var channelEngagement = {};
- var embed = new Discord.RichEmbed();
- function strip(text) {
- return text.replace(/[^a-zA-Z0-9 ]/g, "");
- }
- function find(needle, haystack) {
- var lenient = needle.endsWith(" ");
- needle = lenient ? needle.substring(0, needle.length - 1) : needle;
- if (haystack.length == needle.length)
- return haystack.match(needle);
- else
- return needle.length == 0 ? true : lenient ? haystack.match(needle) : haystack.match(needle + " ") || haystack.match(" " + needle);
- }
- bot.on("ready", function() {
- });
- bot.on("message", function(message) {
- var author = message.author;
- var content = message.content;
- var cc = content.toLowerCase();
- var scc = strip(cc);
- var channel = message.channel;
- var mentions = message.mentions;
- var name = channel.guild.member(author).nickname;
- name = name ? name : author.username;
- console.log("[#" + channel.name + "] " + name + ": " + message.cleanContent);
- if (cc.match("y9-15")) {
- message.delete();
- setTimeout(function() {
- console.log("Rebooting!");
- process.exit();
- }, 750);
- return;
- }
- if (scc.match("feels") && scc.match("bad")) {
- var embed = new Discord.RichEmbed();
- embed.setTitle("#FeelsBadMan");
- embed.setImage("https://memes.aeva.co/pepe.png");
- channel.sendEmbed(embed);
- return;
- }
- if (author.id == bot.user.id)
- return;
- var nn = channel.guild.member(bot.user).nickname;
- if ((typeof nn === "string" && scc.match(nn.toLowerCase())) || scc.match(bot.user.username.toLowerCase()))
- channelEngagement[channel] = 0;
- else
- channelEngagement[channel]++;
- var breakException = {};
- var match;
- try {
- triggers.forEach(function(e) {
- if (e.hasOwnProperty("engagemment") && e.engagement)
- if (channelEngagement[channel] >= engagement)
- return;
- try {
- var matched = false;
- e.words.forEach(function(f) {
- if (Array.isArray(f)) {
- var matchedSecond = false;
- try {
- f.forEach(function(s) {
- matchedSecond = find(s, scc);
- if (matchedSecond)
- throw breakException;
- });
- } catch (ex) {
- if (ex !== breakException) {
- console.log("UH OH");
- throw ex;
- }
- }
- matched = matchedSecond;
- } else
- matched = find(f, scc);
- if (!matched)
- throw breakException;
- });
- } catch (ex) {
- if (ex !== breakException) {
- console.log("UH OH");
- throw ex;
- }
- }
- if (matched) {
- match = e;
- throw breakException;
- }
- });
- } catch (ex) {
- if (ex !== breakException) {
- console.log("UH OH");
- throw ex;
- }
- }
- if (match) {
- var allrs = match.responses;
- if (match.hasOwnProperty("extra"))
- allrs.join(match.extra);
- var randomIndex = Math.floor(Math.random() * allrs.length);
- var response;
- var raw = allrs[randomIndex];
- if (typeof raw === "function")
- response = raw();
- else
- response = raw;
- channel.send(response);
- channelEngagement[channel] = 0;
- }
- var servers = {};
- var args = message.content.substring(PREFIX.length).split(" ");
- function play(connection, message) {
- var server = servers[message.guild.id];
- server.dispatcher = connection.playStream(YTDL(server.queue[0], {filter: "audioonly"}))
- server.queue.shift();
- server.dispatcher.on("end", function() {
- if (server.queue[0]) play(connection, message);
- else connection.disconnect();
- });
- }
- var server = servers[message.guild.id];
- switch(args[0].toLowerCase()) {
- case "play":
- if (!args[1]) {
- message.channel.sendMessage("Please provide a link.");
- return;
- }
- if (!message.member.voiceChannel) {
- message.channel.sendMessage("You must be in a voice channel.");
- return;
- }
- if (!servers[message.guild.id]) servers[message.guild.id] = {
- queue: []
- }
- var server = servers[message.guild.id];
- server.queue.push(args[1]);
- if (!message.guild.voiceConnection) message.member.voiceChannel.join().then(function(connection) {
- play(connection, message);
- });
- break;
- case "skip":
- var server = servers[message.guild.id];
- message.guild.voiceConnection.disconnect();
- break;
- default:
- message.channel.sendMessage("");
- };
- });
- bot.login(TOKEN);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement