Balance slash cmd not working
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const profileModel = require('../Economy/profiles.js')
module.exports = {
data: new SlashCommandBuilder()
.setName('balance')
.setDescription('View your or another users balance.')
.addUserOption(option1 => option1.setName('user').setDescription('@example').setRequired(true)),
version: "1.0.0",
async execute(interaction, profileData){
const kai = ':Kai:'
const user = interaction.options.getUser('user')
const response = await profileModel.findOne({
userID: user.id
})
const balEmbed = new EmbedBuilder()
.setColor('#0099ff')
.setTitle(`${interaction.member.name}'s Balance.`)
.setDescription('You will find your balance below.')
.setFields([
{name: 'Wallet', value: `${response.kai}${kai}`},
{name: 'Bank', value: `${response.bank}${kai}`},
])
await interaction.reply({ embeds: [balEmbed]})
}
}const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const profileModel = require('../Economy/profiles.js')
module.exports = {
data: new SlashCommandBuilder()
.setName('balance')
.setDescription('View your or another users balance.')
.addUserOption(option1 => option1.setName('user').setDescription('@example').setRequired(true)),
version: "1.0.0",
async execute(interaction, profileData){
const kai = ':Kai:'
const user = interaction.options.getUser('user')
const response = await profileModel.findOne({
userID: user.id
})
const balEmbed = new EmbedBuilder()
.setColor('#0099ff')
.setTitle(`${interaction.member.name}'s Balance.`)
.setDescription('You will find your balance below.')
.setFields([
{name: 'Wallet', value: `${response.kai}${kai}`},
{name: 'Bank', value: `${response.bank}${kai}`},
])
await interaction.reply({ embeds: [balEmbed]})
}
}No error message shows