mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
Prettified Code!
This commit is contained in:
@@ -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);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user