refactored and moved
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
const {
|
||||
performBossAction
|
||||
} = require(
|
||||
"../../utils/cookieBoss"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"cookieBossBurst",
|
||||
|
||||
async execute(interaction) {
|
||||
return performBossAction(
|
||||
interaction,
|
||||
"Burst"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
const {
|
||||
joinBoss
|
||||
} = require(
|
||||
"../../utils/cookieBoss"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"cookieBossJoinChampion",
|
||||
|
||||
async execute(interaction) {
|
||||
return joinBoss(
|
||||
interaction,
|
||||
"Champion"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
const {
|
||||
joinBoss
|
||||
} = require(
|
||||
"../../utils/cookieBoss"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"cookieBossJoinFighter",
|
||||
|
||||
async execute(interaction) {
|
||||
return joinBoss(
|
||||
interaction,
|
||||
"Fighter"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
const {
|
||||
joinBoss
|
||||
} = require(
|
||||
"../../utils/cookieBoss"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"cookieBossJoinScout",
|
||||
|
||||
async execute(interaction) {
|
||||
return joinBoss(
|
||||
interaction,
|
||||
"Scout"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
const {
|
||||
performBossAction
|
||||
} = require(
|
||||
"../../utils/cookieBoss"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"cookieBossLimit",
|
||||
|
||||
async execute(interaction) {
|
||||
return performBossAction(
|
||||
interaction,
|
||||
"Limit"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,17 +0,0 @@
|
||||
const {
|
||||
startBossBattle
|
||||
} = require(
|
||||
"../../utils/cookieBoss"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"cookieBossStart",
|
||||
|
||||
async execute(interaction) {
|
||||
return startBossBattle(
|
||||
interaction
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
const {
|
||||
performBossAction
|
||||
} = require(
|
||||
"../../utils/cookieBoss"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"cookieBossStrike",
|
||||
|
||||
async execute(interaction) {
|
||||
return performBossAction(
|
||||
interaction,
|
||||
"Strike"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -7,11 +7,19 @@ const {
|
||||
|
||||
const {
|
||||
getCookieBalance,
|
||||
getCooldown,
|
||||
getUnixTime,
|
||||
temporaryEphemeralReply
|
||||
} = require(
|
||||
"../../utils/cookieEconomy"
|
||||
);
|
||||
|
||||
const {
|
||||
HEIST_COOLDOWN
|
||||
} = require(
|
||||
"../../utils/cookieHeist"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
@@ -19,6 +27,10 @@ module.exports = {
|
||||
|
||||
|
||||
async execute(interaction) {
|
||||
/*
|
||||
* Verify ownership of the Crumb Saucer menu.
|
||||
*/
|
||||
|
||||
const footer =
|
||||
interaction.message
|
||||
.embeds[0]
|
||||
@@ -30,17 +42,13 @@ module.exports = {
|
||||
type,
|
||||
ownerId
|
||||
] =
|
||||
footer
|
||||
?.split(":")
|
||||
??
|
||||
[];
|
||||
footer?.split(":")
|
||||
?? [];
|
||||
|
||||
|
||||
if (
|
||||
type !==
|
||||
"crumbSaucer" ||
|
||||
ownerId !==
|
||||
interaction.user.id
|
||||
type !== "crumbSaucer" ||
|
||||
ownerId !== interaction.user.id
|
||||
) {
|
||||
return temporaryEphemeralReply(
|
||||
interaction,
|
||||
@@ -52,6 +60,43 @@ module.exports = {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* SHARED HEIST COOLDOWN PRE-CHECK
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
const now =
|
||||
getUnixTime();
|
||||
|
||||
|
||||
const cooldown =
|
||||
await getCooldown(
|
||||
interaction.user.id,
|
||||
interaction.guildId,
|
||||
"heist"
|
||||
);
|
||||
|
||||
|
||||
if (
|
||||
cooldown >
|
||||
now
|
||||
) {
|
||||
return temporaryEphemeralReply(
|
||||
interaction,
|
||||
{
|
||||
content:
|
||||
`🏦 The ShaiBot Vault is still on alert.\nYou can attempt another heist <t:${cooldown}:R>.`
|
||||
},
|
||||
6000
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Balances
|
||||
*/
|
||||
|
||||
const vaultId =
|
||||
interaction.client.user.id;
|
||||
|
||||
@@ -72,7 +117,8 @@ module.exports = {
|
||||
|
||||
|
||||
if (
|
||||
player < 1
|
||||
player <
|
||||
1
|
||||
) {
|
||||
return temporaryEphemeralReply(
|
||||
interaction,
|
||||
@@ -85,7 +131,8 @@ module.exports = {
|
||||
|
||||
|
||||
if (
|
||||
vault < 1
|
||||
vault <
|
||||
1
|
||||
) {
|
||||
return temporaryEphemeralReply(
|
||||
interaction,
|
||||
@@ -97,11 +144,16 @@ module.exports = {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Heist menu
|
||||
*/
|
||||
|
||||
const embed =
|
||||
new EmbedBuilder()
|
||||
.setTitle(
|
||||
"🏦 ShaiBot Cookie Vault"
|
||||
)
|
||||
|
||||
.setDescription(
|
||||
[
|
||||
`**Vault Balance:** ${vault.toLocaleString()} 🍪`,
|
||||
@@ -119,6 +171,7 @@ module.exports = {
|
||||
"Low chance • Large haul • Large fine"
|
||||
].join("\n")
|
||||
)
|
||||
|
||||
.setFooter({
|
||||
text:
|
||||
`cookieHeist:${interaction.user.id}`
|
||||
@@ -172,19 +225,43 @@ module.exports = {
|
||||
);
|
||||
|
||||
|
||||
const backButton =
|
||||
new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId(
|
||||
"crumbSaucerBack"
|
||||
)
|
||||
.setLabel(
|
||||
"Back to Crumb Saucer"
|
||||
)
|
||||
.setEmoji(
|
||||
"◀️"
|
||||
)
|
||||
.setStyle(
|
||||
ButtonStyle.Secondary
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
return interaction.update({
|
||||
embeds: [
|
||||
embed
|
||||
],
|
||||
|
||||
components: [
|
||||
heistButtons
|
||||
heistButtons,
|
||||
backButton
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* SECURITY LABEL
|
||||
*/
|
||||
|
||||
function getSecurityLabel(
|
||||
vault
|
||||
) {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
chooseCrumbleStrikeJob
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeJobAstrologian",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeJob(
|
||||
interaction,
|
||||
"Healer",
|
||||
"Astrologian"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
chooseCrumbleStrikeJob
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeJobBard",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeJob(
|
||||
interaction,
|
||||
"DPS",
|
||||
"Bard"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
chooseCrumbleStrikeJob
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeJobBlackMage",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeJob(
|
||||
interaction,
|
||||
"DPS",
|
||||
"BlackMage"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
chooseCrumbleStrikeJob
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeJobDarkKnight",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeJob(
|
||||
interaction,
|
||||
"Tank",
|
||||
"DarkKnight"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
chooseCrumbleStrikeJob
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeJobDragoon",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeJob(
|
||||
interaction,
|
||||
"DPS",
|
||||
"Dragoon"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
chooseCrumbleStrikeJob
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeJobPaladin",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeJob(
|
||||
interaction,
|
||||
"Tank",
|
||||
"Paladin"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
chooseCrumbleStrikeJob
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeJobScholar",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeJob(
|
||||
interaction,
|
||||
"Healer",
|
||||
"Scholar"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
chooseCrumbleStrikeJob
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeJobWarrior",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeJob(
|
||||
interaction,
|
||||
"Tank",
|
||||
"Warrior"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
chooseCrumbleStrikeJob
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeJobWhiteMage",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeJob(
|
||||
interaction,
|
||||
"Healer",
|
||||
"WhiteMage"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
const {
|
||||
chooseCrumbleStrikeRole
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeRoleDPS",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeRole(
|
||||
interaction,
|
||||
"DPS"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
const {
|
||||
chooseCrumbleStrikeRole
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeRoleHealer",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeRole(
|
||||
interaction,
|
||||
"Healer"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
const {
|
||||
chooseCrumbleStrikeRole
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeRoleTank",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseCrumbleStrikeRole(
|
||||
interaction,
|
||||
"Tank"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
const {
|
||||
startCrumbleStrikeBattle
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeStart",
|
||||
|
||||
async execute(interaction) {
|
||||
return startCrumbleStrikeBattle(
|
||||
interaction
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
const {
|
||||
confirmCrumbleStrikeJoin
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeTierAdventurer",
|
||||
|
||||
async execute(interaction) {
|
||||
return confirmCrumbleStrikeJoin(
|
||||
interaction,
|
||||
"Adventurer"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
const {
|
||||
confirmCrumbleStrikeJoin
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeTierSprout",
|
||||
|
||||
async execute(interaction) {
|
||||
return confirmCrumbleStrikeJoin(
|
||||
interaction,
|
||||
"Sprout"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
const {
|
||||
confirmCrumbleStrikeJoin
|
||||
} = require(
|
||||
"../../utils/crumbleStrike"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"crumbleStrikeTierWarriorOfLight",
|
||||
|
||||
async execute(interaction) {
|
||||
return confirmCrumbleStrikeJoin(
|
||||
interaction,
|
||||
"WarriorOfLight"
|
||||
);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user