From 673f0d08104892b65384d13e02acfb5e0e01e629 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 4 Apr 2025 19:03:54 +0100 Subject: [PATCH] Remove restriction that the last drop can only be claimed by the user who dropped it --- src/buttonEvents/Claim.ts | 6 ------ src/buttonEvents/Reroll.ts | 2 -- src/client/client.ts | 1 - src/commands/drop.ts | 2 -- src/commands/stage/dropnumber.ts | 2 -- src/commands/stage/droprarity.ts | 2 -- 6 files changed, 15 deletions(-) diff --git a/src/buttonEvents/Claim.ts b/src/buttonEvents/Claim.ts index 5f37b86..d139f42 100644 --- a/src/buttonEvents/Claim.ts +++ b/src/buttonEvents/Claim.ts @@ -1,7 +1,6 @@ import { ButtonInteraction } from "discord.js"; import { ButtonEvent } from "../type/buttonEvent"; import Inventory from "../database/entities/app/Inventory"; -import { CoreClient } from "../client/client"; import { default as eClaim } from "../database/entities/app/Claim"; import AppLogger from "../client/appLogger"; import User from "../database/entities/app/User"; @@ -43,11 +42,6 @@ export default class Claim extends ButtonEvent { return; } - if (claimId == CoreClient.ClaimId && userId != droppedBy) { - await interaction.channel.send(`${interaction.user}, The latest dropped card can only be claimed by the user who dropped it!`); - return; - } - let inventory = await Inventory.FetchOneByCardNumberAndUserId(userId, cardNumber); if (!inventory) { diff --git a/src/buttonEvents/Reroll.ts b/src/buttonEvents/Reroll.ts index b1ac12c..6d97024 100644 --- a/src/buttonEvents/Reroll.ts +++ b/src/buttonEvents/Reroll.ts @@ -80,8 +80,6 @@ export default class Reroll extends ButtonEvent { files: files, components: [ row ], }); - - CoreClient.ClaimId = claimId; } catch (e) { AppLogger.LogError("Button/Reroll", `Error sending next drop for card ${randomCard.card.id}: ${e}`); diff --git a/src/client/client.ts b/src/client/client.ts index 87b496e..57551fb 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -31,7 +31,6 @@ export class CoreClient extends Client { private _webhooks: Webhooks; private _timerHelper: TimerHelper; - public static ClaimId: string; public static Environment: Environment; public static AllowDrops: boolean; public static Cards: SeriesMetadata[]; diff --git a/src/commands/drop.ts b/src/commands/drop.ts index 57a2123..ac8008c 100644 --- a/src/commands/drop.ts +++ b/src/commands/drop.ts @@ -88,8 +88,6 @@ export default class Drop extends Command { components: [ row ], }); - CoreClient.ClaimId = claimId; - } catch (e) { AppLogger.LogError("Commands/Drop", `Error sending next drop for card ${randomCard.card.id}: ${e}`); diff --git a/src/commands/stage/dropnumber.ts b/src/commands/stage/dropnumber.ts index f9391d2..d04f8d3 100644 --- a/src/commands/stage/dropnumber.ts +++ b/src/commands/stage/dropnumber.ts @@ -81,7 +81,5 @@ export default class Dropnumber extends Command { await interaction.editReply("Unable to send next drop. Please try again, and report this if it keeps happening. Code: UNKNOWN"); } } - - CoreClient.ClaimId = claimId; } } \ No newline at end of file diff --git a/src/commands/stage/droprarity.ts b/src/commands/stage/droprarity.ts index 75f8a7f..270b454 100644 --- a/src/commands/stage/droprarity.ts +++ b/src/commands/stage/droprarity.ts @@ -83,7 +83,5 @@ export default class Droprarity extends Command { await interaction.editReply("Unable to send next drop. Please try again, and report this if it keeps happening. Code: UNKNOWN"); } } - - CoreClient.ClaimId = claimId; } } \ No newline at end of file