From daccc918bdb45582f546d756a1d34fd441219477 Mon Sep 17 00:00:00 2001 From: CorwinDev <88144943+CorwinDev@users.noreply.github.com> Date: Sat, 17 Dec 2022 21:01:29 +0100 Subject: [PATCH] Fixed 2 bugs --- src/commands/economy/rob.js | 4 ++-- src/commands/profile/gender.js | 17 ++++++----------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/commands/economy/rob.js b/src/commands/economy/rob.js index 5b42e7c..14a5da7 100644 --- a/src/commands/economy/rob.js +++ b/src/commands/economy/rob.js @@ -30,7 +30,7 @@ module.exports = async (client, interaction, args) => { Schema.findOne({ Guild: interaction.guild.id, User: user.id }, async (err, targetData) => { if (targetData) { var targetMoney = targetData.Money; - if (targetData = undefined || !targetData || targetData.Money == 0 || targetData.Money < 0) { + if (targetData = undefined || !targetData || targetMoney == 0 || targetMoney < 0) { return client.errNormal({ error: `${user.username} does not have anything you can rob!`, type: 'editreply' }, interaction); } @@ -80,7 +80,7 @@ module.exports = async (client, interaction, args) => { }, interaction); } else { - return client.errNormal({ error: `${user.user.username} does not have anything you can rob!`, type: 'editreply' }, interaction); + return client.errNormal({ error: `${user.username} does not have anything you can rob!`, type: 'editreply' }, interaction); } }) } diff --git a/src/commands/profile/gender.js b/src/commands/profile/gender.js index 3f2f190..3d25d30 100644 --- a/src/commands/profile/gender.js +++ b/src/commands/profile/gender.js @@ -36,21 +36,16 @@ module.exports = async (client, interaction, args) => { }, interaction).then(msg => { const filter = i => i.user.id === interaction.user.id; - interaction.channel.awaitMessageComponent({ filter, max: 1, componentType: 'SELECT_MENU' }).then(async i => { + interaction.channel.awaitMessageComponent({ filter, max: 1, componentType: Discord.ComponentType.StringSelect }).then(i => { if (i.customId == 'gender-setup') { data.Gender = i.values[0]; data.save(); - client.api.interactions(i.id, i.token).callback.post({ - data: { - type: 4, - data: { - content: `Your gender is set`, - embeds: [], - flags: 64, - } - } - }); + client.succNormal({ + text: "Set your gender to " + i.values[0], + type: 'editreply', + components: [], + }, interaction); } }) })