boos crumble snapshot
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
const {
|
||||||
|
showCrumbSaucer
|
||||||
|
} = require(
|
||||||
|
"../../utils/crumbSaucer"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name:
|
||||||
|
"crumbSaucerBack",
|
||||||
|
|
||||||
|
|
||||||
|
async execute(interaction) {
|
||||||
|
return showCrumbSaucer(
|
||||||
|
interaction
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,224 @@
|
|||||||
|
const {
|
||||||
|
EmbedBuilder,
|
||||||
|
ActionRowBuilder,
|
||||||
|
ButtonBuilder,
|
||||||
|
ButtonStyle
|
||||||
|
} = require("discord.js");
|
||||||
|
|
||||||
|
const {
|
||||||
|
getCookieBalance,
|
||||||
|
temporaryEphemeralReply
|
||||||
|
} = require(
|
||||||
|
"../../utils/cookieEconomy"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name:
|
||||||
|
"crumbSaucerHeist",
|
||||||
|
|
||||||
|
|
||||||
|
async execute(interaction) {
|
||||||
|
const footer =
|
||||||
|
interaction.message
|
||||||
|
.embeds[0]
|
||||||
|
?.footer
|
||||||
|
?.text;
|
||||||
|
|
||||||
|
|
||||||
|
const [
|
||||||
|
type,
|
||||||
|
ownerId
|
||||||
|
] =
|
||||||
|
footer
|
||||||
|
?.split(":")
|
||||||
|
??
|
||||||
|
[];
|
||||||
|
|
||||||
|
|
||||||
|
if (
|
||||||
|
type !==
|
||||||
|
"crumbSaucer" ||
|
||||||
|
ownerId !==
|
||||||
|
interaction.user.id
|
||||||
|
) {
|
||||||
|
return temporaryEphemeralReply(
|
||||||
|
interaction,
|
||||||
|
{
|
||||||
|
content:
|
||||||
|
"This isn't your Crumb Saucer session."
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const vaultId =
|
||||||
|
interaction.client.user.id;
|
||||||
|
|
||||||
|
|
||||||
|
const [
|
||||||
|
vault,
|
||||||
|
player
|
||||||
|
] =
|
||||||
|
await Promise.all([
|
||||||
|
getCookieBalance(
|
||||||
|
vaultId
|
||||||
|
),
|
||||||
|
|
||||||
|
getCookieBalance(
|
||||||
|
interaction.user.id
|
||||||
|
)
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
if (
|
||||||
|
player < 1
|
||||||
|
) {
|
||||||
|
return temporaryEphemeralReply(
|
||||||
|
interaction,
|
||||||
|
{
|
||||||
|
content:
|
||||||
|
"You need at least **1 Cookie** before attempting a vault heist."
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (
|
||||||
|
vault < 1
|
||||||
|
) {
|
||||||
|
return temporaryEphemeralReply(
|
||||||
|
interaction,
|
||||||
|
{
|
||||||
|
content:
|
||||||
|
"The ShaiBot Vault is currently empty."
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const embed =
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setTitle(
|
||||||
|
"🏦 ShaiBot Cookie Vault"
|
||||||
|
)
|
||||||
|
.setDescription(
|
||||||
|
[
|
||||||
|
`**Vault Balance:** ${vault.toLocaleString()} 🍪`,
|
||||||
|
`**Security:** ${getSecurityLabel(vault)}`,
|
||||||
|
"",
|
||||||
|
"Choose your approach.",
|
||||||
|
"",
|
||||||
|
"🥷 **Sneak**",
|
||||||
|
"High chance • Small haul • Small fine",
|
||||||
|
"",
|
||||||
|
"💻 **Hack**",
|
||||||
|
"Medium chance • Medium haul • Medium fine",
|
||||||
|
"",
|
||||||
|
"💥 **Smash**",
|
||||||
|
"Low chance • Large haul • Large fine"
|
||||||
|
].join("\n")
|
||||||
|
)
|
||||||
|
.setFooter({
|
||||||
|
text:
|
||||||
|
`cookieHeist:${interaction.user.id}`
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const heistButtons =
|
||||||
|
new ActionRowBuilder()
|
||||||
|
.addComponents(
|
||||||
|
new ButtonBuilder()
|
||||||
|
.setCustomId(
|
||||||
|
"cookieHeistSneak"
|
||||||
|
)
|
||||||
|
.setLabel(
|
||||||
|
"Sneak"
|
||||||
|
)
|
||||||
|
.setEmoji(
|
||||||
|
"🥷"
|
||||||
|
)
|
||||||
|
.setStyle(
|
||||||
|
ButtonStyle.Primary
|
||||||
|
),
|
||||||
|
|
||||||
|
new ButtonBuilder()
|
||||||
|
.setCustomId(
|
||||||
|
"cookieHeistHack"
|
||||||
|
)
|
||||||
|
.setLabel(
|
||||||
|
"Hack"
|
||||||
|
)
|
||||||
|
.setEmoji(
|
||||||
|
"💻"
|
||||||
|
)
|
||||||
|
.setStyle(
|
||||||
|
ButtonStyle.Secondary
|
||||||
|
),
|
||||||
|
|
||||||
|
new ButtonBuilder()
|
||||||
|
.setCustomId(
|
||||||
|
"cookieHeistSmash"
|
||||||
|
)
|
||||||
|
.setLabel(
|
||||||
|
"Smash"
|
||||||
|
)
|
||||||
|
.setEmoji(
|
||||||
|
"💥"
|
||||||
|
)
|
||||||
|
.setStyle(
|
||||||
|
ButtonStyle.Danger
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
return interaction.update({
|
||||||
|
embeds: [
|
||||||
|
embed
|
||||||
|
],
|
||||||
|
|
||||||
|
components: [
|
||||||
|
heistButtons
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
function getSecurityLabel(
|
||||||
|
vault
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
vault <
|
||||||
|
1000
|
||||||
|
) {
|
||||||
|
return "🟢 Low";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (
|
||||||
|
vault <
|
||||||
|
10000
|
||||||
|
) {
|
||||||
|
return "🟡 Moderate";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (
|
||||||
|
vault <
|
||||||
|
50000
|
||||||
|
) {
|
||||||
|
return "🟠 High";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (
|
||||||
|
vault <
|
||||||
|
250000
|
||||||
|
) {
|
||||||
|
return "🔴 Very High";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return "🟣 Maximum";
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
const {
|
||||||
|
showSlots
|
||||||
|
} = require(
|
||||||
|
"../../utils/crumbSaucer"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name:
|
||||||
|
"crumbSaucerSlots",
|
||||||
|
|
||||||
|
|
||||||
|
async execute(interaction) {
|
||||||
|
return showSlots(
|
||||||
|
interaction
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
const {
|
||||||
|
playSlots
|
||||||
|
} = require(
|
||||||
|
"../../utils/crumbSaucer"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name:
|
||||||
|
"crumbSaucerSlots10",
|
||||||
|
|
||||||
|
|
||||||
|
async execute(interaction) {
|
||||||
|
return playSlots(
|
||||||
|
interaction,
|
||||||
|
10
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
const {
|
||||||
|
playSlots
|
||||||
|
} = require(
|
||||||
|
"../../utils/crumbSaucer"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name:
|
||||||
|
"crumbSaucerSlots100",
|
||||||
|
|
||||||
|
|
||||||
|
async execute(interaction) {
|
||||||
|
return playSlots(
|
||||||
|
interaction,
|
||||||
|
100
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
const {
|
||||||
|
playSlots
|
||||||
|
} = require(
|
||||||
|
"../../utils/crumbSaucer"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name:
|
||||||
|
"crumbSaucerSlots1000",
|
||||||
|
|
||||||
|
|
||||||
|
async execute(interaction) {
|
||||||
|
return playSlots(
|
||||||
|
interaction,
|
||||||
|
1000
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
const {
|
||||||
|
playSlots
|
||||||
|
} = require(
|
||||||
|
"../../utils/crumbSaucer"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name:
|
||||||
|
"crumbSaucerSlots50",
|
||||||
|
|
||||||
|
|
||||||
|
async execute(interaction) {
|
||||||
|
return playSlots(
|
||||||
|
interaction,
|
||||||
|
50
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
const {
|
||||||
|
playSlots
|
||||||
|
} = require(
|
||||||
|
"../../utils/crumbSaucer"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name:
|
||||||
|
"crumbSaucerSlots500",
|
||||||
|
|
||||||
|
|
||||||
|
async execute(interaction) {
|
||||||
|
return playSlots(
|
||||||
|
interaction,
|
||||||
|
500
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
+767
-846
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
|||||||
|
const {
|
||||||
|
SlashCommandBuilder
|
||||||
|
} = require("discord.js");
|
||||||
|
|
||||||
|
const {
|
||||||
|
showCrumbSaucer
|
||||||
|
} = require("../../utils/crumbSaucer");
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
data: new SlashCommandBuilder()
|
||||||
|
.setName("crumbsaucer")
|
||||||
|
.setDescription(
|
||||||
|
"Visit the Crumb Saucer."
|
||||||
|
),
|
||||||
|
|
||||||
|
|
||||||
|
async execute(interaction) {
|
||||||
|
return showCrumbSaucer(
|
||||||
|
interaction
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user