Skip to content

Commit

Permalink
Update MessageCreate.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasB25 committed Aug 29, 2024
1 parent f6513fe commit 03520e4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/events/client/MessageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export default class MessageCreate extends Event {
const intervalMilliseconds = BigInt(ticketActivityCheckInterval * 60 * 1000);

for (const { activityAt, lastCheckTime = 0n, channelId } of tickets) {
if (activityAt === null || lastCheckTime === null) {
this.client.logger.error(`Ticket ${channelId} has null activityAt or lastCheckTime.`);
continue;
}

const lastActivity = BigInt(activityAt);

if (now - lastActivity > intervalMilliseconds && now - BigInt(lastCheckTime) > intervalMilliseconds) {
Expand Down

0 comments on commit 03520e4

Please sign in to comment.