fix: more typing errors

This commit is contained in:
Skillz4Killz
2021-04-12 18:09:15 +00:00
committed by GitHub
parent f7024a5bf0
commit 8523a5ceea
7 changed files with 67 additions and 16 deletions
@@ -3,10 +3,10 @@ import { eventHandlers } from "../../bot.ts";
import { cacheHandlers } from "../../cache.ts";
import { structures } from "../../structures/mod.ts";
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
import { Interaction } from "../../types/mod.ts";
import { DiscordInteraction } from "../../types/mod.ts";
export async function handleInteractionCreate(data: DiscordGatewayPayload) {
const payload = data.d as Interaction;
const payload = data.d as DiscordInteraction;
const discordenoMember = await structures.createDiscordenoMember(
payload.member,
payload.guild_id,
+6 -5
View File
@@ -2,15 +2,16 @@ import { eventHandlers } from "../../bot.ts";
import { cacheHandlers } from "../../cache.ts";
import { structures } from "../../structures/mod.ts";
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
import { DiscordMessage } from "../../types/messages/message.ts";
import { DiscordMessage, Message } from "../../types/messages/message.ts";
import { snakeKeysToCamelCase } from "../../util/utils.ts";
export async function handleMessageCreate(data: DiscordGatewayPayload) {
const payload = data.d as DiscordMessage;
const channel = await cacheHandlers.get("channels", payload.channel_id);
const payload = snakeKeysToCamelCase(data.d as DiscordMessage) as Message;
const channel = await cacheHandlers.get("channels", payload.channelId);
if (channel) channel.lastMessageId = payload.id;
const guild = payload.guild_id
? await cacheHandlers.get("guilds", payload.guild_id)
const guild = payload.guildId
? await cacheHandlers.get("guilds", payload.guildId)
: undefined;
if (payload.member && guild) {