refactor(handlers): move presence/* to misc/* (#677)

This commit is contained in:
ayntee
2021-03-17 16:32:45 +04:00
committed by GitHub
parent eba5679806
commit 489aa6d166
4 changed files with 3 additions and 3 deletions
+11
View File
@@ -0,0 +1,11 @@
import { eventHandlers } from "../../bot.ts";
import { DiscordPayload, PresenceUpdatePayload } from "../../types/mod.ts";
import { cacheHandlers } from "../../cache.ts";
export async function handlePresenceUpdate(data: DiscordPayload) {
const payload = data.d as PresenceUpdatePayload;
const oldPresence = await cacheHandlers.get("presences", payload.user.id);
await cacheHandlers.set("presences", payload.user.id, payload);
eventHandlers.presenceUpdate?.(payload, oldPresence);
}