Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.18 KB | None | 0 0
  1. const Discord = require("discord.js");
  2.  
  3. const TOKEN = "";
  4. const PREFIX = "w!"
  5. var bot = new Discord.Client();
  6.  
  7. bot.on("ready", function () {
  8. console.log("ready");
  9. });
  10.  
  11. bot.on("message", function (message) {
  12. if (message.author.equals(bot.user)) return;
  13.  
  14. if (message.isMemberMentioned(bot.user)) {
  15. message.channel.send(`Hello there, <@${message.author.id}> How may I assist you?`);
  16. }
  17.  
  18. if (!message.content.startsWith(PREFIX)) return;
  19.  
  20. var args = message.content.substring(PREFIX.length).split(" ")
  21.  
  22. switch (args[0]) {
  23. case "ping":
  24. message.channel.sendMessage("Pong!");
  25. break;
  26. case "embed":
  27. if (!message.member.roles.find(r => r.name === "ABG")) return message.reply('not allowed');
  28.  
  29. var embed = new Discord.RichEmbed()
  30. var embed = new Discord.RichEmbed()
  31. .setAuthor("Abstract Bot Tutorial")
  32. .setDescription("__Bot Features:__")
  33. .addField("**Rotations/Invite:**", "If you get rotated out by the bot and want to join back the faction you must DM the bot in-game the name of the player you want to rotate out (Please make sure that you rotate the member that was last on the longest ago)and the bot will kick them and invite you to the faction (Also before rotating someone out check the faction to see if it's full, if not just simply DM the bot in-game your own name and you'll be invited).")
  34. .addField("**Wall/Buffer check:**", "Every 5 minutes the bot will send a message both in-game chat and in discord #walls channel. After checking the walls/buffer you will have to DM the bot in-game 'check' and it'll mark walls as checked and add you a point to the 'Wall check top'. When we have a forcefield on and we cannot be raided we will enable a grace on the bot and then the bot won't send any message in-game/discord so you won't have to check walls then.")
  35. .addField("**Leaderboards:**", "The bot counts for every member how many wall checks, bank deposits, and hours they played. Using that the leaders will decide how big your payout will be. So make sure you're active, you check walls every time the bot says and you grind money and pay the bot so we know how much you deposited.")
  36. .addField("**Away:**", "If you are going away for more than __1 day__ do '.away' in #away channel. The bot will DM you what you need to do, if you mess up the away form don't worry after you finish it you can send the bot '.cancel' and the form won't be sent (form is visible to everyone)")
  37. .addField("**Base/Cannon box coords:**", "If you found a main base of a big enemy faction do '.basecoords' and the bot will DM you a form for you to fill (XYZ Coords, World, Faction etc). If you found a cannon box aimed at our base do the same '.box' and the bot will DM you the same form. If/When you counter the box simply react onto the box form message in #cannon-boxes channel and it'll mark the box as destroyed.")
  38. .addField("**Paypal Email:**", "So we can make it more organized we'll have every one of you do '.setpaypal (Your Paypal Mail)' so you can receive your cut of payout. Make sure you don't misspell your paypal email so leaders won't send it to that email and then you won't get your payout.")
  39. .addField("**Bot DMs:**", "Make sure you have your DMs enabled from our discord server so the bot can DM you all the forms and announcements.")
  40. .setColor(0x00FFFF)
  41.  
  42. message.channel.sendEmbed(embed);
  43. break;
  44.  
  45. case "coinflip":
  46. message.channel.send('You flipped ' + Math.floor(Math.random() * 2) == 0 ? 'Tails' : 'Heads' + '!');
  47. break;
  48.  
  49. default:
  50. message.channel.sendMessage("Invalid command");
  51.  
  52.  
  53. }
  54.  
  55.  
  56. if (message.content == "ALERT: TNT has been detected in one of your notfiy chunks!") {
  57. const roleToCheckFor = message.guild.roles.find(r => r.name === "ABG");
  58.  
  59. for (const user of message.guild.members) {
  60. if (user.roles.has(roleToCheckFor.Id)) {
  61. user.send(`${message.author.tag} said: "WeeWoo"`);
  62. }
  63. }
  64. }
  65.  
  66. });
  67.  
  68. bot.login(TOKEN);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement