Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SiebeBaree committed Jun 26, 2022
1 parent 396404f commit c1d249f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commands/economy/work.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ module.exports.execute = async (client, interaction, data) => {
return interaction.reply({ content: `You don't have a job. Please find a job using \`/job list\`.`, ephemeral: true });
}

await interaction.deferReply();

let salary = 0;
data.hasBusiness = false;
if (data.guildUser.job === "business") {
Expand All @@ -231,13 +233,12 @@ module.exports.execute = async (client, interaction, data) => {
$set: { job: "" }
});
await client.cooldown.removeCooldown(interaction.guildId, interaction.member.id, "work");
return interaction.reply({ content: `Something went wrong. Please try again.`, ephemeral: true });
return interaction.editReply({ content: `You don't have a valid job... Please apply for a LEGAL job next time. You can't work if you dont have a LEGAL job.` });
}

salary = job.salary;
}
data.salary = salary;
await interaction.deferReply();

const minigame = client.tools.randomNumber(0, 1);
switch (minigame) {
Expand Down

0 comments on commit c1d249f

Please sign in to comment.