UNPKG

free-code

Version:

Makes free code for discord.js command/bots

32 lines (24 loc) 1.08 kB
const { MessageEmbed } = require('discord.js') module.exports = { name : 'add', description : 'Add 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 add!'); 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 eadd(mem.id, message.guild.id, amount); const embed = new MessageEmbed() .setTitle("Success!! Amount Added!") .setDescription(`Amount Added - ${parseInt(amount)}`) await message.channel.send(embed) } }