Skip to content

Commit

Permalink
Merge formatting
Browse files Browse the repository at this point in the history
Merge formatting into main
  • Loading branch information
github-actions[bot] authored Aug 17, 2024
2 parents c02742a + 7b02c7c commit fe1af8b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/events/entitlementCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const event: Event = {
: new Date(new Date().getTime() + 30 * 24 * 60 * 60 * 1000),
premiumUser: entitlement.userId,
},
)
);
},
};

Expand Down
3 changes: 1 addition & 2 deletions src/events/entitlementDelete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ const event: Event = {
premiumExpiration: null,
premiumUser: null,
},
)
);
},

};

export default event;
13 changes: 9 additions & 4 deletions src/events/entitlementUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ import WouldYou from "../util/wouldYou";

const event: Event = {
event: "entitlementUpdate",
execute: async (client: WouldYou, oldEntitlement: Entitlement, newEntitlement: Entitlement) => {
execute: async (
client: WouldYou,
oldEntitlement: Entitlement,
newEntitlement: Entitlement,
) => {
if (!newEntitlement.guildId) return;
const alreadyHasPremium = await client.premium.check(newEntitlement.guildId);
const alreadyHasPremium = await client.premium.check(
newEntitlement.guildId,
);

// Check if the guild already has premium and which expiration date is higher
if (
Expand All @@ -26,9 +32,8 @@ const event: Event = {
? new Date(newEntitlement?.endsTimestamp)
: new Date(new Date().getTime() + 30 * 24 * 60 * 60 * 1000),
},
)
);
},

};

export default event;

0 comments on commit fe1af8b

Please sign in to comment.