-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5ee751
commit d5a33ff
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}); | ||
} | ||
|
||
|
||
} | ||
} |