Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const mysql = require("mysql");
- const botSettings = require("./botSettings.json");
- const Discord = require("discord.js");
- const prefix = botSettings.prefix;
- const fs = require("fs");
- var osutils = require("./node_modules/os-utils");
- var cpustat = require("./node_modules/cpu-stat");
- const urban = module.require("urban");
- var os = require("os");
- var cpu = osutils.cpu;
- function getRandomInt(max) {
- return Math.floor(Math.random() * Math.floor(max));
- }
- const bot = new Discord.Client({ disableEveryone: true });
- bot.commands = new Discord.Collection();
- bot.on("ready", async () => {
- console.log(bot.commands);
- bot.generateInvite(["ADMINISTRATOR"]).then(link => {
- console.log(link);
- }).catch(err => {
- console.log(err.stack);
- });
- await bot.generateInvite(["ADMINISTRATOR"]);
- bot.user.setActivity(`Whenever Blazy is ${botSettings.sanity} you see this game`);
- });
- var connected = 0;
- var con = mysql.createConnection({
- host: "localhost",
- user: "root",
- password: "**I WILL NOT PUT THE PASSWORD IN A PUBLIC PASTEBIN**",
- database: "botxp"
- });
- con.connect(err => {
- if (err) throw err;
- console.log("connected to database");
- connected = 1;
- });
- bot.on('message', async message => {
- if (message.author.bot) return;
- if (message.channel.type === "dm") return;
- con.query(`SELECT * FROM xp WHERE id = '${message.author.id}'`, (err, rows) => {
- if (err) throw err;
- let sql;
- if (rows.length < 1) {
- sql = `INSERT INTO xp (id, xp) VALUES ('${message.author.id}', 1)`
- }
- else {
- let xp = rows[0].xp;
- sql = `UPDATE xp SET xp = ${xp + 1} WHERE id = '${message.author.id}'`;
- }
- con.query(sql);
- });
- let messageArray = message.content.split(" ");
- let command = messageArray[0];
- let var1 = messageArray[1];
- let var2 = messageArray[2];
- let args = messageArray.slice(1);
- let mentions = message.mentions.users.first();
- if (message.content) {
- console.log(`${message.author.username}: ${message.content}`);
- }
- if (command === `${prefix}ping`) {
- var kapi = getRandomInt(4);
- if (kapi === 0)
- message.channel.send('fock');
- if (kapi === 1)
- message.channel.send('NO');
- if (kapi === 2)
- message.channel.send('No, this is Patrik!');
- if (kapi === 3)
- message.channel.send('Nobody here');
- }
- if (command === `OwO` || command === `owo`) {
- message.channel.send('**Kill it with fire**');
- }
- if (/(?:https?:\/)?discord(?:app.com\/invite|.gg)/gi.test(message.content)) {
- message.delete();
- message.channel.send("This type of link is not allowed!");
- }
- if (/(?:https?:\/)?selly(?:.gg)/gi.test(message.content)) {
- message.delete();
- message.channel.send("This type of link is not allowed!");
- }
- if (command === `${prefix}resolver`) {
- var chance = getRandomInt(10001);
- console.log(`Someone used the resolver command, got the number ${chance}`)
- if (chance === 0)
- message.channel.send("Don't tell anyone, but it's https://pastebin.com/02nB4Fie");
- else message.channel.send("void Resolver() { //removed for antipasta}");
- }
- if (command == `${prefix}8ball`) {
- var blob = getRandomInt(2);
- if (blob === 0) {
- console.log("Someone used 8ball, got a No response.");
- var joy = getRandomInt(3);
- if (joy === 0)
- message.channel.send('Nope');
- if (joy === 1)
- message.channel.send('Not in a million years!');
- if (joy === 2)
- message.channel.send('I hate to break it to you...but NO!');
- }
- if (blob === 1) {
- console.log("Someone used 8ball, got a Yes response.");
- var sob = getRandomInt(3);
- if (sob === 0)
- message.channel.send('Hell yea!');
- if (sob === 1)
- message.channel.send('Duh!');
- if (sob === 2)
- message.channel.send('Ye m8 ;)');
- }
- }
- if (command === `${prefix}roll`) {
- var roll = getRandomInt(6)
- if (roll === 0)
- message.channel.send('Rolled 1..bad luck m8');
- if (roll === 1)
- message.channel.send('Rolled 2..nothing good here');
- if (roll === 2)
- message.channel.send('Rolled 3..better luck next time');
- if (roll === 3)
- message.channel.send('Rolled 4..hittin p? almost');
- if (roll === 4)
- message.channel.send('Rolled 5..lucky af');
- if (roll === 5)
- message.channel.send('Rolled 6..p100');
- }
- if (command === `${prefix}info`) {
- var thot = getRandomInt(8)
- let p100embed = new Discord.RichEmbed()
- .setAuthor(message.author.username)
- if (thot === 0)
- p100embed.setDescription(`"The problem with quotes from the internet is that they are often not true." - Abraham Lincoln`);
- if (thot === 1)
- p100embed.setDescription(`"Bitches ain't shit but hoes and tricks." - Gandhi`);
- if (thot === 2)
- p100embed.setDescription(`"Idk, info machine :b:roke." - Kapi Wulon`);
- if (thot === 3)
- p100embed.setDescription(`"Two things are infinite; the Universe and the Winrar 40 day trial, I'm not sure about the Universe." - Albert Einstein`);
- if (thot === 4)
- p100embed.setDescription(`"Behind every great man there stands a great woman. Behind every great woman is a great behind." - Bill Clinton `);
- if (thot === 5)
- p100embed.setDescription(`"I don't drink water because this is where fish reproduce. Miss me with that gay shit niBBa" - Steve Jobs`);
- if (thot === 6)
- p100embed.setDescription(`"you and your father dead in graveyard" - Neveu`);
- if (thot === 7)
- p100embed.setDescription(`"Can I put AimTux in Visual Studio?" - Mark Zuckerberg`);
- console.log("Someone used the info command");
- message.channel.send(p100embed);
- }
- if (command === `${prefix}flame`) {
- var oof = getRandomInt(10)
- if (oof === 0)
- message.channel.send('Bark more slum dogs');
- if (oof === 1)
- message.channel.send('Mad?');
- if (oof === 2)
- message.channel.send('1');
- if (oof === 3)
- message.channel.send('Nice baim u sell?');
- if (oof === 4)
- message.channel.send('Hit head due to spread?');
- if (oof === 5)
- message.channel.send('Raging irl');
- if (oof === 6)
- message.channel.send('Nice afghanistan.cc');
- if (oof === 7)
- message.channel.send('Pelvis fix p100?');
- if (oof === 8)
- message.channel.send('**NO U**');
- if (oof === 9)
- message.channel.send('Are you using AimJunkies? xdd');
- }
- if (command === `oof`) {
- message.channel.send("Get oof`d");
- }
- if (command === `nhu`) {
- message.channel.send("Ba dha!");
- }
- if (command === `${prefix}kapi`) {
- console.log("Someone used the kapi command rawr xD");
- message.channel.send(`<:Bitcoin:419149329866162206> + <:kapithinker:419080441165905940> = :spy: :money_with_wings: quick maths`);
- }
- if (command === `${prefix}rzbd`) {
- message.channel.send(":sob:<:angery:419080639623593985>");
- }
- if (command === `thu`) {
- message.channel.send("Ehu?! Nhu!");
- }
- if (command === "bleizi" || command === "Bleizi") {
- if (var1 === "rau" || var1 === "rhau" || var1 === "Rau" || var1 === "Rhau") {
- console.log("Somebody called Blazy bad!");
- message.channel.send("thu esti rhau, ochei? OK!");
- }
- if (var1 === "bun" || var1 === "Bun") {
- console.log("Somebody called Blazy good!");
- message.channel.send("Dha!");
- }
- if (var1 === "cyka" || var1 === "Cyka") {
- console.log("Somebody called Blazy cyka!");
- message.channel.send(`${message.author.username} cyka`);
- }
- }
- if (command === "blob") {
- if (var1 === "joy") {
- message.channel.send("<:blobjoy:421755071328681995>");
- }
- }
- if (message.content == "ma-ta" || message.content == "ma ta" || message.content == "mata")
- message.channel.send("m-ata*");
- if (message.content == "Iti iau vurul la futut")
- message.channel.send("**Mai bine te dai batut**");
- if (message.content == "Mai bine te dai batut")
- message.channel.send("**Ling in pizda si dau in gura**");
- if (message.content == "Ling in pizda si dau in gura")
- message.channel.send("**Si imi bag legale-n pula**");
- if (message.content == "Si imi bag legale-n pula")
- message.channel.send("**Mananc Chamo pe paine**");
- if (message.content === `rofl`) {
- console.log("Someone is a kurka proasta");
- message.channel.send(":rofl: esti thu");
- }
- if (command === `${prefix}rand`) {
- var cunt = getRandomInt(var1);
- message.channel.send(`${cunt}`);
- }
- if (command === `${prefix}help`)
- message.channel.send("https://pastebin.com/3mn4ibm5");
- if (message.content == "Rawr" || message.content == "rawr")
- message.channel.send("ecks dee");
- if (message.content == "your mom gay" || message.content == "you're mom gay" || message.content == "ur mom gay" || message.content == "u r mom gay")
- message.channel.send("no u");
- if (command === `${prefix}feed`) {
- if (var1 === "romica") {
- message.channel.send("<:dramaaaa:411315295546769408>");
- }
- else {
- message.channel.send(`:baby_bottle: ${args}`);
- }
- }
- if (command === `${prefix}flag`) {
- if (var1) {
- console.log(`${message.author.username} reported ${var1}`)
- }
- else message.channel.send("Please enter the username of the person you want to report");
- }
- if (command === `${prefix}insanity`) {
- message.channel.send("<:luAaaa:414852437833285642>");
- }
- if (command === `${prefix}scan`) {
- var thot = getRandomInt(7)
- let scanned = message.mentions.users.first() || message.guild.members.get(args[1]) || message.author;
- let p300embed = new Discord.RichEmbed()
- p300embed.setAuthor(`${scanned.username}`)
- p300embed.setDescription(`Avatar: ${scanned.avatarURL}`);
- p300embed.setThumbnail(`${scanned.avatarURL }`);
- console.log(`Someone scanned ${scanned.username}`);
- message.channel.send(p300embed);
- }
- if (command === `${prefix}muteuser`) {
- if (!message.member.hasPermissions("MUTE_MEMBERS")) return message.channel.send("You need Admin privileges to use this command!");
- let mentionsmute = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
- if (!mentionsmute) return message.channel.send("Please specify a user to mute!");
- let role = message.guild.roles.find(r => r.name === "Intern Muted");
- if (!role) {
- try {
- role = message.guild.createRole({
- name: "Intern Muted",
- color: "#000000",
- permissions: []
- });
- message.guild.channels.forEach(async (channel, id) => {
- await channel.overwritePermissions(role, {
- SEND_MESSAGES: false,
- ADD_REACTIONS: false
- });
- });
- } catch (e) {
- console.log(e.stack);
- }
- }
- if (mentionsmute.roles.has(role.id)) return message.channel.send("This user is already muted!");
- if (mentionsmute.id === message.author.id) return message.channel.send("You can't mute yourself!");
- if (mentionsmute.highestRole.position >= message.member.highestRole) return message.channel.send("You can't mute someone with higher or equal permissions as you!");
- await (mentionsmute.addRole(role));
- message.channel.send("I have muted them!");
- }
- if (command === `${prefix}unmuteuser`) {
- if (!message.member.hasPermissions("MUTE_MEMBERS")) return message.channel.send("You need Admin privileges to use this command!");
- let mentionsunmute = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
- if (!mentionsunmute) return message.channel.send("Please specify a user to unmute!");
- let role = message.guild.roles.find(r => r.name === "Intern Muted");
- if (!role || !mentionsunmute.roles.has(role.id)) return message.channel.send("This user is not muted!");
- await (mentionsunmute.removeRole(role));
- message.channel.send("I have unmuted them!");
- }
- if (command === `${prefix}xp`) {
- let target = message.mentions.users.first() || message.guild.members.get(args[1]) || message.author;
- con.query(`SELECT * FROM xp WHERE id = '${target.id}'`, (err, rows) => {
- if (err) throw err;
- if (!rows[0]) message.channel.send("This user has no XP :(");
- let xp = rows[0].xp;
- var level = Math.round(xp / 100);
- let rawricsde = new Discord.RichEmbed();
- rawricsde.setAuthor(`${target.username}'s Stats`);
- rawricsde.addField("Level", `${level}`);
- rawricsde.addField("XP", `${xp}`);
- rawricsde.setThumbnail(`${target.avatarURL}`);
- message.channel.send(rawricsde);
- });
- }
- if (command === `${prefix}stats`) {
- osutils.cpuUsage(cpuscan => {
- var cpusage = Math.round(cpuscan * 100);
- let statsembed = new Discord.RichEmbed()
- statsembed.setAuthor("Performance Stats");
- if (cpusage > 75) {
- statsembed.addField("CPU Usage", `${cpusage}% :rage:`, true);
- }
- else statsembed.addField("CPU Usage", `${cpusage}% :ok_hand:`, true);
- statsembed.addField("CPU ClockSpeed", `${cpustat.avgClockMHz()} MHZ`, true);
- statsembed.addField("CPU Core Count", `${osutils.cpuCount()}`, true);
- statsembed.addField("Memory Usage", `${Math.round(osutils.totalmem() - osutils.freemem())} MB / ${Math.round(osutils.totalmem())} MB`, true);
- statsembed.addField("Discord.js version", `${Discord.version}`, true);
- if (connected = 0) {
- statsembed.addField("Connected to MySQL database", `No`, true);
- }
- else statsembed.addField("Connected to MySQL database", `Yes`, true);
- message.channel.send(statsembed);
- });
- }
- if (command === `${prefix}urban`)
- {
- if (args.length < 1) return message.channel.send("Please Enter Something");
- let str = args.join(" ");
- urban(str).first(json => {
- if (!json) return message.channel.send("No results found!");
- let embedurban = new Discord.RichEmbed()
- .setTitle(json.word)
- .setDescription(json.definition)
- .addField("Upvotes", json.thumbs_up, true)
- .addField("Downvotes", json.thumbs_down, true)
- .setFooter(`Written by ${json.author}`);
- message.channel.send(embedurban);
- });
- }
- if (command === `dha`)
- {
- message.channel.send("Ba nhu!");
- }
- if (command === `${prefix}randomurban`) {
- urban.random().first(json => {
- let randomembed = new Discord.RichEmbed()
- .setTitle(json.word)
- .setDescription(json.definition)
- .addField("Upvotes", json.thumbs_up, true)
- .addField("Downvotes", json.thumbs_down, true)
- .setFooter(`Written by ${json.author}`);
- message.channel.send(randomembed);
- });
- }
- if (message.content == `let the bass kick`)
- {
- message.channel.send("O-oooooooooo AAAAE-A-A-I-A-U- JO-oooooooooooo AAE-O-A-A-U-U-A- E-eee-ee-eee AAAAE-A-E-I-E-A- JO-ooo-oo-oo-oo EEEEO-A-AAA-AAAA");
- }
- if (message.content == "rekai cringe" || message.content == "Chamo cringe" || message.content == "Rekai cringe" || message.content == "chamo cringe")
- {
- message.channel.send("Adev");
- }
- });
- bot.login(botSettings.token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement