Skip to content

Commit

Permalink
performance optimization. stop if no watch requests
Browse files Browse the repository at this point in the history
  • Loading branch information
theimperious1 committed Dec 25, 2024
1 parent fe02017 commit 60e2413
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/global/commands/g.watchuser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ export async function nightsWatch(message: Message) {

const watchRequests = user.watch_requests;

if (watchRequests.length === 0) {
return;
}

watchRequests.forEach(async watchRequestObj => {
const target = await message.client.users.fetch(user.discord_id as string) as User;

Expand Down

0 comments on commit 60e2413

Please sign in to comment.