obama-bot/commands/setcoins.js
2020-11-28 17:38:23 +01:00

28 lines
859 B
JavaScript

const Discord = require('discord.js');
module.exports.meta = {
name: 'setcoins',
aliases: ['setcoin'],
staffOnly: true
}
const karma = require('../util/karma').karma;
const coins = require('../util/karma').coins;
module.exports.run = async (message, args) => {
let member = message.mentions.members.first();
if (!member) return message.channel.send('You need to @mention a member!')
if (!coins.get(member.id)) coins.set(member.id, 0);
let old = coins.get(member.id);
if (isNaN(args[1])) return message.channel.send('Invalid number');
coins.set(member.id, Number(args[1]));
message.channel.send(
new Discord.MessageEmbed()
.setTitle('Coins updated')
.setDescription(`Coins for \`${member.user.tag}\` set to \`${coins.get(member.id)}\` (old: \`${old}\`)`)
.setColor('ddbd37')
)
}