Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Made with love and care by opps 42 =)
- const Discord = require('discord.js');
- const bot = new Discord.Client();
- const fs = require('fs');
- const ownerID = `332767702047391745`;
- const active = new Map();
- let ops = {
- ownerID: ownerID,
- active: active,
- }
- bot.commands = new Discord.Collection();
- let prefix = "!"
- fs.readdir("./cmds/", (err, files) => {
- let jsfiles = files.filter(f => f.split(".").pop() === "js");
- if(jsfiles.length <= 0) {
- console.log("No Commands Found!!!!!");
- return;
- }
- console.log(`Loading ${jsfiles.length} commands!`)
- jsfiles.forEach((f, i) => {
- let props = require(`./cmds/${f}`);
- console.log(`${i + 1}: ${f} loaded!`)
- bot.commands.set(props.help.name, props);
- });
- });
- bot.on('message', message => {
- if(message.author.bot) return;
- if(message.channel.type === "dm") return;
- let blacklisted = ['Nigger', 'N1gger', 'Spic', 'N1gg3r', 'Jew', 'Cunt', 'Whore', 'Slut'];
- let foundInText = false;
- for (var i in blacklisted) {
- if (message.content.toLowerCase().includes(blacklisted[i].toLowerCase())) foundInText = true;
- }
- if (foundInText) {
- message.delete()
- message.channel.send(` ${message.author} One of the following words you used is blacklisted!`)
- }
- let messageArray = message.content.split(/\s+/g);
- let command = messageArray[0];
- let args = messageArray.slice(1);
- if(!command.startsWith(prefix)) return;
- let cmd = bot.commands.get(command.slice(prefix.length));
- if(cmd) cmd.run(bot, message, args);
- });
- bot.on('guildMemberAdd', message => { // Commands Go Inside The client.on('message',
- let wembed = new Discord.RichEmbed()
- .setColor("#3b5998")
- .setAuthor(`${message.guild.name} Welcome!`, message.guild.iconURL)
- .setThumbnail(message.user.displayAvatarURL)
- .addField(`Welcome to ${message.guild.name}`, `${message.user.username}`, true)
- .addField(`Bot Info`, `Prefix is !, use !help for help!`, true)
- .addField(`Make sure to check out our servers!`, `And we hope you have fun!`, true)
- .setTimestamp()
- .setFooter(`Bot made by opps 42 for KoLa Servers™`);
- let wChannel = message.guild.channels.find(c => c.name === "welcome");
- wChannel.send(wembed);
- });
- bot.on('ready', () => {
- console.log(`${bot.user.username} is online`);
- // bot.user.setActivity("Hello", {type: "STREAMING", url:"https://twitch.tv/Strandable"});
- let statuses = [
- `Patrolling ${bot.guilds.size} servers!`,
- "!help",
- `Protecting ${bot.users.size} users!`,
- `Blessing KoLa Servers!`,
- `Killing a Minecraft Cow`,
- `SCP: Secret Laboratory`,
- `Taking Owner From Opps`,
- `Minecraft`,
- `running super fast, really fast..`,
- `cpu is currently: on fire`,
- `Overclocking my lifespan.`,
- `Updating: 4% Complete Elapsed Time: 4h 36M`,
- ]
- setInterval(function() {
- let status = statuses[Math.floor(Math.random() * statuses.length)];
- bot.user.setActivity(status);
- }, 15000);
- });
- bot.login('Deleted here for obvious reasons');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement