Advertisement
Guest User

Untitled

a guest
Nov 12th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. const Discord = require("discord.js");
  2.  
  3. const TOKEN = "Mzc5MzA4MjIwMDMzNzk0MDQ5.DOoJ0w.Ct838hrr8MK5wXdDqP6cxiU-2KA"
  4. const PREFIX = "!"
  5. var bot = new Discord.Client();
  6.  
  7. bot.on("ready", function() {
  8. console.log("CHCABot is now online!")
  9. bot.user.setGame("!help");
  10. });
  11.  
  12. bot.on("guildMemberAdd", function(member) {
  13.  
  14. });
  15.  
  16. bot.on("message", function(message) {
  17. if (message.author.equals(bot.user)) return;
  18.  
  19. if (!message.content.startsWith(PREFIX)) return;
  20. var args = message.content.substring(PREFIX.length).split(" ");
  21.  
  22. switch (args[0].toLowerCase()) {
  23. case "official":
  24. message.channel.sendMessage("Official is the way to go!")
  25. break;
  26. case "invite":
  27. message.channel.sendMessage("https://discord.gg/bxw2ueR")
  28. break;
  29. case "help":
  30. var embed = new Discord.RichEmbed()
  31. .setDescription("CHCABot includes many useful commands! All commands are prefixed with an exclamation mark. For example `!ss-textbook`. Below is a a list of all the commands that you can use.")
  32. .addField("TEXTBOOKS :notebook_with_decorative_cover:", "`ss-textbook`,`sci-textbook`,`alg-textbook`")
  33. .addField("FUN :joy:", "`official`")
  34. .addField("CONVENIENCE :key:", "`invite`")
  35. .addField("ADMIN :wrench:", "`admintest`")
  36. message.channel.sendEmbed(embed);
  37. break;
  38. case "sci-textbook":
  39. var embed = new Discord.RichEmbed()
  40. //.setDescription("Below are the links and logins for both the 7th and 8th grade Social Studies textbooks.")
  41. //.addField("7TH GRADE", "Link: http://bit.ly/2yCaBep \nUsername: `christianhills1` \nPassword:** `science1`")
  42. //.addField("8TH GRADE", "We need help! If one of the 8th graders could submit the username, password, and link to an Admin, that would be great!")
  43. //message.channel.sendEmbed(embed);
  44. break;
  45. case "ss-textbook":
  46. var embed = new Discord.RichEmbed()
  47. .setDescription("Below are the links and logins for both the 7th and 8th grade Science textbooks. Remember, they are case sensetive.")
  48. .addField("7TH GRADE", "Link: http://bit.ly/1It1ABJ \nUsername: `firstlast7` \nPassword:** `WorldStudies7`")
  49. .addField("8TH GRADE", "We need help! If one of the 8th graders could submit the username, password, and link to an Admin, that would be great!")
  50. message.channel.sendEmbed(embed);
  51. break;
  52. case "admintest":
  53. if(message.member.roles.find("name", "Admins") || message.member.roles.find("name", "Jr. Admins")){
  54. message.channel.sendMessage("You are an Admin and you have permission to use this command.")
  55. } else {
  56. message.channel.sendMessage("You don't have permission. AHAHAHA")
  57. }
  58. case "testrole":
  59. let role = message.guild.roles.find("name", "Maximum Coolness");
  60. let member = message.mentions.members.first();
  61. member.addRole(role).catch(console.error);
  62. break;
  63. case "createbotrole":
  64. member.guild.createRole({
  65. name: "CHCABot",
  66. permissions: [administrator]
  67. });
  68. default:
  69. message.channel.sendMessage("Oops! That command doesn't exist! Refer to !help to so a list of valid commands.")
  70. }
  71. });
  72.  
  73. bot.login(TOKEN);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement