Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const botSettings = require("./botsettings.json");
- const Discord = require("discord.js");
- const bot = new Discord.Client();
- const prefix = botSettings.prefix;
- bot.on("ready", async () => {
- console.log(`${bot.user.username} Bot has successfully enabled! Attempting to generate invite link...`);
- try {
- let link = await bot.generateInvite(["ADMINISTRATOR"]);
- console.log(link);
- } catch(e) {
- console.log(e.stack);
- }
- });
- bot.on("message", async message => {
- if(message.author.bot) return;
- if(message.channel.type === "dm") return;
- let messageArray = message.content.split(" ");
- let command = messageArray[0];
- let args = messageArray.slice(1);
- if(!command.startsWith(prefix)) return;
- // .user @<mention>
- if(command === `${prefix}user`) {
- let toUser = message.mentions.users.first() || message.guild.members.get(args[0]);
- if(!toUser) return message.channel.sendMessage("Please @ a user or ID.");
- var img = "https://cdn.discordapp.com/attachments/388196716324847617/407126307151806468/Discord-Server-Logo.png";
- let embed = new Discord.RichEmbed()
- .setAuthor(toUser.username)
- .setDescription("User Info")
- .addField("Username:", `${toUser.username}#${toUser.discriminator}`)
- .addField("Discord ID:", toUser.id)
- .setThumbnail(toUser.avatarURL)
- .setTimestamp()
- .setFooter("© Pokemon Origin", img)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) looked up another user.`);
- return;
- }
- // .ping
- if(command === `${prefix}ping`) {
- let embed = new Discord.RichEmbed()
- .setDescription(`**Pong!** \`${Date.now() - message.createdTimestamp} ms\``)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) sent a ping.`);
- }
- // .iam verified
- let roleID = bot.guilds.get(message.guild.id).roles.find('name', 'Verified');
- if(message.content.startsWith(`${prefix}iam verified`)) {
- if(message.member.roles.has(roleID.id)) {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you are already **Verified**.`)
- .setColor("#FF9090");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) is already Verified.`);
- } else {
- message.member.addRole(roleID).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you are now **Verified**.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) is now Verified.`);
- }
- }
- // .iam breeder
- let roleID3 = bot.guilds.get(message.guild.id).roles.find('name', 'Breeder');
- if(message.content.startsWith(`${prefix}iam breeder`)) {
- if(message.member.roles.has(roleID3.id)) {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you already have the **Breeder** role.`)
- .setColor("#FF9090");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has already joined the Breeder role.`);
- } else {
- message.member.addRole(roleID3).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you now have the **Breeder** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has joined the Breeder role.`);
- }
- }
- // .iamnot breeder
- let roleID4 = bot.guilds.get(message.guild.id).roles.find('name', 'Breeder');
- if(message.content.startsWith(`${prefix}iamnot breeder`)) {
- if(message.member.roles.has(roleID4.id)) {
- message.member.removeRole(roleID4).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you no longer have the **Breeder** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) is no longer the Breeder role.`);
- } else {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you don't have the **Breeder** role.`)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) already left the Breeder role.`);
- }
- }
- // .iam battler
- let roleID5 = bot.guilds.get(message.guild.id).roles.find('name', 'Battler');
- if(message.content.startsWith(`${prefix}iam battler`)) {
- if(message.member.roles.has(roleID5.id)) {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you already have the **Battler** role.`)
- .setColor("#FF9090");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has already joined the Battler role.`);
- } else {
- message.member.addRole(roleID5).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you now have the **Battler** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has joined the Battler role.`);
- }
- }
- // .iamnot battler
- let roleID6 = bot.guilds.get(message.guild.id).roles.find('name', 'Battler');
- if(message.content.startsWith(`${prefix}iamnot battler`)) {
- if(message.member.roles.has(roleID6.id)) {
- message.member.removeRole(roleID6).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you no longer have the **Battler** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) is no longer the Battler role.`);
- } else {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you don't have the **Battler** role.`)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) already left the Battler role.`);
- }
- }
- // .iam collector
- let roleID7 = bot.guilds.get(message.guild.id).roles.find('name', 'Collector');
- if(message.content.startsWith(`${prefix}iam collector`)) {
- if(message.member.roles.has(roleID7.id)) {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you already have the **Collector** role.`)
- .setColor("#FF9090");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has already joined the Collector role.`);
- } else {
- message.member.addRole(roleID7).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you now have the **Collector** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has joined the Collector role.`);
- }
- }
- // .iamnot collector
- let roleID8 = bot.guilds.get(message.guild.id).roles.find('name', 'Collector');
- if(message.content.startsWith(`${prefix}iamnot collector`)) {
- if(message.member.roles.has(roleID8.id)) {
- message.member.removeRole(roleID8).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you no longer have the **Collector** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) is no longer the Collector role.`);
- } else {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you don't have the **Collector** role.`)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) already left the Collector role.`);
- }
- }
- // .iam shiny hunter
- let roleID9 = bot.guilds.get(message.guild.id).roles.find('name', 'Shiny Hunter');
- if(message.content.startsWith(`${prefix}iam shiny hunter`)) {
- if(message.member.roles.has(roleID9.id)) {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you already have the **Shiny Hunter** role.`)
- .setColor("#FF9090");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has already joined the Shiny Hunter role.`);
- } else {
- message.member.addRole(roleID9).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you now have the **Shiny Hunter** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has joined the Shiny Hunter role.`);
- }
- }
- // .iamnot shiny hunter
- let roleID10 = bot.guilds.get(message.guild.id).roles.find('name', 'Shiny Hunter');
- if(message.content.startsWith(`${prefix}iamnot shiny hunter`)) {
- if(message.member.roles.has(roleID10.id)) {
- message.member.removeRole(roleID10).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you no longer have the **Shiny Hunter** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) is no longer the Shiny Hunter role.`);
- } else {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you don't have the **Shiny Hunter** role.`)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) already left the Shiny Hunter role.`);
- }
- }
- // .iam pokedex helper
- let roleID11 = bot.guilds.get(message.guild.id).roles.find('name', 'Pokedex Helper');
- if(message.content.startsWith(`${prefix}iam pokedex helper`)) {
- if(message.member.roles.has(roleID11.id)) {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you already have the **Pokedex Helper** role.`)
- .setColor("#FF9090");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has already joined the Pokedex Helper role.`);
- } else {
- message.member.addRole(roleID11).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you now have the **Pokedex Helper** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has joined the Pokedex Helper role.`);
- }
- }
- // .iamnot pokedex helper
- let roleID12 = bot.guilds.get(message.guild.id).roles.find('name', 'Pokedex Helper');
- if(message.content.startsWith(`${prefix}iamnot pokedex helper`)) {
- if(message.member.roles.has(roleID12.id)) {
- message.member.removeRole(roleID12).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you no longer have the **Pokedex Helper** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) is no longer the Pokedex Helper role.`);
- } else {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you don't have the **Pokedex Helper** role.`)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) already left the Pokedex Helper role.`);
- }
- }
- // .iam na
- let roleID13 = bot.guilds.get(message.guild.id).roles.find('name', 'NA');
- if(message.content.startsWith(`${prefix}iam NA`)) {
- if(message.member.roles.has(roleID13.id)) {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you already have the **NA** role.`)
- .setColor("#FF9090");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has already joined the NA role.`);
- } else {
- message.member.addRole(roleID13).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you now have the **NA** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has joined the NA role.`);
- }
- }
- // .iamnot na
- let roleID14 = bot.guilds.get(message.guild.id).roles.find('name', 'NA');
- if(message.content.startsWith(`${prefix}iamnot NA`)) {
- if(message.member.roles.has(roleID14.id)) {
- message.member.removeRole(roleID14).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you no longer have the **NA** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) is no longer the NA role.`);
- } else {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you don't have the **NA** role.`)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) already left the Pokedex NA role.`);
- }
- }
- // .iam eu
- let roleID15 = bot.guilds.get(message.guild.id).roles.find('name', 'EU');
- if(message.content.startsWith(`${prefix}iam EU`)) {
- if(message.member.roles.has(roleID15.id)) {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you already have the **EU** role.`)
- .setColor("#FF9090");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has already joined the EU role.`);
- } else {
- message.member.addRole(roleID15).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you now have the **EU** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has joined the EU role.`);
- }
- }
- // .iamnot eu
- let roleID16 = bot.guilds.get(message.guild.id).roles.find('name', 'EU');
- if(message.content.startsWith(`${prefix}iamnot EU`)) {
- if(message.member.roles.has(roleID16.id)) {
- message.member.removeRole(roleID16).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you no longer have the **EU** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) is no longer the EU role.`);
- } else {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you don't have the **EU** role.`)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) already left the Pokedex EU role.`);
- }
- }
- // .iam jp
- let roleID17 = bot.guilds.get(message.guild.id).roles.find('name', 'JP');
- if(message.content.startsWith(`${prefix}iam JP`)) {
- if(message.member.roles.has(roleID17.id)) {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you already have the **JP** role.`)
- .setColor("#FF9090");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has already joined the JP role.`);
- } else {
- message.member.addRole(roleID17).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you now have the **JP** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) has joined the JP role.`);
- }
- }
- // .iamnot jp
- let roleID18 = bot.guilds.get(message.guild.id).roles.find('name', 'JP');
- if(message.content.startsWith(`${prefix}iamnot JP`)) {
- if(message.member.roles.has(roleID18.id)) {
- message.member.removeRole(roleID18).catch(console.error);
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you no longer have the **JP** role.`)
- .setColor("#60FF60");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) is no longer the JP role.`);
- } else {
- let embed = new Discord.RichEmbed()
- .setDescription(`**${message.author.username}**, you don't have the **JP** role.`)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) already left the Pokedex JP role.`);
- }
- }
- // .admin
- let roleID19 = bot.guilds.get(message.guild.id).roles.find('name', 'Admin');
- if(message.content.startsWith(`${prefix}admin`)) {
- message.channel.send("" + roleID19 + " **Please!**");
- console.log(`User: (${message.author.username}) pinged an admin!!`);
- }
- // .mod
- let roleID20 = bot.guilds.get(message.guild.id).roles.find('name', 'Moderator');
- if(message.content.startsWith(`${prefix}mod`)) {
- message.channel.send("" + roleID20 + " **Please!**");
- console.log(`User: (${message.author.username}) pinged a moderator!`);
- }
- // .battle
- let roleID21 = bot.guilds.get(message.guild.id).roles.find('name', 'Battler');
- if(message.content.startsWith(`${prefix}battle`)) {
- message.channel.send("" + roleID21 + ", " + `${message.member.user} **is looking for a battle!**`);
- console.log(`User: (${message.author.username}) pinged a battler!`);
- }
- // .rules
- let rules = bot.channels.get("406320187877359627");
- let announcements = bot.channels.get("406320239706374145");
- let botcmds = bot.channels.get("406320278755475467");
- if(message.content.startsWith(`${prefix}rules`)) {
- var thmbn = "https://cdn.discordapp.com/attachments/407275702908616725/407359812750409728/tumblr_m9a6eqNYze1qfqgb9o1_500.gif";
- var img = "https://cdn.discordapp.com/attachments/388196716324847617/407126307151806468/Discord-Server-Logo.png";
- let embed = new Discord.RichEmbed()
- .setAuthor("Pokémon Origin Server Rules")
- .setDescription("" + rules)
- .addField("Announcements", "" + announcements)
- .addField("Bot Commands", "" + botcmds)
- .setTimestamp()
- .setThumbnail(thmbn)
- .setFooter("© Pokemon Origin", img)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) pinged for the rules.`);
- }
- // .trade
- let trade = bot.channels.get("406320639801294848");
- var img = "https://cdn.discordapp.com/attachments/388196716324847617/407126307151806468/Discord-Server-Logo.png";
- if(message.content.startsWith(`${prefix}trade`)) {
- let embed = new Discord.RichEmbed()
- .setAuthor("Trade")
- .setDescription("" + trade)
- .setTimestamp()
- .setThumbnail(thmbn)
- .setFooter("© Pokemon Origin", img)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) pinged for the trade channel.`);
- }
- // .general
- let general = bot.channels.get("406318818617720844");
- var img = "https://cdn.discordapp.com/attachments/388196716324847617/407126307151806468/Discord-Server-Logo.png";
- if(message.content.startsWith(`${prefix}general`)) {
- let embed = new Discord.RichEmbed()
- .setAuthor("General Chat")
- .setDescription("" + general)
- .setTimestamp()
- .setFooter("© Pokemon Origin", img)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) pinged for the general channel.`);
- }
- // .suggest
- let ss = bot.channels.get("406320980760199168");
- let roleIDss = bot.guilds.get(message.guild.id).roles.find('name', 'Beginner Trainer');
- var img = "https://cdn.discordapp.com/attachments/388196716324847617/407126307151806468/Discord-Server-Logo.png";
- if(message.content.startsWith(`${prefix}suggest`)) {
- if(!message.member.roles.has(roleIDss.id)) {
- let embed = new Discord.RichEmbed()
- .setAuthor("Server Suggestions")
- .setDescription("" + ss)
- .addField("Level Met", "False")
- .setTimestamp()
- .setFooter("© Pokemon Origin", img)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) pinged for the server suggestions channel.`);
- } else {
- if(message.member.roles.has(roleIDss.id)) {
- let embed = new Discord.RichEmbed()
- .setAuthor("Server Suggestions")
- .setDescription("" + ss)
- .addField("Level Met", "True")
- .setTimestamp()
- .setFooter("© Pokemon Origin", img)
- .setColor("#ccccff");
- message.channel.send(embed);
- console.log(`User: (${message.author.username}) pinged for the server suggestions channel.`);
- }
- }
- }
- // .help
- var img = "https://cdn.discordapp.com/attachments/388196716324847617/407126307151806468/Discord-Server-Logo.png";
- if(message.content.startsWith(`${prefix}help`)) {
- let embed = new Discord.RichEmbed()
- .addField("**.ping**", "Ping the bot!")
- .addField("**.user @<mention>**", "Look up another user.")
- .addField("**.iam <role>**", "Assign yourself to a role.")
- .addField("**.iamnot <role>**", "Remove yourself from a role.")
- .addField("**.rules**", "Utility Channel's")
- .addField("**.battle**", "Ping for a battle!")
- .addField("**.trade**", "Trade Channel")
- .addField("**.suggest**", "Server Suggestion's Channel")
- .addField("**.general**", "General Chat")
- .addField("**.admin**", "Ping an admin, __Do **NOT** abuse!__")
- .addField("**.mod**", "Ping a moderator, __Do **NOT** abuse!__")
- .setTimestamp("")
- .setFooter("© Pokemon Origin" + " | Coded with <3 by Medi", img)
- .setColor("#ccccff");
- message.channel.sendMessage(embed);
- console.log(`User: (${message.author.username}) pinged the help command.`);
- }
- });
- bot.login(botSettings.token);
Advertisement
Add Comment
Please, Sign In to add comment