mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
refactor(handlers): move presence/* to misc/* (#677)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user