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,15 +8,10 @@ import { snowflakeToBigint } from "../../util/bigint.ts";
export async function handleMessageCreate(data: DiscordGatewayPayload) {
const payload = data.d as Message;
const channel = await cacheHandlers.get(
"channels",
snowflakeToBigint(payload.channelId)
);
const channel = await cacheHandlers.get("channels", snowflakeToBigint(payload.channelId));
if (channel) channel.lastMessageId = snowflakeToBigint(payload.id);
const guild = payload.guildId
? await cacheHandlers.get("guilds", snowflakeToBigint(payload.guildId))
: undefined;
const guild = payload.guildId ? await cacheHandlers.get("guilds", snowflakeToBigint(payload.guildId)) : undefined;
if (payload.member && guild) {
// If in a guild cache the author as a member
@@ -37,11 +32,7 @@ export async function handleMessageCreate(data: DiscordGatewayPayload) {
guild.id
);
return cacheHandlers.set(
"members",
snowflakeToBigint(mention.id),
discordenoMember
);
return cacheHandlers.set("members", snowflakeToBigint(mention.id), discordenoMember);
}
})
);