From 3c68e4366926415e0708ba5a8135f8e66187f449 Mon Sep 17 00:00:00 2001 From: CorwinDev <88144943+CorwinDev@users.noreply.github.com> Date: Mon, 2 Jan 2023 16:37:14 +0100 Subject: [PATCH] Fixed crash cmd --- src/commands/casino/crash.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/commands/casino/crash.js b/src/commands/casino/crash.js index 503a0d1..972edc7 100644 --- a/src/commands/casino/crash.js +++ b/src/commands/casino/crash.js @@ -136,6 +136,31 @@ module.exports = async (client, interaction, args) => { } }) + .catch(async () => { + index = result + 1; + + Schema.findOne({ Guild: interaction.guild.id, User: user.id }, + async (err, data) => { + if (data) { + data.Money -= money; + data.save(); + } + } + ) + return client.embed({ + desc: `Crash Results of ${user}`, + type: 'edit', + fields: [ + { + name: `Loss`, + value: `**${money}**`, + inline: false, + } + ], + components: [disableRow] + }, msg) + + }) }) }