Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- const TOKEN = "Mzc5MzA4MjIwMDMzNzk0MDQ5.DOoJ0w.Ct838hrr8MK5wXdDqP6cxiU-2KA"
- const PREFIX = "!"
- var bot = new Discord.Client();
- bot.on("ready", function() {
- console.log("CHCABot is now online!")
- bot.user.setGame("!help");
- });
- bot.on("guildMemberAdd", function(member) {
- });
- bot.on("message", function(message) {
- if (message.author.equals(bot.user)) return;
- if (!message.content.startsWith(PREFIX)) return;
- var args = message.content.substring(PREFIX.length).split(" ");
- switch (args[0].toLowerCase()) {
- case "official":
- message.channel.sendMessage("Official is the way to go!")
- break;
- case "invite":
- message.channel.sendMessage("https://discord.gg/bxw2ueR")
- break;
- case "help":
- var embed = new Discord.RichEmbed()
- .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.")
- .addField("TEXTBOOKS :notebook_with_decorative_cover:", "`ss-textbook`,`sci-textbook`,`alg-textbook`")
- .addField("FUN :joy:", "`official`")
- .addField("CONVENIENCE :key:", "`invite`")
- .addField("ADMIN :wrench:", "`admintest`")
- message.channel.sendEmbed(embed);
- break;
- case "sci-textbook":
- var embed = new Discord.RichEmbed()
- //.setDescription("Below are the links and logins for both the 7th and 8th grade Social Studies textbooks.")
- //.addField("7TH GRADE", "Link: http://bit.ly/2yCaBep \nUsername: `christianhills1` \nPassword:** `science1`")
- //.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!")
- //message.channel.sendEmbed(embed);
- break;
- case "ss-textbook":
- var embed = new Discord.RichEmbed()
- .setDescription("Below are the links and logins for both the 7th and 8th grade Science textbooks. Remember, they are case sensetive.")
- .addField("7TH GRADE", "Link: http://bit.ly/1It1ABJ \nUsername: `firstlast7` \nPassword:** `WorldStudies7`")
- .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!")
- message.channel.sendEmbed(embed);
- break;
- case "admintest":
- if(message.member.roles.find("name", "Admins") || message.member.roles.find("name", "Jr. Admins")){
- message.channel.sendMessage("You are an Admin and you have permission to use this command.")
- } else {
- message.channel.sendMessage("You don't have permission. AHAHAHA")
- }
- case "testrole":
- let role = message.guild.roles.find("name", "Maximum Coolness");
- let member = message.mentions.members.first();
- member.addRole(role).catch(console.error);
- break;
- case "createbotrole":
- member.guild.createRole({
- name: "CHCABot",
- permissions: [administrator]
- });
- default:
- message.channel.sendMessage("Oops! That command doesn't exist! Refer to !help to so a list of valid commands.")
- }
- });
- bot.login(TOKEN);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement