Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.01 KB | None | 0 0
  1. //Config & Setup
  2. const Discord = require("discord.js");
  3. const bot = new Discord.Client();
  4. const fs = require("fs");
  5. const config = require("./config.json");
  6. let prefix = config.prefix;
  7. let ownerId = config.ownerId;
  8. let botToken = config.botToken;
  9. let ownerGuildId = config.ownerGuildId;
  10. //Bot On
  11. bot.on("ready", () => {
  12. console.log(`GoodPro712.Alerts! Info : ${bot.users.size} users, in ${bot.channels.size} channels of ${bot.guilds.size} guilds.\nIts GREAT to see that the bot is working!`);
  13. bot.user.setActivity("Use .Help", {
  14. type: 'PLAYING'
  15. })
  16.  
  17. bot.on("message", message => {
  18. if (message.author.bot) return;
  19. if(message.content.indexOf(config.prefix) !== 0) return;
  20. const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
  21. const command = args.shift().toLowerCase();
  22. var guild = message.guild;
  23. );
  24.  
  25. if(command === '') {
  26. //If someone types the prefix it will respond with this.
  27. //If people just use . in texting meaning no comment it can be annoying (Maybe change prefix).
  28. message.channel.send("Please type a command!")
  29. }; //Working
  30.  
  31. process.on("unhandledRejection", err => {
  32. bot.guilds.get().channels.get().send({embederror})
  33. }); //Needs Test
  34. //Commands
  35. if(command === 'help') {
  36. //Shows every command and tells people what there use for.
  37. message.channel.send(`__Help__ **Prefix ${config.prefix}**\n\nHelp\nBotinfo\nPing\nTest\nNotify\nBegger\nSpeak\nSoon\n\n__**Mannage Messages** Commands__\n\nTempmute\n\n__Owner Commands__\n\nStatus\nStatusActivity\n\n**Bot By GoodPro712#0932**`);
  38. } else //Working
  39.  
  40. if(command === 'soon') {
  41. message.channel.send("__Commands Comming Soon__\n\nDrop\nSupply\nKick\nBan\nWarn\nMute\nSlowmode\nGen\nGiveaway\nColor\nCommand\nSpeakEmbed\nStory\nMeme\nPeronalDM\n\nBot By GoodPro712#0932")
  42. } else//Needs Test
  43.  
  44. if(command === 'botinfo') {
  45. //Tells the user info about this bot.
  46. message.channel.send(`Users... ${bot.users.size}\nChannels... ${bot.channels.size}\nServers... ${bot.guilds.size}!`);
  47. } else //Working
  48.  
  49. if(command === 'test') {
  50. //Testing if the bot is online & working.
  51. message.channel.send("Bot is Online & WORKING YAY!!");
  52. } else //Working
  53.  
  54. if(command === 'speak') {
  55. //Says what you tell it to say while deleting your message.
  56. let text = args.join(" ")
  57. message.delete()
  58. message.channel.send(text)
  59. } else //Working
  60.  
  61. if(command === 'notify') {
  62. //DM's everyone on your server what you tell it to DM (Can be Dangerous).
  63. let DMedMsg = args.join(" ");
  64. {if(message.author.id !== ownerId) return;
  65. bot.guilds.get(config.ownerGuildId).members.forEach(m => {
  66. m.send(DMedMsg)}),
  67. message.channel.send(`The Message: **${DMedMsg}** Has Been Direct Messaged To Everyone!!`)}
  68. } else //Working. Only works on my server.
  69.  
  70. if(command === 'ping') {
  71. message.channel.send(bot.ping + "ms.");
  72. } else //Needs Test
  73.  
  74. if(command === 'begger') {
  75. let addBegger = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
  76. var roleB = message.guild.roles.find(roleB =>
  77. roleB.name === "Begger");
  78. addBegger.addRole(roleB.id).then(() => {});
  79. } else //Need Test
  80.  
  81. if(command === 'status') {
  82. //Changes Status
  83. let selfStatus = args.join(" ");
  84. if(message.author.id !== ownerId) return;
  85. bot.user.setActivity(selfStatus, {
  86. type: statusActivity})
  87. } else //Working
  88.  
  89. if(command === 'statusactivity') {
  90. let statusActivity = args.join(" ");
  91. if(message.author.id !== ownerId) return;
  92. bot.user.setActivity(selfStatus, {
  93. type: statusActivity})
  94. } else //Need Test
  95.  
  96. if(command === 'drop') {
  97. let dropTime = args.join(" ").args[1];
  98. if(!dropTime) return message.reply("You didn't specify a time!");
  99. message.channel.send(`Dropping in ${dropTime} SECONDS!!!`)
  100. setTimeout(function() {
  101. message.channel.send("Test");
  102. }, ms(dropTime));
  103. } else //Needs Test
  104. //Bot Token
  105. });
  106. bot.login(config.botToken)
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement