Advertisement
opps_42

index.js

Nov 19th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. // Made with love and care by opps 42 =)
  2. const Discord = require('discord.js');
  3. const bot = new Discord.Client();
  4. const fs = require('fs');
  5. const ownerID = `332767702047391745`;
  6. const active = new Map();
  7.  
  8. let ops = {
  9. ownerID: ownerID,
  10. active: active,
  11. }
  12. bot.commands = new Discord.Collection();
  13. let prefix = "!"
  14. fs.readdir("./cmds/", (err, files) => {
  15.  
  16. let jsfiles = files.filter(f => f.split(".").pop() === "js");
  17. if(jsfiles.length <= 0) {
  18. console.log("No Commands Found!!!!!");
  19. return;
  20. }
  21. console.log(`Loading ${jsfiles.length} commands!`)
  22.  
  23. jsfiles.forEach((f, i) => {
  24. let props = require(`./cmds/${f}`);
  25. console.log(`${i + 1}: ${f} loaded!`)
  26. bot.commands.set(props.help.name, props);
  27. });
  28. });
  29.  
  30. bot.on('message', message => {
  31. if(message.author.bot) return;
  32. if(message.channel.type === "dm") return;
  33. let blacklisted = ['Nigger', 'N1gger', 'Spic', 'N1gg3r', 'Jew', 'Cunt', 'Whore', 'Slut'];
  34.  
  35. let foundInText = false;
  36. for (var i in blacklisted) {
  37. if (message.content.toLowerCase().includes(blacklisted[i].toLowerCase())) foundInText = true;
  38. }
  39. if (foundInText) {
  40. message.delete()
  41. message.channel.send(` ${message.author} One of the following words you used is blacklisted!`)
  42. }
  43.  
  44. let messageArray = message.content.split(/\s+/g);
  45. let command = messageArray[0];
  46. let args = messageArray.slice(1);
  47.  
  48. if(!command.startsWith(prefix)) return;
  49.  
  50. let cmd = bot.commands.get(command.slice(prefix.length));
  51. if(cmd) cmd.run(bot, message, args);
  52. });
  53.  
  54. bot.on('guildMemberAdd', message => { // Commands Go Inside The client.on('message',
  55. let wembed = new Discord.RichEmbed()
  56. .setColor("#3b5998")
  57. .setAuthor(`${message.guild.name} Welcome!`, message.guild.iconURL)
  58. .setThumbnail(message.user.displayAvatarURL)
  59. .addField(`Welcome to ${message.guild.name}`, `${message.user.username}`, true)
  60. .addField(`Bot Info`, `Prefix is !, use !help for help!`, true)
  61. .addField(`Make sure to check out our servers!`, `And we hope you have fun!`, true)
  62. .setTimestamp()
  63. .setFooter(`Bot made by opps 42 for KoLa Servers™`);
  64.  
  65.  
  66.  
  67. let wChannel = message.guild.channels.find(c => c.name === "welcome");
  68. wChannel.send(wembed);
  69.  
  70. });
  71. bot.on('ready', () => {
  72. console.log(`${bot.user.username} is online`);
  73. // bot.user.setActivity("Hello", {type: "STREAMING", url:"https://twitch.tv/Strandable"});
  74.  
  75. let statuses = [
  76. `Patrolling ${bot.guilds.size} servers!`,
  77. "!help",
  78. `Protecting ${bot.users.size} users!`,
  79. `Blessing KoLa Servers!`,
  80. `Killing a Minecraft Cow`,
  81. `SCP: Secret Laboratory`,
  82. `Taking Owner From Opps`,
  83. `Minecraft`,
  84. `running super fast, really fast..`,
  85. `cpu is currently: on fire`,
  86. `Overclocking my lifespan.`,
  87. `Updating: 4% Complete Elapsed Time: 4h 36M`,
  88. ]
  89.  
  90. setInterval(function() {
  91. let status = statuses[Math.floor(Math.random() * statuses.length)];
  92. bot.user.setActivity(status);
  93.  
  94. }, 15000);
  95.  
  96. });
  97.  
  98.  
  99. bot.login('Deleted here for obvious reasons');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement