fix: few more typings errors

This commit is contained in:
Skillz4Killz
2021-04-12 18:22:47 +00:00
committed by GitHub
parent 6d0529e8ce
commit 3ce5871eb9
5 changed files with 14 additions and 9 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ import { DiscordMessage, Message } from "../../types/messages/message.ts";
import { snakeKeysToCamelCase } from "../../util/utils.ts";
export async function handleMessageCreate(data: DiscordGatewayPayload) {
const payload: Message = snakeKeysToCamelCase(data.d as DiscordMessage);
const payload = snakeKeysToCamelCase(data.d as DiscordMessage) as Message;
const channel = await cacheHandlers.get("channels", payload.channelId);
if (channel) channel.lastMessageId = payload.id;
@@ -34,13 +34,13 @@ export async function handleMessageCreate(data: DiscordGatewayPayload) {
return cacheHandlers.set(
"members",
discordenoMember.id,
mention.id,
discordenoMember,
);
}
}));
const message = await structures.createDiscordenoMessage(payload);
const message = await structures.createDiscordenoMessage(data.d as DiscordMessage);
// Cache the message
await cacheHandlers.set("messages", payload.id, message);