Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let Discord = require("discord.js");
- let bot = new Discord.Client();
- let config = require('./config.json');
- var fs = require('fs');
- var sbl = require('./blacklist.json');
- var chalk = require('chalk');
- function AaN(args, i) {
- if (args[i] === null || args[i] === "" || args[i] === undefined) return true;
- return false;
- }
- bot.on('ready', () => {
- bot.user.setStatus("invisible")
- console.log(`Logged in as ${bot.user.username}#${bot.user.discriminator}`);
- console.log(`${bot.user.username}#${bot.user.discriminator}, your selfbot is online and ready to rock and roll!`)
- console.log(`${bot.user.username}#${bot.user.discriminator}, you're on ${bot.guilds.size} servers with ${bot.channels.size} channels and with ${bot.users.size} users.`)
- });
- function getTime() {
- var currentTime = new Date();
- var n = currentTime.toTimeString();
- var str = n.substring(0, n.indexOf(' '));
- return str;
- }
- bot.on('message', msg => {
- var time = getTime();
- if (msg.channel.type === "dm") {
- console.log(chalk.red("[" + time + "]" + " [PM] " + msg.author.username + " : " + msg.content));
- }
- if (msg.channel.type === "text") {
- console.log(chalk.blue('[ ' + time + ' ]' + ' { -> message: ' + msg.content + ' - User: ' + msg.author.username + ' - Discriminator : ' + msg.author.discriminator + ' Channel - ' + msg.channel.name + ' - Server - ' + msg.guild.name + ' <- }'))
- }
- if (!msg.content.startsWith(config.prefix)) return;
- prefix = config.prefix;
- channel = msg.channel;
- guild = msg.guild;
- text = msg.content;
- args = text.split(" ");
- command = text.substring(prefix.length, args[0].length)
- .toLowerCase();
- let color = parseInt("0x" + Math.floor(Math.random() * 16777215)
- .toString(16));
- // const webhook = new Discord.WebhookClient('webhook id', 'webhook token');
- // webhook.sendMessage('hi')
- if ((msg.isMentioned(bot.user.id) || msg.mentions.everyone || (msg.guild && msg.mentions.roles.filter(r => msg.guild.member(bot.user.id).roles.has(r.id)).size > 0) || msg.content.toLowerCase().includes("akoob"))) {
- const webhook = new Discord.WebhookClient('275837448414822403', 's7oepbFHtTiMXsCN20t4RyYtQAji7Z-2OhSSplKuFMdg3NGbYmfnvENNHC0RFkCDZeOL');
- msg.channel.fetchMessages({ limit: 5, before: msg.id }).then((m) => {
- const context = m.map(msg => `**${msg.author.username}** || ${msg.content}`).reverse().join("\n");
- webhook.sendSlackMessage({
- attachments: [
- {
- pretext: "New mention has been detected",
- color: color,
- author_name: `${msg.member.nickname || msg.author.username} (${msg.author.id})`,
- author_icon: msg.author.avatarURL,
- fields: [
- {
- title: "Mentioned Message",
- value: msg.cleanContent,
- },
- {
- title: "Context Messages",
- value: context,
- },
- ],
- footer: `${msg.guild.name} #${msg.channel.name}`,
- footer_icon: msg.guild.iconURL,
- },
- ],
- });
- });
- }
- if (msg.author.id !== bot.user.id) return;
- if (command == "ping") {
- msg.delete()
- startTime = Date.now();
- channel.sendMessage("Pinging...")
- .then((msg) => {
- endTime = Date.now();
- msg.edit("Pong **=>** *" + Math.round(endTime - startTime) + "* ms");
- });
- }
- if (command == "purge") {
- var amount = parseInt(args[1]);
- channel.fetchMessages({
- limit: amount
- })
- .then(messages => {
- messages.map(msg => msg.delete()
- .catch(console.error));
- })
- .catch(console.error);
- return;
- } else if (command == "prune") {
- let delamount = parseInt(args[1]) ? parseInt(args[1]) : 1;
- channel.fetchMessages({
- limit: 100
- })
- .then(messages => {
- msgar = messages.array();
- msgar = msgar.filter(msg => msg.author.id === bot.user.id);
- msgar.length = delamount + 1;
- msgar.map(msg => msg.delete()
- .catch(console.error));
- });
- }
- if (command == "p") {
- const user = msg.mentions.users.first();
- const amount = !!parseInt(msg.content.split(" ")[1]) ? parseInt(msg.content.split(" ")[2]) : parseInt(msg.content.split(" ")[1])
- if (!amount) return channel.send("How many message do you want me to delete?");
- if (!amount && !user) return channel.send("Specify a user and amount, or just an amount, of messages to purge.");
- msg.channel.fetchMessages({
- limit: amount,
- }).then((messages) => {
- if (user) {
- const filterBy = user ? user.id : bot.user.id;
- messages = messages.filter(m => m.author.id === filterBy).array().slice(0, amount);
- }
- msg.channel.bulkDelete(messages).catch(error => console.log(error.stack));
- });
- }
- if (command == "restart") {
- channel.sendMessage("Are you sure that you want to restart your selfbot? If so, say yes. If you don't want to leave don't say anything.")
- .then(() => {
- channel.awaitMessages(response => response.content === "yes", {
- max: 1
- , time: 30000
- , errors: ['time']
- , })
- .then((collected) => {
- channel.sendMessage(`Restarting in 5 seconds.`);
- setTimeout(function() {
- process.exit();
- }, 5000)
- })
- .catch(() => {
- channel.sendMessage("No response given, I will not restart.");
- });
- });
- }
- if (command == "block") {
- let toblock = msg.mentions.users.first()
- if (!toblock) {
- return channel.sendMessage("I need a mention.")
- }
- toblock.block()
- channel.sendMessage("Alright I have blocked " + toblock.username);
- }
- if (command == "unblock") {
- let tounblock = msg.mentions.users.first()
- if (!tounblock) {
- return channel.sendMessage("I need a mention.")
- }
- tounblock.unblock()
- channel.sendMessage("Alright I have unblocked " + tounblock.username);
- }
- if (command == "kys") {
- msg.delete();
- channel.sendMessage("kys")
- .then(mesg => {
- mesg.edit(`:eyes:`)
- .catch(console.error);
- })
- .catch(console.error);
- }
- if (command == "permission") {
- channel.sendMessage('Your permissions are:\n' +
- JSON.stringify(channel.permissionsFor(msg.author)
- .serialize(), null, 4));
- }
- if (command == "friend") {
- let user = msg.mentions.users.first()
- user.addFriend()
- channel.sendMessage("Alright, I've added " + user.username + " as Friend.");
- }
- if (command == "uptime") {
- function calcUptime() {
- var time = 0;
- var days = 0;
- var hrs = 0;
- var min = 0;
- var sec = 0;
- var temp = Math.floor(bot.uptime / 1000);
- sec = temp % 60;
- temp = Math.floor(temp / 60);
- min = temp % 60;
- temp = Math.floor(temp / 60);
- hrs = temp % 24;
- temp = Math.floor(temp / 24);
- days = temp;
- var dayText = " Days, ";
- if (days == 1) {
- dayText = " Days, ";
- }
- const upText = "Selfbot Uptime | " + days +
- dayText +
- hrs + " Hours" +
- ", " + min + " Minutes, " +
- sec + " Seconds ";
- return upText;
- }
- channel.sendMessage(calcUptime())
- }
- if (command == "eval") {
- if (msg.content.includes("bot") && msg.content.includes("token")) {
- return channel.sendMessage("**=>** MjMwNjA2NzE2NjM3NTQ0NDQ4.Cs0R8A.bLq8E-OjigH16M24yKxNHjMl8e4");
- }
- try {
- let code = eval(msg.content.split(" ")
- .slice(1)
- .join(" "));
- channel.sendMessage("**=>** " + code);
- } catch (err) {
- channel.sendMessage("**=>** " + err);
- }
- return;
- }
- if (command == "exec"){
- const exec = require("child_process").exec;
- let code = exec(msg.content.split(" ")
- .slice(1)
- .join(" "));
- exec(code, (e, out, err) => {
- if (out) {
- msg.channel.sendMessage(`\`OUTPUT\` \`\`\`xl\n${
- bot.funcs.clean(bot, out)
- }\n\`\`\``);
- }
- if (err) {
- msg.channel.sendMessage(`\`ERROR\` \`\`\`xl\n${
- bot.funcs.clean(bot, err)
- }\n\`\`\``);
- }
- });
- }
- if (command == "kick") {
- var kick = msg.guild.member(msg.mentions.users.first());
- if (!kick) {
- return channel.sendMessage("I need a mention.")
- }
- kick.kick()
- .then(() => {
- channel.sendMessage("Alright I've kicked that user.")
- })
- }
- if (command == "ban") {
- var ban = msg.guild.member(msg.mentions.users.first());
- if (!ban) {
- return channel.sendMessage("I need a mention.")
- }
- ban.ban()
- .then(() => {
- channel.sendMessage("Alright I've banned that user.")
- })
- }
- if (command == "lenny") {
- msg.edit('( ͡° ͜ʖ ͡°)')
- }
- if (command == "vkick") {
- let user = msg.mentions.users.first();
- if (!user) {
- return channel.sendMessage("You need to mention a user!")
- }
- let kickMention = msg.guild.members.get(user.id);
- if (kickMention) {
- if (!kickMention.voiceChannel) {
- channel.sendMessage(`**${user.username}** isn't in a voice channel.`);
- } else {
- msg.guild.createChannel(`kick`, `voice`)
- .then(channel => {
- setTimeout(() => {
- kickMention.setVoiceChannel(channel);
- }, 1000)
- setTimeout(() => {
- channel.sendMessage(`Successfully kicked **${user.username}** from the voice channel.`);
- channel.delete()
- }, 1500)
- })
- .catch((error) => {
- channel.sendMessage(`I couldn't kick **${user.username}** from the voice channel.`);
- })
- }
- }
- }
- if(command == "cprefix"){
- msg.edit('Current prefix is' + config.prefix)
- }
- if (command == "vmove") {
- let user = msg.mentions.users.first();
- if (!user) {
- return channel.sendMessage("You need to mention a user!")
- }
- let vmoveMention = msg.guild.members.get(user.id);
- if (vmoveMention) {
- if (!vmoveMention.voiceChannel) {
- channel.sendMessage(`**${user.username}** isn't in a voice channel.`);
- } else {
- a
- msg.guild.createChannel(`kick`, `voice`)
- .then(channel => {
- setTimeout(() => {
- vmoveMention.setVoiceChannel(channel);
- }, 1000)
- setTimeout(() => {
- channel.sendMessage(`Successfully kicked **${user.username}** from the voice channel.`);
- channel.delete()
- }, 1500)
- })
- .catch((error) => {
- channel.sendMessage(`I couldn't kick **${user.username}** from the voice channel.`);
- })
- }
- }
- }
- if (command == "e") {
- msg.delete();
- channel.sendFile('https://cdn.discordapp.com/attachments/243687135138414592/274042472030797824/ezgif.com-gif-maker.png')
- }
- if (command == "leave") {
- channel.sendMessage("Please confirm that you want to leave this server. If so, say yes. If you don't want to leave don't say anything.")
- .then(() => {
- channel.awaitMessages(response => response.content === "yes", {
- max: 1
- , time: 30000
- , errors: ['time']
- , })
- .then((collected) => {
- channel.sendMessage(`I will leave **${guild.name}** in 5 seconds.`);
- setTimeout(function() {
- guild.leave();
- }, 5000)
- })
- .catch(() => {
- channel.sendMessage("No response given, I will not leave this guild.");
- });
- });
- }
- if (command == "dance") {
- setTimeout(function() {
- msg.edit("`> (°□°)>`")
- }, 1000)
- setTimeout(function() {
- msg.edit("`^ (°□°)^`")
- }, 3000)
- setTimeout(function() {
- msg.edit("`< (°□°)<`")
- }, 5000)
- setTimeout(function() {
- msg.edit("`> (°□°)>`")
- }, 7000)
- setTimeout(function() {
- msg.edit("`^ (°□°)^`")
- }, 9000)
- setTimeout(function() {
- msg.edit("`> (°□°)>`")
- }, 11000)
- }
- if (command == "ev") {
- msg.delete();
- if (msg.content.includes("bot") && msg.content.includes("token")) {
- return channel.sendMessage("", {embed: {
- color: color,
- title: "Evaluate Javascript Complete!",
- description: "Evaluation complete!",
- author: {
- name: bot.user.username,
- icon_url: bot.user.avatarURL
- },
- thumbnail: {
- url: bot.user.avatarURL
- },
- fields: [
- {
- name: "**Input**",
- value: "```js\n" + "bot.token" + "```"
- },
- {
- name: "**Output**",
- value: "```js\n" + "MjMwNjA2NzE2NjM3NTQ0NDQ4.Cs0R8A.bLq8E-OjigH16M24yKxNHjMl8e4" + "```"
- }
- ]
- }})
- }
- try {
- let com = eval(msg.content.split(" ").slice(1).join(" "));
- let com2 = msg.content.split(" ").slice(1).join(" ");
- if (!com) return channel.sendMessage("Include some code? o_O")
- channel.sendMessage("", {embed: {
- color: color,
- title: "Evaluate Javascript Complete!",
- description: "Evaluation complete!",
- author: {
- name: bot.user.username,
- icon_url: bot.user.avatarURL
- },
- thumbnail: {
- url: bot.user.avatarURL
- },
- fields: [
- {
- name: "**Input**",
- value: "```js\n" + com2 + "```"
- },
- {
- name: "**Output**",
- value: "```js\n" + com + "```"
- }
- ]
- }})
- } catch (e) {
- channel.sendMessage("", {embed: {
- color: color,
- title: "Code Error!",
- description: "There was a error in your code!",
- author: {
- name: bot.user.username,
- icon_url: bot.user.avatarURL
- },
- thumbnail: {
- url: bot.user.avatarURL
- },
- fields: [
- {
- name: "**Error**",
- value: "```js\n" + e + "```"
- }
- ]
- }})
- }
- }
- if (command == "serverinfo") {
- if (msg.guild.emojis.size <= 0) {
- channel.sendMessage("", {embed: {
- color: color,
- title: msg.guild.name + " [" + msg.guild.id + "]",
- author: {
- name: msg.guild.name,
- icon_url: msg.guild.iconURL
- },
- thumbnail: {
- url: msg.guild.iconURL
- },
- fields: [
- {
- name: "Member Count",
- value: guild.memberCount,
- inline: true
- },
- {
- name: "Channel Count",
- value: guild.channels.size,
- inline: true
- },
- {
- name: "Guild Owner",
- value: msg.guild.owner.user.username,
- inline: true
- },
- {
- name: "Date Created",
- value: msg.guild.createdAt.toLocaleString(),
- inline: true
- },
- {
- name: "Role Count",
- value: msg.guild.roles.size,
- inline: true
- },
- {
- name: "Emote Count",
- value: msg.guild.emojis.size,
- inline: true
- },
- {
- name: "Emotes",
- value: "Add some",
- inline: true
- },
- {
- name: "Default Channel",
- value: msg.guild.defaultChannel.name,
- inline: true
- },
- {
- name: "Server Region",
- value: msg.guild.region.toUpperCase(),
- inline: true
- },
- {
- name: "AFK Timeout",
- value: msg.guild.afkTimeout + " seconds",
- inline: true
- },
- {
- name: "Verification Level",
- value: msg.guild.verificationLevel,
- inline: true
- },
- {
- name: "Guild Icon",
- value: `[Full Icon Here](${msg.guild.iconURL})`,
- inline: true
- },
- {
- name: "Current Date",
- value: new Date().toLocaleString(),
- inline: true
- }
- ],
- timestamp: new Date(),
- footer: {
- icon_url: msg.guild.iconURL,
- text: "At " + msg.guild.createdAt.toLocaleString()
- }
- }})
- } else {
- var msgArray = [];
- msg.guild.emojis.forEach((emote) => {msgArray += emote})
- channel.sendMessage("", {embed: {
- color: color,
- title: msg.guild.name + " [" + msg.guild.id + "]",
- author: {
- name: msg.guild.name,
- icon_url: msg.guild.iconURL
- },
- thumbnail: {
- url: msg.guild.iconURL
- },
- fields: [
- {
- name: "Member size",
- value: guild.memberCount,
- inline: true
- },
- {
- name: "Channel size",
- value: guild.channels.size,
- inline: true
- },
- {
- name: "Server Owner",
- value: msg.guild.owner.user.username,
- inline: true
- },
- {
- name: "Created",
- value: msg.guild.createdAt.toLocaleString(),
- inline: true
- },
- {
- name: "Role size",
- value: msg.guild.roles.size,
- inline: true
- },
- {
- name: "Emojis size",
- value: msg.guild.emojis.size,
- inline: true
- },
- {
- name: "Emojis list:",
- value: msgArray,
- inline: true
- },
- {
- name: "Default Channel",
- value: msg.guild.defaultChannel.name,
- inline: true
- },
- {
- name: "Region",
- value: msg.guild.region.toUpperCase(),
- inline: true
- },
- {
- name: "AFK Timeout",
- value: msg.guild.afkTimeout + " seconds",
- inline: true
- },
- {
- name: "Verification Level",
- value: msg.guild.verificationLevel,
- inline: true
- },
- {
- name: "Guild Icon",
- value: `[Full Icon Here](${msg.guild.iconURL})`,
- inline: true
- },
- {
- name: "Date now:",
- value: new Date().toLocaleString(),
- inline: true
- }
- ],
- timestamp: new Date(),
- footer: {
- icon_url: msg.guild.iconURL,
- text: "At " + msg.guild.createdAt.toLocaleString()
- }
- }})
- }
- }
- if (command == "o") {
- setTimeout(function() {
- msg.edit("o.o")
- }, 1000)
- setTimeout(function() {
- msg.edit("o.O")
- }, 3000)
- setTimeout(function() {
- msg.edit("O.o")
- }, 5000)
- setTimeout(function() {
- msg.edit("O_o")
- }, 7000)
- setTimeout(function() {
- msg.edit("o_O")
- }, 9000)
- setTimeout(function() {
- msg.edit("o_o")
- }, 11000)
- }
- if (command == "servers") {
- channel.sendMessage("I'm currently in `" + bot.guilds.size + "` servers.")
- return;
- }
- if (command == "take") {
- let usr = msg.mentions.users.first();
- if (!usr) {
- return channel.sendMessage("You need to mention that user.");
- }
- let member = msg.guild.members.get(usr.id);
- let rolename = text.substring(args[0].length + args[1].length + 2, text.length)
- let role = msg.guild.roles.find("name", rolename);
- if (!role) {
- return channel.sendMessage("I can't find that role.");
- }
- member.addRole(role)
- .then(member => {
- channel.sendMessage("Alright, I've removed the role '" + role.name + "' from " + member)
- member.removeRole(role);
- })
- .catch((error) => {
- channel.sendMessage("I don't have permission to 'manage role'.")
- })
- return;
- }
- if (command == "give") {
- let usr = msg.mentions.users.first();
- if (!usr) {
- return channel.sendMessage("You need to mention that user.");
- }
- let member = msg.guild.members.get(usr.id);
- let rolename = text.substring(args[0].length + args[1].length + 2, text.length)
- let role = msg.guild.roles.find("name", rolename);
- if (!role) {
- return channel.sendMessage("I can't find that role.");
- }
- member.removeRole(role)
- .then(member => {
- channel.sendMessage("Alright, I've given the role '" + role.name + "' to " + member)
- member.addRole(role);
- })
- .catch((error) => {
- channel.sendMessage("I don't have permission to 'manage role'.")
- })
- return;
- }
- if (command == "roleslist") {
- channel.sendMessage('```\n' + msg.guild.roles.map(r => r.name)
- .join('\n') + '```')
- }
- if (command == "users") {
- channel.sendMessage(":eyes:")
- .then(msg => {
- guild = msg.guild;
- msg.edit(`Total Users in ${guild.name} is **${guild.memberCount}**.`)
- });
- return;
- }
- usermention = msg.mentions.users.array()[0];
- if (command == "bchar") {
- msg.edit('')
- }
- if (command == "embed") {
- let embedArgs = msg.content.split(` `)
- .slice(1)
- .join(` `)
- /*let color = msg.member ?
- parseInt(msg.member.highestRole.hexColor.slice(1), 16) :
- parseInt(("000000" + Math.random().toString(16).slice(2, 8).toUpperCase()).slice(-6), 16);*/
- msg.edit('', {
- embed: {
- color
- , description: embedArgs
- }
- })
- .then(msg => console.log('it worked!'))
- }
- if (command == "editperm") {
- msg.edit("To edit permissions, you must first pick what permission type you would like to edit. There are currently five types you may pick from and are dj, mod, admin, banned and master. Once you've picked your type, run the following command: `/permissions set <type> <role>`.")
- }
- // below this line is total shit.
- if (command == "xxboob") {
- msg.delete();
- channel.sendMessage("Hey boob, next time u boob boob dun be boob boob in gen chat be boob boob in the boob boob u might be sad boob like lads boob boob dun be boob boob cus u bad boob be boob boob, be rad boob not boob not boob boob cus boob boob makes us sad boob dat bad boob get a wad boob dun be boob boob be rad boob like rad dad boob bad boob games had boob dun be boob boob just be glad boob be rad boob", {
- tts: true
- })
- .then(msg => {
- msg.edit(`:eyes:`)
- .catch(console.error);
- })
- .catch(console.error);
- }
- if(command == "prefix") {
- let args = msg.content.split(" ").slice(1);
- config.prefix = args[0];
- fs.writeFile('./config.json', JSON.stringify(config), (err) => {if(err) console.error(err)});
- msg.edit('Successfully changed selfbot prefix to `' + config.prefix + '`')
- }
- if (command == "userinfo") {
- let user = msg.mentions.users.first();
- if (!user) {
- return channel.sendMessage("", {
- embed: {
- color: color
- , author: {
- name: msg.author.username + " (" + msg.author.id + ")"
- , icon_url: msg.author.avatarURL
- }
- , thumbnail: {
- url: msg.author.avatarURL
- }
- , fields: [
- {
- name: "Status"
- , value: "```" + msg.author.presence.status.toUpperCase() + "```"
- }
- , {
- name: "Account Created At"
- , value: "```" + msg.author.createdAt.toLocaleString() + "```"
- }
- , {
- name: "A Bot?"
- , value: "```" + msg.author.bot + "```"
- }
- , {
- name: "Discriminator"
- , value: "```" + msg.author.discriminator + "```"
- }
- ]
- , timestamp: new Date()
- , footer: {
- icon_url: bot.user.avatarURL
- , text: "Akiara"
- }
- }
- })
- }
- if (user) {
- if (user.bot === false) {
- channel.sendMessage("", {
- embed: {
- color: color
- , author: {
- name: user.username + " (" + user.id + ")"
- , icon_url: user.avatarURL
- }
- , thumbnail: {
- url: user.avatarURL
- }
- , fields: [
- {
- name: "Status"
- , value: "```" + user.presence.status.toUpperCase() + "```"
- }
- , {
- name: "Account Created At"
- , value: "```" + user.createdAt.toLocaleString() + "```"
- }
- , {
- name: "A Bot?"
- , value: "```" + user.bot + "```"
- }
- , {
- name: "Discriminator"
- , value: "```" + user.discriminator + "```"
- }
- ]
- , timestamp: new Date()
- , footer: {
- icon_url: bot.user.avatarURL
- , text: "© Rocket:tm:"
- }
- }
- })
- }
- let usr = msg.mentions.users.first();
- if (user.bot === true) {
- channel.sendMessage("", {
- embed: {
- color: color
- , author: {
- name: user.username + " (" + user.id + ") " + (user.bot ? "[BOT]" : "")
- , icon_url: user.avatarURL
- }
- , thumbnail: {
- url: user.avatarURL
- }
- , fields: [
- {
- name: "Status"
- , value: "```" + user.presence.status.toUpperCase() + "```"
- }
- , {
- name: "Account Created At"
- , value: "```" + user.createdAt.toLocaleString() + "```"
- }
- , {
- name: "Discriminator"
- , value: "```" + user.discriminator + "```"
- }
- ]
- , timestamp: new Date()
- , footer: {
- icon_url: bot.user.avatarURL
- , text: "©"
- }
- }
- })
- }
- }
- }
- });
- bot.login(config.token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement