2021-09-06 12:38:25 +02:00
|
|
|
const { MessageEmbed } = require("discord.js");
|
|
|
|
module.exports = {
|
|
|
|
name: "balance",
|
|
|
|
description: "Show an user's balance",
|
|
|
|
usage: "(User)",
|
|
|
|
category: "Economy",
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
type: 6,
|
|
|
|
name: "user",
|
2021-11-18 18:56:42 +01:00
|
|
|
description: "The user you want to see",
|
|
|
|
required: false,
|
2021-09-06 12:38:25 +02:00
|
|
|
},
|
|
|
|
],
|
|
|
|
type: "CHAT_INPUT",
|
|
|
|
run: async (client, interaction, args) => {
|
2021-11-18 18:56:42 +01:00
|
|
|
const user =
|
|
|
|
interaction.guild.members.cache.get(args[0]) || interaction.member;
|
2021-09-06 12:38:25 +02:00
|
|
|
const bal = await client.bal(user.id);
|
2021-11-18 18:56:42 +01:00
|
|
|
const embed = new MessageEmbed()
|
|
|
|
.setTitle(`${user.displayName}'s Balance`)
|
|
|
|
.setDescription(`**${bal}** ${client.currency}`)
|
2021-09-06 12:38:25 +02:00
|
|
|
.setColor(client.color)
|
|
|
|
.setURL(client.web)
|
|
|
|
.setTimestamp()
|
2021-11-18 18:56:42 +01:00
|
|
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL());
|
|
|
|
interaction.followUp({ embeds: [embed] });
|
2021-09-06 12:38:25 +02:00
|
|
|
},
|
|
|
|
};
|