mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: update cache before executing the event? (#313)
* fix: update cache before executing the event? * fix: remove unnecessary cache update in event handler
This commit is contained in:
parent
31af4675a3
commit
8b0ba23b1e
@ -189,15 +189,16 @@ export class EventHandler extends BaseHandler {
|
||||
}
|
||||
Event.fired = true;
|
||||
const hook = await RawEvents[name]?.(client, packet as never);
|
||||
await (Event.run as any)(hook, client, shardId);
|
||||
} catch (e) {
|
||||
await this.onFail(name, e);
|
||||
} finally {
|
||||
|
||||
if (runCache)
|
||||
await this.client.cache.onPacket({
|
||||
t: name,
|
||||
d: packet,
|
||||
} as GatewayDispatchPayload);
|
||||
|
||||
await (Event.run as any)(hook, client, shardId);
|
||||
} catch (e) {
|
||||
await this.onFail(name, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user