From 18b9aa86e4c0cf60a7fb9d75b97f990dea5f2686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Sun, 9 Sep 2018 20:19:15 +0200 Subject: [PATCH] testing thing --- commands/admin/{giverank.js => assignrank.js} | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) rename commands/admin/{giverank.js => assignrank.js} (74%) diff --git a/commands/admin/giverank.js b/commands/admin/assignrank.js similarity index 74% rename from commands/admin/giverank.js rename to commands/admin/assignrank.js index 123a9ba8..d1c53a54 100644 --- a/commands/admin/giverank.js +++ b/commands/admin/assignrank.js @@ -1,13 +1,12 @@ const { Command } = require('discord.js-commando'); -module.exports = class GiveRankCommand extends Command { +module.exports = class GAssignRankCommand extends Command { constructor(client) { super(client, { - name: 'giverank', + name: 'assignrank', group: 'admin', - memberName: 'giverank', + memberName: 'Assignrank', description: 'Assign a rank to the mentionned user', clientPermissions: ['MANAGE_ROLES'], - userPermissions: ['MANAGE_ROLES'], guildOnly: true, args: [ { @@ -27,9 +26,12 @@ module.exports = class GiveRankCommand extends Command { run(message, { rank, member }) { const role = message.guild.roles.find('name', rank); member = message.mentions.members.first(); + if (!message.mentions.users.size) { + return message.channel.send(`You succesfully gived the rank **${rank}** to yourself: ${message.author.addRole(role)}`); + } if (!role) { message.say("The rank you tried to assign dosent exist ( or bot have a lower rank than the one you tried to assign"); - } else + } else if (userPermissions = 'MANAGE_ROLES') member.addRole(role); message.say(`You successfully gived the rank **${rank}** to **${member}**`); }