Skip to content

Commit

Permalink
Cache on method execution (Misc/getUserGuilds)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakkographic committed Aug 31, 2024
1 parent 730e1aa commit 8b966e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/routes/Misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ export class Miscellaneous {
path: endpoints.USER_SERVERS(userID)
}).then(data =>
data.servers.map(d =>
new Guild(d, this.#manager.client)
this.#manager.client.guilds.has(d.id)
? this.#manager.client.guilds.update(new Guild(d, this.#manager.client))
: this.#manager.client.guilds.add(new Guild(d, this.#manager.client))
)
);
}
Expand Down

0 comments on commit 8b966e7

Please sign in to comment.