mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
refactor: rename controllers to handlers and handlers to helpers (#660)
* refactor: rename controllers to handlers and handlers to helpers * fmt
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import { DiscordPayload, MessageDeleteBulkPayload } from "../../types/mod.ts";
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
|
||||
export async function handleMessageDeleteBulk(data: DiscordPayload) {
|
||||
const payload = data.d as MessageDeleteBulkPayload;
|
||||
const channel = await cacheHandlers.get("channels", payload.channel_id);
|
||||
if (!channel) return;
|
||||
|
||||
return Promise.all(payload.ids.map(async (id) => {
|
||||
eventHandlers.messageDelete?.(
|
||||
{ id, channel },
|
||||
await cacheHandlers.get("messages", id),
|
||||
);
|
||||
await cacheHandlers.delete("messages", id);
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user