mirror of
https://github.com/jaronpate/unicord.git
synced 2026-10-18 21:47:40 +00:00
refactor: decouple system events from command dispatch and add explicit system event handlers and improve gateway handling
This commit is contained in:
@@ -16,8 +16,8 @@ export class UnicordObjectCache<Entity> {
|
||||
this.cache = new LRUCache<string, Entity>(maxCapacity);
|
||||
this.type = type;
|
||||
for (const event of events) {
|
||||
this.self.onEvent(event, async (_context, e) => {
|
||||
this.cache.set(e.id, factory[Trait.fromDiscord](e));
|
||||
this.self.onSystemEvent(event, async (payload) => {
|
||||
this.cache.set(payload.id, factory[Trait.fromDiscord](payload));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user