Prettified Code!

This commit is contained in:
itohatweb
2021-05-21 15:55:49 +00:00
committed by GitHub Action
parent 71a20fb0f4
commit 179add27c9
271 changed files with 889 additions and 3067 deletions
+3 -12
View File
@@ -8,16 +8,10 @@ import { snowflakeToBigint } from "../../util/bigint.ts";
export async function handleChannelDelete(data: DiscordGatewayPayload) {
const payload = data.d as Channel;
const cachedChannel = await cacheHandlers.get(
"channels",
snowflakeToBigint(payload.id)
);
const cachedChannel = await cacheHandlers.get("channels", snowflakeToBigint(payload.id));
if (!cachedChannel) return;
if (
cachedChannel.type === DiscordChannelTypes.GuildVoice &&
payload.guildId
) {
if (cachedChannel.type === DiscordChannelTypes.GuildVoice && payload.guildId) {
const guild = await cacheHandlers.get("guilds", cachedChannel.guildId);
if (guild) {
@@ -47,10 +41,7 @@ export async function handleChannelDelete(data: DiscordGatewayPayload) {
) {
await cacheHandlers.delete("channels", snowflakeToBigint(payload.id));
cacheHandlers.forEach("messages", (message) => {
eventHandlers.debug?.(
"loop",
`Running forEach messages loop in CHANNEL_DELTE file.`
);
eventHandlers.debug?.("loop", `Running forEach messages loop in CHANNEL_DELTE file.`);
if (message.channelId === snowflakeToBigint(payload.id)) {
cacheHandlers.delete("messages", message.id);
}