mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2025-09-21 06:41:35 +01:00
Some checks are pending
Docker / build (push) Waiting to run
* add simple music functionality * update workflow * update Dockerfile * update Dockerfile * update Dockerfile * update Dockerfile * add few more music commands * add lyrics command * update lyrics command * add loop, and add categories to all commands * change discord status * seperate distube and change startup console theme * Update README * UPDATE LICENSE file * fix docker compose image, add better error handling for distube and update tagging workflow * switch to node-alpine image for docker * switch to node-alpine image for docker * update ascii * music commands imporvements, implement live lyrics, some guards and bot leaving on empty * use ffmpeg package rather than ffmpeg-static
38 lines
1 KiB
JavaScript
38 lines
1 KiB
JavaScript
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
|
const UserEconomy = require("../../models/UserEconomy");
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName("balance")
|
|
.setDescription("Check your balance."),
|
|
category: "Economy",
|
|
|
|
async execute(interaction) {
|
|
const { user, guild } = interaction;
|
|
|
|
let userEconomy = await UserEconomy.findOne({
|
|
userId: user.id,
|
|
guildId: guild.id,
|
|
});
|
|
|
|
if (!userEconomy) {
|
|
userEconomy = await UserEconomy.create({
|
|
userId: user.id,
|
|
guildId: guild.id,
|
|
balance: 0,
|
|
});
|
|
}
|
|
|
|
const embed = new EmbedBuilder()
|
|
.setColor("#0099ff")
|
|
.setTitle(`${user.username}'s Balance`)
|
|
.setDescription(`Your balance: **${userEconomy.balance}** coins.`)
|
|
.setFooter({
|
|
text: `Requested by ${user.username}`,
|
|
iconURL: user.displayAvatarURL(),
|
|
})
|
|
.setTimestamp();
|
|
|
|
await interaction.reply({ embeds: [embed] });
|
|
},
|
|
};
|