From 9c33945ae715db894dc44d173683781dcf0cfd00 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Sun, 11 Oct 2020 17:55:13 -0600 Subject: [PATCH] dev checking --- commands/admin.js | 12 ++++++++++++ commands/developer.js | 7 ++++--- 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 commands/admin.js diff --git a/commands/admin.js b/commands/admin.js new file mode 100644 index 0000000..7da367b --- /dev/null +++ b/commands/admin.js @@ -0,0 +1,12 @@ +const Discord = require('discord.js'); + +module.exports = { + name: "admin", + help: new Discord.MessageEmbed() + .setTitle("Help -> Admin") + .setDescription("Make a user a Natsuki admin") + .addField("Syntax", ""), + async execute(message, msg, args, cmd, prefix, mention, client) { + if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);} + } +}; \ No newline at end of file diff --git a/commands/developer.js b/commands/developer.js index e7d424d..85fc3c9 100644 --- a/commands/developer.js +++ b/commands/developer.js @@ -13,10 +13,11 @@ module.exports = { async execute(message, msg, args, cmd, prefix, mention, client) { if (!message.guild) {return message.reply("This is a guild-only command!");} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}developer <@user|userID>\``);} - if (!['a', 'add', 'r', 'remove'].includes(args[0])) {return message.reply("You must specify whether to `add` or `remove` someone as a developer.");} let person = mention ? mention : args[1] ? client.users.cache.has(args[1]) ? client.users.cache.get(args[1]) : null : null; - if (!person) {return message.reply("You must mention someone to add as a developer, or use their ID.");} let tu = await UserData.findOne({uid: person.id}) ? await UserData.findOne({uid: person.id}) : new UserData({uid: person.id}); + if (['c', 'check'].includes(args[0])) {return message.reply(`${person ? person : message.member.displayName} ${tu.developer ? 'is' : 'is not'} a Natsuki developer.`);} + if (!['a', 'add', 'r', 'remove'].includes(args[0])) {return message.reply("You must specify whether to `add` or `remove` someone as a developer.");} + if (!person) {return message.reply("You must mention someone to add as a developer, or use their ID.");} let atu = await UserData.findOne({uid: message.author.id}); if (!atu && !atu.developer && !client.developers.includes(message.author.id)) {return message.reply('You must be a developer in order to add or remove someone else as a developer.');} tu.developer = ['a', 'add'].includes(args[0]); @@ -29,7 +30,7 @@ module.exports = { .setColor("e8da3a") .setFooter("Natsuki") .setTimestamp(); - client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb(['a', 'add'].includes(args[0]) ? 'Added' : 'Removed')); + client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb(['a', 'add'].includes(args[0]) ? 'Added' : 'Removed')); return message.reply(`<@${person.id}> is now a developer!`); } }; \ No newline at end of file