Skip to content

Commit

Permalink
Create esportCuts.js
Browse files Browse the repository at this point in the history
  • Loading branch information
TisMeCastle committed Feb 19, 2024
1 parent c5ee751 commit d5a33ff
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions commands/Server/esportCuts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const { SlashCommandBuilder } = require("@discordjs/builders");

module.exports = {
data: new SlashCommandBuilder()
.setName("cuts")
.setDescription("blah")
.addStringOption((option) =>
option
.setName("roster_split_cost")
.setDescription("m")
.setRequired(true)
)
.addStringOption((option) =>
option
.setName("roster_split_earnings")
.setDescription("m")
.setRequired(true)
)
.addStringOption((option) =>
option
.setName("earnings_cut_percentage")
.setDescription("m")
.setRequired(true)
),
async execute(interaction) {

if (interaction.options.getString("roster_split_earnings") * (interaction.options.getString("earnings_cut_percentage") * .01) - interaction.options.getString("roster_split_cost") > 0) {
interaction.reply({
content: `You will be making \`$${interaction.options.getString("roster_split_earnings") * (interaction.options.getString("earnings_cut_percentage") * .01) - interaction.options.getString("roster_split_cost")}\` per split!\nThat's a \`${Math.round(interaction.options.getString("roster_split_earnings") * (interaction.options.getString("earnings_cut_percentage") * .01)) / interaction.options.getString("roster_split_cost") * 100 }%\` earnings per split!`,
ephemeral: true
});
} else {
interaction.reply({
content: `You will be loosing \`$${interaction.options.getString("roster_split_earnings") * (interaction.options.getString("earnings_cut_percentage") * .01) - interaction.options.getString("roster_split_cost")}\` per split!\nThat's a \`${Math.round((interaction.options.getString("roster_split_earnings") * (interaction.options.getString("earnings_cut_percentage") * .01) / interaction.options.getString("roster_split_cost")) * 100) - 100}%\` loss per split!`,
ephemeral: true
});
}


}
}

0 comments on commit d5a33ff

Please sign in to comment.