UNPKG

free-code

Version:

Makes free code for discord.js command/bots

32 lines (24 loc) 1.09 kB
const { MessageEmbed } = require('discord.js') module.exports = { name : 'remove', description : 'Remove an amount of money from a member\'s balance!', ownerOnly: true, /** * @param {Client} client * @param {Message} message * @param {String[]} args */ run : async(client, message, args) => { const amount = args[0]; if(!amount) return message.reply('Please provide the amount of money to remove!'); if(isNaN(amount)) return message.reply('That is not a vaid amount!'); const mem = message.mentions.members.first() || message.guild.members.cache.get(args[1]); if(!mem) return message.reply('Member not found! Please mention a valid member!') const balance = await bal(mem.id, message.guild.id); await rmv(mem.id, message.guild.id, amount); const embed = new MessageEmbed() .setTitle("Success!! Amount Removed!") .setDescription(`Amount Removed - ${parseInt(amount)}`) await message.channel.send(embed) } }