From c484753ee15dbe2a5ce9c6297f22fabb52ce3b7e Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 24 Feb 2018 14:59:35 -0500 Subject: New Command system --- commands/8ball.js | 48 ----------- commands/Fun/8ball.js | 47 +++++++++++ commands/Fun/cureboredom.js | 23 +++++ commands/Fun/og151.js | 167 ++++++++++++++++++++++++++++++++++++ commands/Fun/ship.js | 13 +++ commands/Fun/story.js | 27 ++++++ commands/Getting Started/help.js | 31 +++++++ commands/Information/contribute.js | 13 +++ commands/Information/ping.js | 13 +++ commands/Moderation/ban.js | 40 +++++++++ commands/Moderation/kick.js | 23 +++++ commands/Moderation/purge.js | 30 +++++++ commands/Moderation/softban.js | 40 +++++++++ commands/Moderation/warn.js | 32 +++++++ commands/Owners Only/poweroff.js | 20 +++++ commands/Owners Only/say.js | 20 +++++ commands/Teams/join.js | 60 +++++++++++++ commands/Teams/leave.js | 27 ++++++ commands/Utility/suggest.js | 24 ++++++ commands/Utility/uptime.js | 24 ++++++ commands/ban.js | 41 --------- commands/contribute.js | 14 ---- commands/cureboredom.js | 24 ------ commands/help.js | 40 --------- commands/join.js | 61 -------------- commands/kick.js | 24 ------ commands/leave.js | 28 ------- commands/og151.js | 168 ------------------------------------- commands/ping.js | 14 ---- commands/poweroff.js | 21 ----- commands/purge.js | 31 ------- commands/say.js | 21 ----- commands/ship.js | 14 ---- commands/softban.js | 41 --------- commands/story.js | 28 ------- commands/suggest.js | 25 ------ commands/uptime.js | 25 ------ commands/warn.js | 33 -------- 38 files changed, 674 insertions(+), 701 deletions(-) delete mode 100644 commands/8ball.js create mode 100644 commands/Fun/8ball.js create mode 100644 commands/Fun/cureboredom.js create mode 100644 commands/Fun/og151.js create mode 100644 commands/Fun/ship.js create mode 100644 commands/Fun/story.js create mode 100644 commands/Getting Started/help.js create mode 100644 commands/Information/contribute.js create mode 100644 commands/Information/ping.js create mode 100644 commands/Moderation/ban.js create mode 100644 commands/Moderation/kick.js create mode 100644 commands/Moderation/purge.js create mode 100644 commands/Moderation/softban.js create mode 100644 commands/Moderation/warn.js create mode 100644 commands/Owners Only/poweroff.js create mode 100644 commands/Owners Only/say.js create mode 100644 commands/Teams/join.js create mode 100644 commands/Teams/leave.js create mode 100644 commands/Utility/suggest.js create mode 100644 commands/Utility/uptime.js delete mode 100644 commands/ban.js delete mode 100644 commands/contribute.js delete mode 100644 commands/cureboredom.js delete mode 100644 commands/help.js delete mode 100644 commands/join.js delete mode 100644 commands/kick.js delete mode 100644 commands/leave.js delete mode 100644 commands/og151.js delete mode 100644 commands/ping.js delete mode 100644 commands/poweroff.js delete mode 100644 commands/purge.js delete mode 100644 commands/say.js delete mode 100644 commands/ship.js delete mode 100644 commands/softban.js delete mode 100644 commands/story.js delete mode 100644 commands/suggest.js delete mode 100644 commands/uptime.js delete mode 100644 commands/warn.js (limited to 'commands') diff --git a/commands/8ball.js b/commands/8ball.js deleted file mode 100644 index f188270..0000000 --- a/commands/8ball.js +++ /dev/null @@ -1,48 +0,0 @@ -exports.run = async (bot, msg, args) => { - if (args.length < 1) return msg.reply('You need to ask the 8-ball something for it to respond!'); - - const responses = [ - 'May the odds ever be in your favor...', - 'Definetely not! Did you ever think that this would work?', - 'Most definetely', - 'Seems probable..', - 'Sure, why not?', - 'No!', - 'Probably.', - 'If a sentience can do a backflip, then this can happen!', - 'It is certain', - 'It is decidedly so', - 'Without a doubt', - 'Yes definitely', - 'You may rely on it', - 'As I see it, yes', - 'Most likely', - 'Outlook good', - 'Yes', - 'Signs point to yes', - 'Reply hazy try again', - 'Ask again later', - 'Better not tell you now', - 'Cannot predict now', - 'Concentrate and ask again', - 'Don\'t count on it', - 'My reply is no', - 'My sources say no', - 'Outlook not so good', - 'Very doubtful', - ]; - - msg.channel.send(':8ball: *' + (responses[Math.floor(Math.random() * responses.length)]) + '*'); -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: '8ball', - description: 'Ask the magic 8-ball something. It will answer back, and be as much of a smart-alac as it wants to.', - usage: '<...question>', - category: 'Fun', -}; diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js new file mode 100644 index 0000000..3ebd1c3 --- /dev/null +++ b/commands/Fun/8ball.js @@ -0,0 +1,47 @@ +exports.run = async (bot, msg, args) => { + if (args.length < 1) return msg.reply('You need to ask the 8-ball something for it to respond!'); + + const responses = [ + 'May the odds ever be in your favor...', + 'Definetely not! Did you ever think that this would work?', + 'Most definetely', + 'Seems probable..', + 'Sure, why not?', + 'No!', + 'Probably.', + 'If a sentience can do a backflip, then this can happen!', + 'It is certain', + 'It is decidedly so', + 'Without a doubt', + 'Yes definitely', + 'You may rely on it', + 'As I see it, yes', + 'Most likely', + 'Outlook good', + 'Yes', + 'Signs point to yes', + 'Reply hazy try again', + 'Ask again later', + 'Better not tell you now', + 'Cannot predict now', + 'Concentrate and ask again', + 'Don\'t count on it', + 'My reply is no', + 'My sources say no', + 'Outlook not so good', + 'Very doubtful', + ]; + + msg.channel.send(':8ball: *' + (responses[Math.floor(Math.random() * responses.length)]) + '*'); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: '8ball', + description: 'Ask the magic 8-ball something. It will answer back, and be as much of a smart-alac as it wants to.', + usage: '<...question>', +}; diff --git a/commands/Fun/cureboredom.js b/commands/Fun/cureboredom.js new file mode 100644 index 0000000..9996645 --- /dev/null +++ b/commands/Fun/cureboredom.js @@ -0,0 +1,23 @@ +exports.run = (bot, msg, args) => { + const ideas = [ + 'Pokemon Go to the polls :ballot_box:', + 'Consuming Maccas :fries:', + 'Fighting AstralMod :right_facing_fist:', + 'Joining a team :handshake:', + 'Have a battle :crossed_swords:', + ]; + + if (args[0] === 'list') return msg.channel.send(ideas.join('\n')); + + msg.channel.send(ideas[Math.floor(Math.random() * ideas.length)]); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'cureboredom', + description: 'Finds you something to do.', +}; diff --git a/commands/Fun/og151.js b/commands/Fun/og151.js new file mode 100644 index 0000000..bda9059 --- /dev/null +++ b/commands/Fun/og151.js @@ -0,0 +1,167 @@ +exports.run = (bot, msg) => { + const pokemon = [ + 'Abra', + 'Aerodactyl', + 'Alakazam', + 'Arbok', + 'Arcanine', + 'Articuno', + 'Beedrill', + 'Bellsprout', + 'Blastoise', + 'Bulbasaur', + 'Butterfree', + 'Caterpie', + 'Chansey', + 'Charizard', + 'Charmander', + 'Charmeleon', + 'Clefable', + 'Clefairy', + 'Cloyster', + 'Cubone', + 'Dewgong', + 'Diglett', + 'Ditto', + 'Dodrio', + 'Doduo', + 'Dragonair', + 'Dragonite', + 'Dratini', + 'Drowzee', + 'Dugtrio', + 'Eevee', + 'Ekans', + 'Electabuzz', + 'Electrode', + 'Exeggcute', + 'Exeggutor', + 'Farfetch’d', + 'Fearow', + 'Flareon', + 'Gastly', + 'Gengar', + 'Geodude', + 'Gloom', + 'Golbat', + 'Goldeen', + 'Golduck', + 'Golem', + 'Graveler', + 'Grimer', + 'Growlithe', + 'Gyarados', + 'Haunter', + 'Hitmonchan', + 'Hitmonlee', + 'Horsea', + 'Hypno', + 'Ivysaur', + 'Jigglypuff', + 'Jolteon', + 'Jynx', + 'Kabuto', + 'Kabutops', + 'Kadabra', + 'Kakuna', + 'Kangaskhan', + 'Kingler', + 'Koffing', + 'Krabby', + 'Lapras', + 'Lickitung', + 'Machamp', + 'Machoke', + 'Machop', + 'Magikarp', + 'Magmar', + 'Magnemite', + 'Magneton', + 'Mankey', + 'Marowak', + 'Meowth', + 'Metapod', + 'Mew', + 'Mewtwo', + 'Moltres', + 'Mr. Mime', + 'Muk', + 'Nidoking', + 'Nidoqueen', + 'Nidoran♀', + 'Nidoran♂', + 'Nidorina', + 'Nidorino', + 'Ninetales', + 'Oddish', + 'Omanyte', + 'Omastar', + 'Onix', + 'Paras', + 'Parasect', + 'Persian', + 'Pidgeot', + 'Pidgeotto', + 'Pidgey', + 'Pikachu', + 'Pinsir', + 'Poliwag', + 'Poliwhirl', + 'Poliwrath', + 'Ponyta', + 'Porygon', + 'Primeape', + 'Psyduck', + 'Raichu', + 'Rapidash', + 'Raticate', + 'Rattata', + 'Rhydon', + 'Rhyhorn', + 'Sandshrew', + 'Sandslash', + 'Scyther', + 'Seadra', + 'Seaking', + 'Seel', + 'Shellder', + 'Slowbro', + 'Slowpoke', + 'Snorlax', + 'Spearow', + 'Squirtle', + 'Starmie', + 'Staryu', + 'Tangela', + 'Tauros', + 'Tentacool', + 'Tentacruel', + 'Vaporeon', + 'Venomoth', + 'Venonat', + 'Venusaur', + 'Victreebel', + 'Vileplume', + 'Voltorb', + 'Vulpix', + 'Wartortle', + 'Weedle', + 'Weepinbell', + 'Weezing', + 'Wigglytuff', + 'Zapdos', + 'Zubat', + ]; + + msg.channel.send(pokemon[Math.floor(Math.random() * pokemon.length)]); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'og151', + description: 'Randomly picks one of the generation 1 pokemon, and gives you its name.', +}; diff --git a/commands/Fun/ship.js b/commands/Fun/ship.js new file mode 100644 index 0000000..ed8cf69 --- /dev/null +++ b/commands/Fun/ship.js @@ -0,0 +1,13 @@ +exports.run = (bot, msg) => { + msg.channel.send(msg.author.username + ' x ' + msg.guild.members.random().displayName + ' :cruise_ship:'); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'ship', + description: 'Test the luck of your love life! Ships you with another user.', +}; diff --git a/commands/Fun/story.js b/commands/Fun/story.js new file mode 100644 index 0000000..037b7cb --- /dev/null +++ b/commands/Fun/story.js @@ -0,0 +1,27 @@ +exports.run = async (bot, msg) => { + msg.guild.fetchMembers().then(guild => + { + const membersList = guild.members.array(); + const selectedUser1 = membersList[Math.floor(Math.random() * membersList.length)].user; + const selectedUser2 = membersList[Math.floor(Math.random() * membersList.length)].user; + const selectedUser3 = membersList[Math.floor(Math.random() * membersList.length)].user; + + const stories = + [ + 'Story 1 Alee says it\'s coming soon!.', + `Story 2 ${selectedUser1.username} jumps into the window then ${selectedUser2.username} saves ${selectedUser1.username} and ${selectedUser3.username} claps.`, + ]; + const storySelected = [Math.floor(Math.random() * stories.length)]; + msg.channel.send(stories[storySelected]); + }); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'story', + description: 'Tells you a story.', +}; diff --git a/commands/Getting Started/help.js b/commands/Getting Started/help.js new file mode 100644 index 0000000..13ac206 --- /dev/null +++ b/commands/Getting Started/help.js @@ -0,0 +1,31 @@ +exports.run = (bot, msg) => { + const { RichEmbed } = require('discord.js'); + const embed = new RichEmbed(); + embed + .setColor (0x00ae86) + .setDescription('Notice: When using a command do not include "<" and ">".\n(Example: p:suggest Test)') + .setFooter('PokeBot Beta'); + + const categories = Array.from(bot.categories.keys()); + categories.forEach(x => { + let cat = ''; + const commands = bot.categories.get(x); + commands.forEach(cmd => { + const command = bot.commands.get(x).get(cmd); + const usage = command.help.usage ? `*${command.help.usage}* ` : ''; + cat += `**p:${command.help.name}** ${usage}| ${command.help.description} \n`; + }); + embed.addField(`${x} |`, cat); + }); + msg.channel.send({ embed }); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'help', + description: 'Displays this help message.', +}; diff --git a/commands/Information/contribute.js b/commands/Information/contribute.js new file mode 100644 index 0000000..6a578fe --- /dev/null +++ b/commands/Information/contribute.js @@ -0,0 +1,13 @@ +exports.run = (bot, msg) => { + msg.channel.send('Want to help the bot? Here you go: https://github.com/PokeWorld/PokeBot.'); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'contribute', + description: 'Contributing to the bot.', +}; diff --git a/commands/Information/ping.js b/commands/Information/ping.js new file mode 100644 index 0000000..f4e50e4 --- /dev/null +++ b/commands/Information/ping.js @@ -0,0 +1,13 @@ +exports.run = (bot, msg) => { + msg.channel.send(':ping_pong: Pong! ' + Math.floor(bot.ping) + 'ms.'); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'ping', + description: 'Pings the bot and replies with the latency.', +}; diff --git a/commands/Moderation/ban.js b/commands/Moderation/ban.js new file mode 100644 index 0000000..3582bc3 --- /dev/null +++ b/commands/Moderation/ban.js @@ -0,0 +1,40 @@ +exports.run = async (bot, msg, args) => { + if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permssion to ban members.'); + if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) return msg.reply('I don\'t have permssion to ban members.'); + + const member = msg.mentions.members.first(); + if (!member) return await msg.reply('Who am I gonna ban?'); + const reason = args.join(' ').slice(3 + member.user.id.length); + + await member.ban({ days: 7, reason: msg.author.tag + (reason ? ': ' + reason : '') }) + .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); + msg.channel.send(`Alright, I banned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); + + const { RichEmbed } = require('discord.js'); + try { + const embed = new RichEmbed() + .setColor(0x00ae86) + .setAuthor(member.user.tag, member.user.avatarURL) + .setTitle(`:hammer: **${member.user.tag}**`) + .setDescription(`*${member.user.tag}* was banned from the server by *${msg.author.tag}*.`) + .addField('Reason', reason ? reason : '*none*') + .addField('Moderator', msg.author.tag) + .setTimestamp() + .setFooter(`${msg.author.tag} banned ${member.user.tag}`, msg.author.avatarURL); + msg.guild.channels.find('name', 'logs').send({ embed }); + } + catch (err) { + console.error(err.stack); + } +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'ban', + description: 'Ban a user from this server.', + usage: '@user <...reason>', +}; diff --git a/commands/Moderation/kick.js b/commands/Moderation/kick.js new file mode 100644 index 0000000..040abb5 --- /dev/null +++ b/commands/Moderation/kick.js @@ -0,0 +1,23 @@ +exports.run = async (bot, msg, args) => { + if (!msg.member.hasPermission('KICK_MEMBERS')) return msg.reply('You don\'t have permssion to kick members.'); + if (!msg.guild.member(bot.user).hasPermission('KICK_MEMBERS')) return msg.reply('I don\'t have permssion to kick members.'); + + const member = msg.mentions.members.first(); + if (!member) return await msg.reply('Who am I gonna kick?'); + const reason = args.join(' ').slice(3 + member.user.id.length); + + await member.kick(msg.author.tag + ': ' + (reason ? ': ' + reason : '')) + .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); + msg.channel.send(`Alright, I kicked **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'kick', + description: 'Kick a user out of the server.', + usage: '@user <...reason>', +}; diff --git a/commands/Moderation/purge.js b/commands/Moderation/purge.js new file mode 100644 index 0000000..0540bb3 --- /dev/null +++ b/commands/Moderation/purge.js @@ -0,0 +1,30 @@ +exports.run = async (bot, msg, args) => { + if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permssion to manage messages.'); + if (!msg.guild.member(bot.user).hasPermission('MANAGE_MESSAGES')) return msg.reply('I don\'t have permssion to manage messages.'); + + const user = msg.mentions.users.first(); + const amount = parseInt(args[0]) ? parseInt(args[0]) : parseInt(args[1]); + + if (!amount) return msg.reply('How many message shall I delete?'); + if (!amount && !user) return msg.reply('Tell me the user and amount or the just the amount of messages to purge.'); + if (amount > 100 || amount < 3) return msg.reply('Choose an amount less than 98 and greater than 1'); + msg.delete(); + + let msgs = await msg.channel.fetchMessages({ limit: amount }); + if (user) { + const filterBy = user ? user.id : bot.user.id; + msgs = msgs.filter(m => m.author.id === filterBy).array().slice(0, amount); + } + msg.channel.bulkDelete(msgs).catch(error => console.log(error.stack)); +}; + +exports.conf = { + aliases: ['prune', 'rm'], + guildOnly: true, +}; + +exports.help = { + name: 'purge', + description: 'Get rid of messages quickly.', + usage: '@user ', +}; diff --git a/commands/Moderation/softban.js b/commands/Moderation/softban.js new file mode 100644 index 0000000..f95e3b8 --- /dev/null +++ b/commands/Moderation/softban.js @@ -0,0 +1,40 @@ +exports.run = async (bot, msg, args) => { + if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permssion to ban members.'); + if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) return msg.reply('I don\'t have permssion to ban members.'); + + const member = msg.mentions.members.first(); + if (!member) return await msg.reply('Who am I gonna softban?'); + const reason = args.join(' ').slice(3 + member.user.id.length); + + await member.ban({ days: 7, reason: msg.author.tag + ': ' + (reason ? reason : '') }) + .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); + await msg.guild.unban(member.user.id).catch(msg.reply('There was an error.')); + msg.channel.send(`Alright, I softbanned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); + const { RichEmbed } = require('discord.js'); + try { + const embed = new RichEmbed() + .setColor(0x00ae86) + .setAuthor(member.user.tag, member.user.avatarURL) + .setTitle(`:hammer: **${member.user.tag}**`) + .setDescription(`*${member.user.tag}* was softbanned from the server by *${msg.author.tag}*.`) + .addField('Reason', reason ? reason : '*none*') + .addField('Moderator', msg.author.tag) + .setTimestamp() + .setFooter(`${msg.author.tag} softbanned ${member.user.tag}`, msg.author.avatarURL); + msg.guild.channels.find('name', 'logs').send({ embed }); + } + catch (err) { + console.error(err.stack); + } +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'softban', + description: 'Kick the user and delete their messages.', + usage: '@user <...reason>', +}; diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js new file mode 100644 index 0000000..75d586c --- /dev/null +++ b/commands/Moderation/warn.js @@ -0,0 +1,32 @@ +exports.run = (bot, msg, args) => { + if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permssion to warn.'); + args.shift(); + const warnReason = args.join(' '); + const victim = msg.mentions.members.first(); + + msg.channel.send(`Successfully logged ${victim.user.tag}'s warning.`); + + const { RichEmbed } = require('discord.js'); + bot.channels.find('name', 'logs').send( + new RichEmbed() + .setColor(0x00ae86) + .setTitle(':warning: Warning') + .setAuthor(victim.user.tag, victim.user.avatarURL) + .addField('Warning Reason', warnReason) + .addField('ID', victim.id, true) + .addField('Created Account', victim.user.createdAt, true) + .setTimestamp() + .setFooter('Warned by: ' + msg.author.tag, msg.author.avatarURL) + ); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'warn', + description: 'Logs a warning to the user.', + usage : '@user ', +}; diff --git a/commands/Owners Only/poweroff.js b/commands/Owners Only/poweroff.js new file mode 100644 index 0000000..ddd0c56 --- /dev/null +++ b/commands/Owners Only/poweroff.js @@ -0,0 +1,20 @@ +exports.run = async (bot, msg) => { + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(msg.author.id)) { + msg.reply('Nope! You need the person who created this bot to use this command.'); + } + else { + await msg.reply(':warning: Pokebot is now powering off!'); + console.log('Pokebot is now powering off...'); + process.exit(0); + } +}; + +exports.conf = { + aliases: ['reboot', 'restart'], + guildOnly: true, +}; + +exports.help = { + name: 'poweroff', + description: 'Powers off the bot.', +}; diff --git a/commands/Owners Only/say.js b/commands/Owners Only/say.js new file mode 100644 index 0000000..0f8a6df --- /dev/null +++ b/commands/Owners Only/say.js @@ -0,0 +1,20 @@ +exports.run = async (bot, msg, args) => { + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(msg.author.id)) { + msg.reply('Nope! You need the person who created this bot to use this command.'); + } + else { + msg.channel.send(args.join(' ')); + msg.delete(); + } +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'say', + description: 'Control on what the bot says.', + usage: '<...text>', +}; diff --git a/commands/Teams/join.js b/commands/Teams/join.js new file mode 100644 index 0000000..c9ba26e --- /dev/null +++ b/commands/Teams/join.js @@ -0,0 +1,60 @@ +exports.run = async (bot, msg, args) => { + if (args.length < 1) return msg.reply('Please choose a team to join'); + + const team = findTeam(msg, args[0]); + switch(args[0]) + { + case 'mystic': { + msg.member.addRole(msg.guild.roles.find('name', 'Mystic')); + msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Mystic.`); + break; + } + case 'valor' : { + msg.member.addRole(msg.guild.roles.find('name', 'Valor')); + msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Valor.`); + break; + } + case 'instinct' : { + msg.member.addRole(msg.guild.roles.find('name', 'Instinct')); + msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Instinct.`); + break; + } + default : { + msg.reply('You have to pick, mystic, valor, or instinct.'); + break; + } + } +}; + +function findTeam(msg, team) { + + let oldTeam; + + if (msg.member.roles.find('name', 'Mystic')) { + if (team == 'mystic') return; + msg.member.removeRole(msg.guild.roles.find('name', 'Mystic')); + oldTeam = 'Mystic'; + } + else if (msg.member.roles.find('name', 'Valor')) { + if (team == 'valor') return; + msg.member.removeRole(msg.guild.roles.find('name', 'Valor')); + oldTeam = 'Valor'; + } + else if (msg.member.roles.find('name', 'Instinct')) { + if (team == 'instinct') return; + msg.member.removeRole(msg.guild.roles.find('name', 'Instinct')); + oldTeam = 'Instinct'; + } + return oldTeam; +} + +exports.conf = { + aliases: ['pick', 'choose'], + guildOnly: true, +}; + +exports.help = { + name: 'join', + description: 'Join one of the teams!', + usage: '', +}; diff --git a/commands/Teams/leave.js b/commands/Teams/leave.js new file mode 100644 index 0000000..c22a1f2 --- /dev/null +++ b/commands/Teams/leave.js @@ -0,0 +1,27 @@ +exports.run = async (bot, msg) => { + if (msg.member.roles.find('name', 'Mystic')) { + msg.member.removeRole(msg.guild.roles.find('name', 'Mystic')); + msg.reply('Alright, you are not longer in team Mystic.'); + } + else if (msg.member.roles.find('name', 'Valor')) { + msg.member.removeRole(msg.guild.roles.find('name', 'Valor')); + msg.reply('Alright, you are not longer in team Valor.'); + } + else if (msg.member.roles.find('name', 'Instinct')) { + msg.member.removeRole(msg.guild.roles.find('name', 'Instinct')); + msg.reply('Alright, you are not longer in team Instinct.'); + } + else { + msg.reply('You are not in a team.'); + } +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'leave', + description: 'Leave the team you currently are in.', +}; diff --git a/commands/Utility/suggest.js b/commands/Utility/suggest.js new file mode 100644 index 0000000..831d222 --- /dev/null +++ b/commands/Utility/suggest.js @@ -0,0 +1,24 @@ +exports.run = (bot, msg, args) => { + const { RichEmbed } = require('discord.js'); + bot.channels.get('416726932927938570').send( + new RichEmbed() + .setColor (0x00ae86) + .setTitle('Suggestion') + .setDescription('This is a suggestion from a community member for something relating to the server. Please rate it based on your opinion, and a staff member will decide what to do with the suggestion.') + .addField('Suggestion Contents', args.join(' ')) + ).then(message => { + message.react('\u2705'); + message.react('\u274E'); + }); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'suggest', + description: 'Suggest a feature for the bot or the server.', + usage: '<...suggestion>', +}; diff --git a/commands/Utility/uptime.js b/commands/Utility/uptime.js new file mode 100644 index 0000000..63bd6a4 --- /dev/null +++ b/commands/Utility/uptime.js @@ -0,0 +1,24 @@ +exports.run = (bot, msg) => { + let uptime = parseInt(bot.uptime); + uptime = Math.floor(uptime / 1000); + let uptimeMinutes = Math.floor(uptime / 60); + const minutes = uptime % 60; + let hours = 0; + while (uptimeMinutes >= 60) { + hours++; + uptimeMinutes = uptimeMinutes - 60; + } + const uptimeSeconds = minutes % 60; + msg.channel.send(':clock3: Pokebot has been up for ' + hours + ' hours, ' + uptimeMinutes + ' minutes, and ' + uptimeSeconds + ' seconds.'); + +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'uptime', + description: 'Get the uptime of the bot.', +}; diff --git a/commands/ban.js b/commands/ban.js deleted file mode 100644 index 902b4fd..0000000 --- a/commands/ban.js +++ /dev/null @@ -1,41 +0,0 @@ -exports.run = async (bot, msg, args) => { - if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permssion to ban members.'); - if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) return msg.reply('I don\'t have permssion to ban members.'); - - const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who am I gonna ban?'); - const reason = args.join(' ').slice(3 + member.user.id.length); - - await member.ban({ days: 7, reason: msg.author.tag + (reason ? ': ' + reason : '') }) - .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); - msg.channel.send(`Alright, I banned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); - - const { RichEmbed } = require('discord.js'); - try { - const embed = new RichEmbed() - .setColor(0x00ae86) - .setAuthor(member.user.tag, member.user.avatarURL) - .setTitle(`:hammer: **${member.user.tag}**`) - .setDescription(`*${member.user.tag}* was banned from the server by *${msg.author.tag}*.`) - .addField('Reason', reason ? reason : '*none*') - .addField('Moderator', msg.author.tag) - .setTimestamp() - .setFooter(`${msg.author.tag} banned ${member.user.tag}`, msg.author.avatarURL); - msg.guild.channels.find('name', 'logs').send({ embed }); - } - catch (err) { - console.error(err.stack); - } -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'ban', - description: 'Ban a user from this server.', - usage: '@user <...reason>', - category: 'Moderation', -}; diff --git a/commands/contribute.js b/commands/contribute.js deleted file mode 100644 index b6a2d6f..0000000 --- a/commands/contribute.js +++ /dev/null @@ -1,14 +0,0 @@ -exports.run = (bot, msg) => { - msg.channel.send('Want to help the bot? Here you go: https://github.com/PokeWorld/PokeBot.'); -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'contribute', - description: 'Contributing to the bot.', - category: 'Information', -}; diff --git a/commands/cureboredom.js b/commands/cureboredom.js deleted file mode 100644 index e011c80..0000000 --- a/commands/cureboredom.js +++ /dev/null @@ -1,24 +0,0 @@ -exports.run = (bot, msg, args) => { - const ideas = [ - 'Pokemon Go to the polls :ballot_box:', - 'Consuming Maccas :fries:', - 'Fighting AstralMod :right_facing_fist:', - 'Joining a team :handshake:', - 'Have a battle :crossed_swords:', - ]; - - if (args[0] === 'list') return msg.channel.send(ideas.join('\n')); - - msg.channel.send(ideas[Math.floor(Math.random() * ideas.length)]); -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'cureboredom', - description: 'Finds you something to do.', - category: 'Fun', -}; diff --git a/commands/help.js b/commands/help.js deleted file mode 100644 index 6e97fcd..0000000 --- a/commands/help.js +++ /dev/null @@ -1,40 +0,0 @@ -exports.run = (bot, msg) => { - const { RichEmbed } = require('discord.js'); - const embed = new RichEmbed(); - embed - .setColor (0x00ae86) - .setDescription('Notice: When using a command do not include "<" and ">".\n(Example: p:suggest Test)') - .setFooter('PokeBot Beta'); - - const categories = []; - const commands = Array.from(bot.commands.keys()); - - commands.forEach(function(x) { - if (!categories.includes(bot.commands.get(x).help.category)) { - categories.push(bot.commands.get(x).help.category); - } - }); - - categories.forEach(function(x) { - let cat = ''; - commands.forEach(function(command) { - if (bot.commands.get(command).help.category == x) { - const usage = bot.commands.get(command).help.usage ? `*${bot.commands.get(command).help.usage}* ` : ''; - cat += `**p:${command}** ${usage}| ${bot.commands.get(command).help.description} \n`; - } - }); - embed.addField(`${x} |`, cat); - }); - msg.channel.send({ embed }); -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'help', - description: 'Displays this help message.', - category: 'Getting Started', -}; diff --git a/commands/join.js b/commands/join.js deleted file mode 100644 index dc3ba84..0000000 --- a/commands/join.js +++ /dev/null @@ -1,61 +0,0 @@ -exports.run = async (bot, msg, args) => { - if (args.length < 1) return msg.reply('Please choose a team to join'); - - const team = findTeam(msg, args[0]); - switch(args[0]) - { - case 'mystic': { - msg.member.addRole(msg.guild.roles.find('name', 'Mystic')); - msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Mystic.`); - break; - } - case 'valor' : { - msg.member.addRole(msg.guild.roles.find('name', 'Valor')); - msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Valor.`); - break; - } - case 'instinct' : { - msg.member.addRole(msg.guild.roles.find('name', 'Instinct')); - msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Instinct.`); - break; - } - default : { - msg.reply('You have to pick, mystic, valor, or instinct.'); - break; - } - } -}; - -function findTeam(msg, team) { - - let oldTeam; - - if (msg.member.roles.find('name', 'Mystic')) { - if (team == 'mystic') return; - msg.member.removeRole(msg.guild.roles.find('name', 'Mystic')); - oldTeam = 'Mystic'; - } - else if (msg.member.roles.find('name', 'Valor')) { - if (team == 'valor') return; - msg.member.removeRole(msg.guild.roles.find('name', 'Valor')); - oldTeam = 'Valor'; - } - else if (msg.member.roles.find('name', 'Instinct')) { - if (team == 'instinct') return; - msg.member.removeRole(msg.guild.roles.find('name', 'Instinct')); - oldTeam = 'Instinct'; - } - return oldTeam; -} - -exports.conf = { - aliases: ['pick', 'choose'], - guildOnly: true, -}; - -exports.help = { - name: 'join', - description: 'Join one of the teams!', - usage: '', - category: 'Teams', -}; diff --git a/commands/kick.js b/commands/kick.js deleted file mode 100644 index b015d01..0000000 --- a/commands/kick.js +++ /dev/null @@ -1,24 +0,0 @@ -exports.run = async (bot, msg, args) => { - if (!msg.member.hasPermission('KICK_MEMBERS')) return msg.reply('You don\'t have permssion to kick members.'); - if (!msg.guild.member(bot.user).hasPermission('KICK_MEMBERS')) return msg.reply('I don\'t have permssion to kick members.'); - - const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who am I gonna kick?'); - const reason = args.join(' ').slice(3 + member.user.id.length); - - await member.kick(msg.author.tag + ': ' + (reason ? ': ' + reason : '')) - .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); - msg.channel.send(`Alright, I kicked **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'kick', - description: 'Kick a user out of the server.', - usage: '@user <...reason>', - category: 'Moderation', -}; diff --git a/commands/leave.js b/commands/leave.js deleted file mode 100644 index 850d7ce..0000000 --- a/commands/leave.js +++ /dev/null @@ -1,28 +0,0 @@ -exports.run = async (bot, msg) => { - if (msg.member.roles.find('name', 'Mystic')) { - msg.member.removeRole(msg.guild.roles.find('name', 'Mystic')); - msg.reply('Alright, you are not longer in team Mystic.'); - } - else if (msg.member.roles.find('name', 'Valor')) { - msg.member.removeRole(msg.guild.roles.find('name', 'Valor')); - msg.reply('Alright, you are not longer in team Valor.'); - } - else if (msg.member.roles.find('name', 'Instinct')) { - msg.member.removeRole(msg.guild.roles.find('name', 'Instinct')); - msg.reply('Alright, you are not longer in team Instinct.'); - } - else { - msg.reply('You are not in a team.'); - } -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'leave', - description: 'Leave the team you currently are in.', - category: 'Teams', -}; diff --git a/commands/og151.js b/commands/og151.js deleted file mode 100644 index fd7f3e5..0000000 --- a/commands/og151.js +++ /dev/null @@ -1,168 +0,0 @@ -exports.run = (bot, msg) => { - const pokemon = [ - 'Abra', - 'Aerodactyl', - 'Alakazam', - 'Arbok', - 'Arcanine', - 'Articuno', - 'Beedrill', - 'Bellsprout', - 'Blastoise', - 'Bulbasaur', - 'Butterfree', - 'Caterpie', - 'Chansey', - 'Charizard', - 'Charmander', - 'Charmeleon', - 'Clefable', - 'Clefairy', - 'Cloyster', - 'Cubone', - 'Dewgong', - 'Diglett', - 'Ditto', - 'Dodrio', - 'Doduo', - 'Dragonair', - 'Dragonite', - 'Dratini', - 'Drowzee', - 'Dugtrio', - 'Eevee', - 'Ekans', - 'Electabuzz', - 'Electrode', - 'Exeggcute', - 'Exeggutor', - 'Farfetch’d', - 'Fearow', - 'Flareon', - 'Gastly', - 'Gengar', - 'Geodude', - 'Gloom', - 'Golbat', - 'Goldeen', - 'Golduck', - 'Golem', - 'Graveler', - 'Grimer', - 'Growlithe', - 'Gyarados', - 'Haunter', - 'Hitmonchan', - 'Hitmonlee', - 'Horsea', - 'Hypno', - 'Ivysaur', - 'Jigglypuff', - 'Jolteon', - 'Jynx', - 'Kabuto', - 'Kabutops', - 'Kadabra', - 'Kakuna', - 'Kangaskhan', - 'Kingler', - 'Koffing', - 'Krabby', - 'Lapras', - 'Lickitung', - 'Machamp', - 'Machoke', - 'Machop', - 'Magikarp', - 'Magmar', - 'Magnemite', - 'Magneton', - 'Mankey', - 'Marowak', - 'Meowth', - 'Metapod', - 'Mew', - 'Mewtwo', - 'Moltres', - 'Mr. Mime', - 'Muk', - 'Nidoking', - 'Nidoqueen', - 'Nidoran♀', - 'Nidoran♂', - 'Nidorina', - 'Nidorino', - 'Ninetales', - 'Oddish', - 'Omanyte', - 'Omastar', - 'Onix', - 'Paras', - 'Parasect', - 'Persian', - 'Pidgeot', - 'Pidgeotto', - 'Pidgey', - 'Pikachu', - 'Pinsir', - 'Poliwag', - 'Poliwhirl', - 'Poliwrath', - 'Ponyta', - 'Porygon', - 'Primeape', - 'Psyduck', - 'Raichu', - 'Rapidash', - 'Raticate', - 'Rattata', - 'Rhydon', - 'Rhyhorn', - 'Sandshrew', - 'Sandslash', - 'Scyther', - 'Seadra', - 'Seaking', - 'Seel', - 'Shellder', - 'Slowbro', - 'Slowpoke', - 'Snorlax', - 'Spearow', - 'Squirtle', - 'Starmie', - 'Staryu', - 'Tangela', - 'Tauros', - 'Tentacool', - 'Tentacruel', - 'Vaporeon', - 'Venomoth', - 'Venonat', - 'Venusaur', - 'Victreebel', - 'Vileplume', - 'Voltorb', - 'Vulpix', - 'Wartortle', - 'Weedle', - 'Weepinbell', - 'Weezing', - 'Wigglytuff', - 'Zapdos', - 'Zubat', - ]; - - msg.channel.send(pokemon[Math.floor(Math.random() * pokemon.length)]); -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'og151', - description: 'Randomly picks one of the generation 1 pokemon, and gives you its name.', - category: 'Fun', -}; diff --git a/commands/ping.js b/commands/ping.js deleted file mode 100644 index d1d9204..0000000 --- a/commands/ping.js +++ /dev/null @@ -1,14 +0,0 @@ -exports.run = (bot, msg) => { - msg.channel.send(':ping_pong: Pong! ' + Math.floor(bot.ping) + 'ms.'); -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'ping', - description: 'Pings the bot and replies with the latency.', - category:'Information', -}; diff --git a/commands/poweroff.js b/commands/poweroff.js deleted file mode 100644 index ae2ec67..0000000 --- a/commands/poweroff.js +++ /dev/null @@ -1,21 +0,0 @@ -exports.run = async (bot, msg) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(msg.author.id)) { - msg.reply('Nope! You need the person who created this bot to use this command.'); - } - else { - await msg.reply(':warning: Pokebot is now powering off!'); - console.log('Pokebot is now powering off...'); - process.exit(0); - } -}; - -exports.conf = { - aliases: ['reboot', 'restart'], - guildOnly: true, -}; - -exports.help = { - name: 'poweroff', - description: 'Powers off the bot.', - category: 'Owners Only', -}; diff --git a/commands/purge.js b/commands/purge.js deleted file mode 100644 index f02cb0a..0000000 --- a/commands/purge.js +++ /dev/null @@ -1,31 +0,0 @@ -exports.run = async (bot, msg, args) => { - if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permssion to manage messages.'); - if (!msg.guild.member(bot.user).hasPermission('MANAGE_MESSAGES')) return msg.reply('I don\'t have permssion to manage messages.'); - - const user = msg.mentions.users.first(); - const amount = parseInt(args[0]) ? parseInt(args[0]) : parseInt(args[1]); - - if (!amount) return msg.reply('How many message shall I delete?'); - if (!amount && !user) return msg.reply('Tell me the user and amount or the just the amount of messages to purge.'); - if (amount > 100 || amount < 3) return msg.reply('Choose an amount less than 98 and greater than 1'); - msg.delete(); - - let msgs = await msg.channel.fetchMessages({ limit: amount }); - if (user) { - const filterBy = user ? user.id : bot.user.id; - msgs = msgs.filter(m => m.author.id === filterBy).array().slice(0, amount); - } - msg.channel.bulkDelete(msgs).catch(error => console.log(error.stack)); -}; - -exports.conf = { - aliases: ['prune', 'rm'], - guildOnly: true, -}; - -exports.help = { - name: 'purge', - description: 'Get rid of messages quickly.', - usage: '@user ', - category:'Moderation', -}; diff --git a/commands/say.js b/commands/say.js deleted file mode 100644 index 1d57a06..0000000 --- a/commands/say.js +++ /dev/null @@ -1,21 +0,0 @@ -exports.run = async (bot, msg, args) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(msg.author.id)) { - msg.reply('Nope! You need the person who created this bot to use this command.'); - } - else { - msg.channel.send(args.join(' ')); - msg.delete(); - } -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'say', - description: 'Control on what the bot says.', - usage: '<...text>', - category: 'Owners Only', -}; diff --git a/commands/ship.js b/commands/ship.js deleted file mode 100644 index 8282bf3..0000000 --- a/commands/ship.js +++ /dev/null @@ -1,14 +0,0 @@ -exports.run = (bot, msg) => { - msg.channel.send(msg.author.username + ' x ' + msg.guild.members.random().displayName + ' :cruise_ship:'); -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'ship', - description: 'Test the luck of your love life! Ships you with another user.', - category: 'Fun', -}; diff --git a/commands/softban.js b/commands/softban.js deleted file mode 100644 index 3044090..0000000 --- a/commands/softban.js +++ /dev/null @@ -1,41 +0,0 @@ -exports.run = async (bot, msg, args) => { - if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permssion to ban members.'); - if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) return msg.reply('I don\'t have permssion to ban members.'); - - const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who am I gonna softban?'); - const reason = args.join(' ').slice(3 + member.user.id.length); - - await member.ban({ days: 7, reason: msg.author.tag + ': ' + (reason ? reason : '') }) - .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); - await msg.guild.unban(member.user.id).catch(msg.reply('There was an error.')); - msg.channel.send(`Alright, I softbanned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); - const { RichEmbed } = require('discord.js'); - try { - const embed = new RichEmbed() - .setColor(0x00ae86) - .setAuthor(member.user.tag, member.user.avatarURL) - .setTitle(`:hammer: **${member.user.tag}**`) - .setDescription(`*${member.user.tag}* was softbanned from the server by *${msg.author.tag}*.`) - .addField('Reason', reason ? reason : '*none*') - .addField('Moderator', msg.author.tag) - .setTimestamp() - .setFooter(`${msg.author.tag} softbanned ${member.user.tag}`, msg.author.avatarURL); - msg.guild.channels.find('name', 'logs').send({ embed }); - } - catch (err) { - console.error(err.stack); - } -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'softban', - description: 'Kick the user and delete their messages.', - usage: '@user <...reason>', - category: 'Moderation', -}; diff --git a/commands/story.js b/commands/story.js deleted file mode 100644 index 85e535e..0000000 --- a/commands/story.js +++ /dev/null @@ -1,28 +0,0 @@ -exports.run = async (bot, msg) => { - msg.guild.fetchMembers().then(guild => - { - const membersList = guild.members.array(); - const selectedUser1 = membersList[Math.floor(Math.random() * membersList.length)].user; - const selectedUser2 = membersList[Math.floor(Math.random() * membersList.length)].user; - const selectedUser3 = membersList[Math.floor(Math.random() * membersList.length)].user; - - const stories = - [ - 'Story 1 Alee says it\'s coming soon!.', - `Story 2 ${selectedUser1.username} jumps into the window then ${selectedUser2.username} saves ${selectedUser1.username} and ${selectedUser3.username} claps.`, - ]; - const storySelected = [Math.floor(Math.random() * stories.length)]; - msg.channel.send(stories[storySelected]); - }); -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'story', - description: 'Tells you a story.', - category: 'Fun', -}; diff --git a/commands/suggest.js b/commands/suggest.js deleted file mode 100644 index 1332fde..0000000 --- a/commands/suggest.js +++ /dev/null @@ -1,25 +0,0 @@ -exports.run = (bot, msg, args) => { - const { RichEmbed } = require('discord.js'); - bot.channels.get('416726932927938570').send( - new RichEmbed() - .setColor (0x00ae86) - .setTitle('Suggestion') - .setDescription('This is a suggestion from a community member for something relating to the server. Please rate it based on your opinion, and a staff member will decide what to do with the suggestion.') - .addField('Suggestion Contents', args.join(' ')) - ).then(message => { - message.react('\u2705'); - message.react('\u274E'); - }); -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'suggest', - description: 'Suggest a feature for the bot or the server.', - usage: '<...suggestion>', - category: 'Utility', -}; diff --git a/commands/uptime.js b/commands/uptime.js deleted file mode 100644 index 3c2f177..0000000 --- a/commands/uptime.js +++ /dev/null @@ -1,25 +0,0 @@ -exports.run = (bot, msg) => { - let uptime = parseInt(bot.uptime); - uptime = Math.floor(uptime / 1000); - let uptimeMinutes = Math.floor(uptime / 60); - const minutes = uptime % 60; - let hours = 0; - while (uptimeMinutes >= 60) { - hours++; - uptimeMinutes = uptimeMinutes - 60; - } - const uptimeSeconds = minutes % 60; - msg.channel.send(':clock3: Pokebot has been up for ' + hours + ' hours, ' + uptimeMinutes + ' minutes, and ' + uptimeSeconds + ' seconds.'); - -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'uptime', - description: 'Get the uptime of the bot.', - category: 'Utility', -}; diff --git a/commands/warn.js b/commands/warn.js deleted file mode 100644 index 88305a0..0000000 --- a/commands/warn.js +++ /dev/null @@ -1,33 +0,0 @@ -exports.run = (bot, msg, args) => { - if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permssion to warn.'); - args.shift(); - const warnReason = args.join(' '); - const victim = msg.mentions.members.first(); - - msg.channel.send(`Successfully logged ${victim.user.tag}'s warning.`); - - const { RichEmbed } = require('discord.js'); - bot.channels.find('name', 'logs').send( - new RichEmbed() - .setColor(0x00ae86) - .setTitle(':warning: Warning') - .setAuthor(victim.user.tag, victim.user.avatarURL) - .addField('Warning Reason', warnReason) - .addField('ID', victim.id, true) - .addField('Created Account', victim.user.createdAt, true) - .setTimestamp() - .setFooter('Warned by: ' + msg.author.tag, msg.author.avatarURL) - ); -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'warn', - description: 'Logs a warning to the user.', - usage : '@user ', - category: 'Moderation', -}; -- cgit v1.2.3