added runtiback and allin
This commit is contained in:
+54
-23
@@ -91,7 +91,7 @@ async function resolveCookieHeist(
|
||||
|
||||
const footer =
|
||||
interaction.message
|
||||
.embeds[0]
|
||||
?.embeds?.[0]
|
||||
?.footer
|
||||
?.text;
|
||||
|
||||
@@ -101,12 +101,16 @@ async function resolveCookieHeist(
|
||||
ownerId
|
||||
] =
|
||||
footer?.split(":")
|
||||
?? [];
|
||||
??
|
||||
[];
|
||||
|
||||
|
||||
if (
|
||||
type !== "cookieHeist" ||
|
||||
ownerId !== interaction.user.id
|
||||
type !==
|
||||
"cookieHeist"
|
||||
||
|
||||
ownerId !==
|
||||
interaction.user.id
|
||||
) {
|
||||
return temporaryEphemeralReply(
|
||||
interaction,
|
||||
@@ -143,16 +147,6 @@ async function resolveCookieHeist(
|
||||
* ========================================================
|
||||
* SHARED HEIST COOLDOWN
|
||||
* ========================================================
|
||||
*
|
||||
* IMPORTANT:
|
||||
*
|
||||
* This is intentionally always "heist".
|
||||
*
|
||||
* It does NOT use:
|
||||
*
|
||||
* heistSneak
|
||||
* heistHack
|
||||
* heistSmash
|
||||
*/
|
||||
|
||||
const cooldown =
|
||||
@@ -164,7 +158,9 @@ async function resolveCookieHeist(
|
||||
);
|
||||
|
||||
|
||||
if (!cooldown.claimed) {
|
||||
if (
|
||||
!cooldown.claimed
|
||||
) {
|
||||
return temporaryEphemeralReply(
|
||||
interaction,
|
||||
{
|
||||
@@ -178,9 +174,6 @@ async function resolveCookieHeist(
|
||||
|
||||
/*
|
||||
* Lock this Heist interaction immediately.
|
||||
*
|
||||
* Prevents selecting another approach from
|
||||
* the same message.
|
||||
*/
|
||||
|
||||
await interaction.update({
|
||||
@@ -194,6 +187,10 @@ async function resolveCookieHeist(
|
||||
methodName
|
||||
)
|
||||
)
|
||||
.setFooter({
|
||||
text:
|
||||
`cookieHeist:${interaction.user.id}`
|
||||
})
|
||||
],
|
||||
|
||||
components: []
|
||||
@@ -203,6 +200,7 @@ async function resolveCookieHeist(
|
||||
const playerId =
|
||||
interaction.user.id;
|
||||
|
||||
|
||||
const vaultId =
|
||||
interaction.client.user.id;
|
||||
|
||||
@@ -228,8 +226,11 @@ async function resolveCookieHeist(
|
||||
|
||||
|
||||
if (
|
||||
playerCookies < 1 ||
|
||||
vaultCookies < 1
|
||||
playerCookies <
|
||||
1
|
||||
||
|
||||
vaultCookies <
|
||||
1
|
||||
) {
|
||||
return interaction.editReply({
|
||||
embeds: [
|
||||
@@ -247,6 +248,10 @@ async function resolveCookieHeist(
|
||||
value:
|
||||
`<t:${cooldown.next}:R>`
|
||||
})
|
||||
.setFooter({
|
||||
text:
|
||||
`cookieHeist:${playerId}`
|
||||
})
|
||||
],
|
||||
|
||||
components:
|
||||
@@ -349,6 +354,10 @@ async function resolveCookieHeist(
|
||||
value:
|
||||
`<t:${cooldown.next}:R>`
|
||||
})
|
||||
.setFooter({
|
||||
text:
|
||||
`cookieHeist:${playerId}`
|
||||
})
|
||||
],
|
||||
|
||||
components:
|
||||
@@ -476,7 +485,12 @@ async function resolveCookieHeist(
|
||||
inline:
|
||||
false
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
.setFooter({
|
||||
text:
|
||||
`cookieHeist:${playerId}`
|
||||
});
|
||||
|
||||
|
||||
return interaction.editReply({
|
||||
@@ -551,6 +565,10 @@ async function resolveCookieHeist(
|
||||
value:
|
||||
`<t:${cooldown.next}:R>`
|
||||
})
|
||||
.setFooter({
|
||||
text:
|
||||
`cookieHeist:${playerId}`
|
||||
})
|
||||
],
|
||||
|
||||
components:
|
||||
@@ -678,7 +696,12 @@ async function resolveCookieHeist(
|
||||
inline:
|
||||
false
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
.setFooter({
|
||||
text:
|
||||
`cookieHeist:${playerId}`
|
||||
});
|
||||
|
||||
|
||||
return interaction.editReply({
|
||||
@@ -894,7 +917,9 @@ function getFailureText(
|
||||
* ============================================================
|
||||
*/
|
||||
|
||||
function sleep(ms) {
|
||||
function sleep(
|
||||
ms
|
||||
) {
|
||||
return new Promise(
|
||||
resolve =>
|
||||
setTimeout(
|
||||
@@ -905,6 +930,12 @@ function sleep(ms) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ============================================================
|
||||
* EXPORTS
|
||||
* ============================================================
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
resolveCookieHeist,
|
||||
HEIST_COOLDOWN
|
||||
|
||||
Reference in New Issue
Block a user