skopa/commands/currency/balance.js

20 lines
640 B
JavaScript

//Boring init stuff
const { SlashCommandBuilder } = require('discord.js');
const helpers = require('../../helpers.js');
module.exports = {
//Creates the slash command
data: new SlashCommandBuilder()
.setName('balance')
.setDescription('Shows your (or a specified user\'s) ospCoin balance.')
.addUserOption(option =>
option
.setName('user')
.setDescription('User\'s balance to display')),
//Executes said slash command
async execute(interaction) {
const target = interaction.options.getUser('user') ?? interaction.user;
return interaction.reply(`${target.tag} has ${helpers.getBalance(target.id)} ospCoin`);
},
};