From e7d9b58c81b75a70d6d7065cf24e81261c572e39 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Sun, 4 Apr 2021 00:34:08 +0000 Subject: [PATCH] fix: import of DiscordGatewayPayload --- src/handlers/channels/CHANNEL_CREATE.ts | 3 ++- src/handlers/channels/CHANNEL_DELETE.ts | 8 +++----- src/handlers/channels/CHANNEL_PINS_UPDATE.ts | 6 ++---- src/handlers/channels/CHANNEL_UPDATE.ts | 3 ++- src/handlers/commands/APPLICATION_COMMAND_CREATE.ts | 1 + src/handlers/commands/APPLICATION_COMMAND_DELETE.ts | 1 + src/handlers/commands/APPLICATION_COMMAND_UPDATE.ts | 1 + src/handlers/emojis/GUILD_EMOJIS_UPDATE.ts | 6 ++---- src/handlers/guilds/GUILD_BAN_ADD.ts | 1 + src/handlers/guilds/GUILD_BAN_REMOVE.ts | 1 + src/handlers/guilds/GUILD_CREATE.ts | 1 + src/handlers/guilds/GUILD_DELETE.ts | 2 ++ src/handlers/guilds/GUILD_INTEGRATIONS_UPDATE.ts | 2 ++ src/handlers/guilds/GUILD_UPDATE.ts | 2 ++ src/handlers/integrations/INTEGRATION_CREATE.ts | 1 + src/handlers/integrations/INTEGRATION_DELETE.ts | 1 + src/handlers/integrations/INTEGRATION_UPDATE.ts | 1 + src/handlers/interactions/INTERACTION_CREATE.ts | 1 + src/handlers/invites/INVITE_CREATE.ts | 2 ++ src/handlers/invites/INVITE_DELETE.ts | 2 ++ src/handlers/members/GUILD_MEMBERS_CHUNK.ts | 2 ++ src/handlers/members/GUILD_MEMBER_ADD.ts | 2 ++ src/handlers/members/GUILD_MEMBER_REMOVE.ts | 2 ++ src/handlers/members/GUILD_MEMBER_UPDATE.ts | 2 ++ src/handlers/messages/MESSAGE_CREATE.ts | 2 ++ src/handlers/messages/MESSAGE_DELETE.ts | 2 ++ src/handlers/messages/MESSAGE_DELETE_BULK.ts | 2 ++ src/handlers/messages/MESSAGE_REACTION_ADD.ts | 2 ++ src/handlers/messages/MESSAGE_REACTION_REMOVE.ts | 2 ++ src/handlers/messages/MESSAGE_REACTION_REMOVE_ALL.ts | 2 ++ src/handlers/messages/MESSAGE_REACTION_REMOVE_EMOJI.ts | 2 ++ src/handlers/messages/MESSAGE_UPDATE.ts | 2 ++ src/handlers/misc/PRESENCE_UPDATE.ts | 2 ++ src/handlers/misc/READY.ts | 2 ++ src/handlers/misc/TYPING_START.ts | 2 ++ src/handlers/misc/USER_UPDATE.ts | 2 ++ src/handlers/roles/GUILD_ROLE_CREATE.ts | 1 + src/handlers/roles/GUILD_ROLE_DELETE.ts | 2 ++ src/handlers/roles/GUILD_ROLE_UPDATE.ts | 1 + src/handlers/voice/VOICE_STATE_UPDATE.ts | 2 ++ src/handlers/webhooks/WEBHOOKS_UPDATE.ts | 2 ++ 41 files changed, 71 insertions(+), 15 deletions(-) diff --git a/src/handlers/channels/CHANNEL_CREATE.ts b/src/handlers/channels/CHANNEL_CREATE.ts index 06aa2c561..69a3642ad 100644 --- a/src/handlers/channels/CHANNEL_CREATE.ts +++ b/src/handlers/channels/CHANNEL_CREATE.ts @@ -1,7 +1,8 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; import { structures } from "../../structures/mod.ts"; -import { DiscordChannel, DiscordGatewayPayload } from "../../types/mod.ts"; +import { DiscordChannel } from "../../types/channels/channel.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export async function handleChannelCreate(data: DiscordGatewayPayload) { const payload = data.d as DiscordChannel; diff --git a/src/handlers/channels/CHANNEL_DELETE.ts b/src/handlers/channels/CHANNEL_DELETE.ts index 2a7f110eb..004863506 100644 --- a/src/handlers/channels/CHANNEL_DELETE.ts +++ b/src/handlers/channels/CHANNEL_DELETE.ts @@ -1,10 +1,8 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; -import { - DiscordChannel, - DiscordChannelTypes, - DiscordGatewayPayload, -} from "../../types/mod.ts"; +import { DiscordChannel } from "../../types/channels/channel.ts"; +import { DiscordChannelTypes } from "../../types/channels/channel_types.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export async function handleChannelDelete(data: DiscordGatewayPayload) { const payload = data.d as DiscordChannel; diff --git a/src/handlers/channels/CHANNEL_PINS_UPDATE.ts b/src/handlers/channels/CHANNEL_PINS_UPDATE.ts index 29ddb3a70..85234d64c 100644 --- a/src/handlers/channels/CHANNEL_PINS_UPDATE.ts +++ b/src/handlers/channels/CHANNEL_PINS_UPDATE.ts @@ -1,9 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; -import { - DiscordChannelPinsUpdate, - DiscordGatewayPayload, -} from "../../types/mod.ts"; +import { DiscordChannelPinsUpdate } from "../../types/channels/channel_pins_update.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export async function handleChannelPinsUpdate(data: DiscordGatewayPayload) { const payload = data.d as DiscordChannelPinsUpdate; diff --git a/src/handlers/channels/CHANNEL_UPDATE.ts b/src/handlers/channels/CHANNEL_UPDATE.ts index cb7658a6d..736e297f6 100644 --- a/src/handlers/channels/CHANNEL_UPDATE.ts +++ b/src/handlers/channels/CHANNEL_UPDATE.ts @@ -1,7 +1,8 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; import { structures } from "../../structures/mod.ts"; -import { DiscordChannel, DiscordGatewayPayload } from "../../types/mod.ts"; +import { DiscordChannel } from "../../types/channels/channel.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export async function handleChannelUpdate(data: DiscordGatewayPayload) { const payload = data.d as DiscordChannel; diff --git a/src/handlers/commands/APPLICATION_COMMAND_CREATE.ts b/src/handlers/commands/APPLICATION_COMMAND_CREATE.ts index 08acf2cb1..7b936b250 100644 --- a/src/handlers/commands/APPLICATION_COMMAND_CREATE.ts +++ b/src/handlers/commands/APPLICATION_COMMAND_CREATE.ts @@ -1,4 +1,5 @@ import { eventHandlers } from "../../bot.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export function handleApplicationCommandCreate( data: DiscordGatewayPayload, diff --git a/src/handlers/commands/APPLICATION_COMMAND_DELETE.ts b/src/handlers/commands/APPLICATION_COMMAND_DELETE.ts index 92a5bf25c..69b3f144d 100644 --- a/src/handlers/commands/APPLICATION_COMMAND_DELETE.ts +++ b/src/handlers/commands/APPLICATION_COMMAND_DELETE.ts @@ -1,4 +1,5 @@ import { eventHandlers } from "../../bot.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export function handleApplicationCommandDelete(data: DiscordGatewayPayload) { const { diff --git a/src/handlers/commands/APPLICATION_COMMAND_UPDATE.ts b/src/handlers/commands/APPLICATION_COMMAND_UPDATE.ts index db36be346..8e5328d33 100644 --- a/src/handlers/commands/APPLICATION_COMMAND_UPDATE.ts +++ b/src/handlers/commands/APPLICATION_COMMAND_UPDATE.ts @@ -1,4 +1,5 @@ import { eventHandlers } from "../../bot.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export function handleApplicationCommandUpdate(data: DiscordGatewayPayload) { const { diff --git a/src/handlers/emojis/GUILD_EMOJIS_UPDATE.ts b/src/handlers/emojis/GUILD_EMOJIS_UPDATE.ts index 83fce84bc..031f97bb5 100644 --- a/src/handlers/emojis/GUILD_EMOJIS_UPDATE.ts +++ b/src/handlers/emojis/GUILD_EMOJIS_UPDATE.ts @@ -1,10 +1,8 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; -import { - DiscordGatewayPayload, - DiscordGuildEmojisUpdate, -} from "../../types/mod.ts"; import { Collection } from "../../util/collection.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordGuildEmojisUpdate } from "../../types/emojis/guild_emojis_update.ts"; export async function handleGuildEmojisUpdate(data: DiscordGatewayPayload) { const payload = data.d as DiscordGuildEmojisUpdate; diff --git a/src/handlers/guilds/GUILD_BAN_ADD.ts b/src/handlers/guilds/GUILD_BAN_ADD.ts index 96d48d84a..7fa687f12 100644 --- a/src/handlers/guilds/GUILD_BAN_ADD.ts +++ b/src/handlers/guilds/GUILD_BAN_ADD.ts @@ -1,5 +1,6 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export async function handleGuildBanAdd(data: DiscordGatewayPayload) { const payload = data.d as DiscordGuildBanAddRemove; diff --git a/src/handlers/guilds/GUILD_BAN_REMOVE.ts b/src/handlers/guilds/GUILD_BAN_REMOVE.ts index 7b6c160c4..14022ede5 100644 --- a/src/handlers/guilds/GUILD_BAN_REMOVE.ts +++ b/src/handlers/guilds/GUILD_BAN_REMOVE.ts @@ -1,5 +1,6 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export async function handleGuildBanRemove(data: DiscordGatewayPayload) { const payload = data.d as DiscordGuildBanAddRemove; diff --git a/src/handlers/guilds/GUILD_CREATE.ts b/src/handlers/guilds/GUILD_CREATE.ts index 3bd318705..5eb5bb663 100644 --- a/src/handlers/guilds/GUILD_CREATE.ts +++ b/src/handlers/guilds/GUILD_CREATE.ts @@ -2,6 +2,7 @@ import { eventHandlers } from "../../bot.ts"; import { cache, cacheHandlers } from "../../cache.ts"; import { structures } from "../../structures/mod.ts"; import { basicShards } from "../../ws/shard.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export async function handleGuildCreate( data: DiscordGatewayPayload, diff --git a/src/handlers/guilds/GUILD_DELETE.ts b/src/handlers/guilds/GUILD_DELETE.ts index 10ab94493..ffc9c1c86 100644 --- a/src/handlers/guilds/GUILD_DELETE.ts +++ b/src/handlers/guilds/GUILD_DELETE.ts @@ -1,6 +1,8 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; import { basicShards } from "../../ws/shard.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordUnavailableGuild } from "../../types/guilds/unavailable_guild.ts"; export async function handleGuildDelete( data: DiscordGatewayPayload, diff --git a/src/handlers/guilds/GUILD_INTEGRATIONS_UPDATE.ts b/src/handlers/guilds/GUILD_INTEGRATIONS_UPDATE.ts index 8b5c251a2..97fbf2a50 100644 --- a/src/handlers/guilds/GUILD_INTEGRATIONS_UPDATE.ts +++ b/src/handlers/guilds/GUILD_INTEGRATIONS_UPDATE.ts @@ -1,5 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordGuildIntegrationsUpdate } from "../../types/guilds/guild_integrations_update.ts"; export async function handleGuildIntegrationsUpdate( data: DiscordGatewayPayload, diff --git a/src/handlers/guilds/GUILD_UPDATE.ts b/src/handlers/guilds/GUILD_UPDATE.ts index 53064fc3d..cb92b88af 100644 --- a/src/handlers/guilds/GUILD_UPDATE.ts +++ b/src/handlers/guilds/GUILD_UPDATE.ts @@ -1,5 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordGuild } from "../../types/guilds/guild.ts"; export async function handleGuildUpdate(data: DiscordGatewayPayload) { const payload = data.d as DiscordGuild; diff --git a/src/handlers/integrations/INTEGRATION_CREATE.ts b/src/handlers/integrations/INTEGRATION_CREATE.ts index 0fb5d2cd0..4148db518 100644 --- a/src/handlers/integrations/INTEGRATION_CREATE.ts +++ b/src/handlers/integrations/INTEGRATION_CREATE.ts @@ -1,4 +1,5 @@ import { eventHandlers } from "../../bot.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export function handleIntegrationCreate( data: DiscordGatewayPayload, diff --git a/src/handlers/integrations/INTEGRATION_DELETE.ts b/src/handlers/integrations/INTEGRATION_DELETE.ts index 2b4df37fe..c89ae3d3b 100644 --- a/src/handlers/integrations/INTEGRATION_DELETE.ts +++ b/src/handlers/integrations/INTEGRATION_DELETE.ts @@ -1,4 +1,5 @@ import { eventHandlers } from "../../bot.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export function handleIntegrationDelete(data: DiscordGatewayPayload) { const { diff --git a/src/handlers/integrations/INTEGRATION_UPDATE.ts b/src/handlers/integrations/INTEGRATION_UPDATE.ts index 086ae10e2..13fb98bed 100644 --- a/src/handlers/integrations/INTEGRATION_UPDATE.ts +++ b/src/handlers/integrations/INTEGRATION_UPDATE.ts @@ -1,4 +1,5 @@ import { eventHandlers } from "../../bot.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export function handleIntegrationUpdate(data: DiscordGatewayPayload) { const { diff --git a/src/handlers/interactions/INTERACTION_CREATE.ts b/src/handlers/interactions/INTERACTION_CREATE.ts index 40282a4b4..dc59476d3 100644 --- a/src/handlers/interactions/INTERACTION_CREATE.ts +++ b/src/handlers/interactions/INTERACTION_CREATE.ts @@ -1,6 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; import { structures } from "../../structures/mod.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export async function handleInteractionCreate(data: DiscordGatewayPayload) { const payload = data.d as InteractionCommandPayload; diff --git a/src/handlers/invites/INVITE_CREATE.ts b/src/handlers/invites/INVITE_CREATE.ts index 9f1df9af1..f53f0b102 100644 --- a/src/handlers/invites/INVITE_CREATE.ts +++ b/src/handlers/invites/INVITE_CREATE.ts @@ -1,4 +1,6 @@ import { eventHandlers } from "../../bot.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordInviteCreate } from "../../types/invites/invite_create.ts"; export function handleInviteCreate(payload: DiscordGatewayPayload) { // TODO: replace with tocamelcase diff --git a/src/handlers/invites/INVITE_DELETE.ts b/src/handlers/invites/INVITE_DELETE.ts index 057c5820c..cddae5a27 100644 --- a/src/handlers/invites/INVITE_DELETE.ts +++ b/src/handlers/invites/INVITE_DELETE.ts @@ -1,4 +1,6 @@ import { eventHandlers } from "../../bot.ts"; +import { DiscordInviteDelete } from "../../types/invites/invite_delete.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export function handleInviteDelete(payload: DiscordGatewayPayload) { const { diff --git a/src/handlers/members/GUILD_MEMBERS_CHUNK.ts b/src/handlers/members/GUILD_MEMBERS_CHUNK.ts index c3427ea57..e3452cb34 100644 --- a/src/handlers/members/GUILD_MEMBERS_CHUNK.ts +++ b/src/handlers/members/GUILD_MEMBERS_CHUNK.ts @@ -1,6 +1,8 @@ import { cache, cacheHandlers } from "../../cache.ts"; import { structures } from "../../structures/mod.ts"; import { Collection } from "../../util/collection.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordGuildMembersChunk } from "../../types/members/guild_members_chunk.ts"; export async function handleGuildMembersChunk(data: DiscordGatewayPayload) { const payload = data.d as DiscordGuildMembersChunk; diff --git a/src/handlers/members/GUILD_MEMBER_ADD.ts b/src/handlers/members/GUILD_MEMBER_ADD.ts index f548baa4c..f9d5609fb 100644 --- a/src/handlers/members/GUILD_MEMBER_ADD.ts +++ b/src/handlers/members/GUILD_MEMBER_ADD.ts @@ -1,6 +1,8 @@ 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 { DiscordGuildMemberAdd } from "../../types/members/guild_member_add.ts"; export async function handleGuildMemberAdd(data: DiscordGatewayPayload) { const payload = data.d as DiscordGuildMemberAdd; diff --git a/src/handlers/members/GUILD_MEMBER_REMOVE.ts b/src/handlers/members/GUILD_MEMBER_REMOVE.ts index 59415f038..0b4e66495 100644 --- a/src/handlers/members/GUILD_MEMBER_REMOVE.ts +++ b/src/handlers/members/GUILD_MEMBER_REMOVE.ts @@ -1,5 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordGuildMemberRemove } from "../../types/members/guild_member_remove.ts"; export async function handleGuildMemberRemove(data: DiscordGatewayPayload) { const payload = data.d as DiscordGuildMemberRemove; diff --git a/src/handlers/members/GUILD_MEMBER_UPDATE.ts b/src/handlers/members/GUILD_MEMBER_UPDATE.ts index d15c6ee2f..f8b5ffe41 100644 --- a/src/handlers/members/GUILD_MEMBER_UPDATE.ts +++ b/src/handlers/members/GUILD_MEMBER_UPDATE.ts @@ -1,6 +1,8 @@ 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 { DiscordGuildMemberUpdate } from "../../types/members/guild_member_update.ts"; export async function handleGuildMemberUpdate(data: DiscordGatewayPayload) { const payload = data.d as DiscordGuildMemberUpdate; diff --git a/src/handlers/messages/MESSAGE_CREATE.ts b/src/handlers/messages/MESSAGE_CREATE.ts index 017f5bf74..04c096849 100644 --- a/src/handlers/messages/MESSAGE_CREATE.ts +++ b/src/handlers/messages/MESSAGE_CREATE.ts @@ -1,6 +1,8 @@ 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"; export async function handleMessageCreate(data: DiscordGatewayPayload) { const payload = data.d as DiscordMessage; diff --git a/src/handlers/messages/MESSAGE_DELETE.ts b/src/handlers/messages/MESSAGE_DELETE.ts index 99a1e0394..48f25006f 100644 --- a/src/handlers/messages/MESSAGE_DELETE.ts +++ b/src/handlers/messages/MESSAGE_DELETE.ts @@ -1,5 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordMessageDelete } from "../../types/messages/message_delete.ts"; export async function handleMessageDelete(data: DiscordGatewayPayload) { const payload = data.d as DiscordMessageDelete; diff --git a/src/handlers/messages/MESSAGE_DELETE_BULK.ts b/src/handlers/messages/MESSAGE_DELETE_BULK.ts index 188493557..050717f1a 100644 --- a/src/handlers/messages/MESSAGE_DELETE_BULK.ts +++ b/src/handlers/messages/MESSAGE_DELETE_BULK.ts @@ -1,5 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordMessageDeleteBulk } from "../../types/messages/message_delete_bulk.ts"; export async function handleMessageDeleteBulk(data: DiscordGatewayPayload) { const payload = data.d as DiscordMessageDeleteBulk; diff --git a/src/handlers/messages/MESSAGE_REACTION_ADD.ts b/src/handlers/messages/MESSAGE_REACTION_ADD.ts index b5878fbc1..1ff39127b 100644 --- a/src/handlers/messages/MESSAGE_REACTION_ADD.ts +++ b/src/handlers/messages/MESSAGE_REACTION_ADD.ts @@ -1,6 +1,8 @@ import { botId, eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; import { structures } from "../../structures/mod.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordMessageReactionAdd } from "../../types/messages/message_reaction_add.ts"; export async function handleMessageReactionAdd(data: DiscordGatewayPayload) { const payload = data.d as DiscordMessageReactionAdd; diff --git a/src/handlers/messages/MESSAGE_REACTION_REMOVE.ts b/src/handlers/messages/MESSAGE_REACTION_REMOVE.ts index 8a530fa00..91e2dd7bf 100644 --- a/src/handlers/messages/MESSAGE_REACTION_REMOVE.ts +++ b/src/handlers/messages/MESSAGE_REACTION_REMOVE.ts @@ -1,6 +1,8 @@ import { botId, eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; import { structures } from "../../structures/mod.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordMessageReactionRemove } from "../../types/messages/message_reaction_remove.ts"; export async function handleMessageReactionRemove( data: DiscordGatewayPayload, diff --git a/src/handlers/messages/MESSAGE_REACTION_REMOVE_ALL.ts b/src/handlers/messages/MESSAGE_REACTION_REMOVE_ALL.ts index 218baa31e..29ff5b3ed 100644 --- a/src/handlers/messages/MESSAGE_REACTION_REMOVE_ALL.ts +++ b/src/handlers/messages/MESSAGE_REACTION_REMOVE_ALL.ts @@ -1,5 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordMessageReactionRemoveAll } from "../../types/messages/message_reaction_remove_all.ts"; export async function handleMessageReactionRemoveAll( data: DiscordGatewayPayload, diff --git a/src/handlers/messages/MESSAGE_REACTION_REMOVE_EMOJI.ts b/src/handlers/messages/MESSAGE_REACTION_REMOVE_EMOJI.ts index ccac604ca..677c51b02 100644 --- a/src/handlers/messages/MESSAGE_REACTION_REMOVE_EMOJI.ts +++ b/src/handlers/messages/MESSAGE_REACTION_REMOVE_EMOJI.ts @@ -1,5 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordMessageReactionRemoveEmoji } from "../../types/messages/message_reaction_remove_emoji.ts"; export async function handleMessageReactionRemoveEmoji( data: DiscordGatewayPayload, diff --git a/src/handlers/messages/MESSAGE_UPDATE.ts b/src/handlers/messages/MESSAGE_UPDATE.ts index 7544106ea..e0bd4d1be 100644 --- a/src/handlers/messages/MESSAGE_UPDATE.ts +++ b/src/handlers/messages/MESSAGE_UPDATE.ts @@ -1,6 +1,8 @@ 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"; export async function handleMessageUpdate(data: DiscordGatewayPayload) { const payload = data.d as DiscordMessage; diff --git a/src/handlers/misc/PRESENCE_UPDATE.ts b/src/handlers/misc/PRESENCE_UPDATE.ts index 0590c0955..66a6cc6c3 100644 --- a/src/handlers/misc/PRESENCE_UPDATE.ts +++ b/src/handlers/misc/PRESENCE_UPDATE.ts @@ -1,5 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordPresenceUpdate } from "../../types/misc/presence_update.ts"; export async function handlePresenceUpdate(data: DiscordGatewayPayload) { const payload = data.d as DiscordPresenceUpdate; diff --git a/src/handlers/misc/READY.ts b/src/handlers/misc/READY.ts index 793c6cca7..095b8a992 100644 --- a/src/handlers/misc/READY.ts +++ b/src/handlers/misc/READY.ts @@ -9,6 +9,8 @@ import { initialMemberLoadQueue } from "../../structures/guild.ts"; import { structures } from "../../structures/mod.ts"; import { delay } from "../../util/utils.ts"; import { allowNextShard, basicShards } from "../../ws/mod.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordReady } from "../../types/gateway/ready.ts"; export async function handleReady( data: DiscordGatewayPayload, diff --git a/src/handlers/misc/TYPING_START.ts b/src/handlers/misc/TYPING_START.ts index 8f0274953..9775758d7 100644 --- a/src/handlers/misc/TYPING_START.ts +++ b/src/handlers/misc/TYPING_START.ts @@ -1,4 +1,6 @@ import { eventHandlers } from "../../bot.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordTypingStart } from "../../types/misc/typing_start.ts"; export function handleTypingStart(data: DiscordGatewayPayload) { eventHandlers.typingStart?.(data.d as DiscordTypingStart); diff --git a/src/handlers/misc/USER_UPDATE.ts b/src/handlers/misc/USER_UPDATE.ts index 7008702eb..07e9dbcbc 100644 --- a/src/handlers/misc/USER_UPDATE.ts +++ b/src/handlers/misc/USER_UPDATE.ts @@ -1,5 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordUser } from "../../types/users/user.ts"; export async function handleUserUpdate(data: DiscordGatewayPayload) { const userData = data.d as DiscordUser; diff --git a/src/handlers/roles/GUILD_ROLE_CREATE.ts b/src/handlers/roles/GUILD_ROLE_CREATE.ts index cc6880660..24720435e 100644 --- a/src/handlers/roles/GUILD_ROLE_CREATE.ts +++ b/src/handlers/roles/GUILD_ROLE_CREATE.ts @@ -1,6 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; import { structures } from "../../structures/mod.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export async function handleGuildRoleCreate(data: DiscordGatewayPayload) { const payload = data.d as DiscordGuildRoleCreateUpdate; diff --git a/src/handlers/roles/GUILD_ROLE_DELETE.ts b/src/handlers/roles/GUILD_ROLE_DELETE.ts index b06f1da9e..390fb0cfd 100644 --- a/src/handlers/roles/GUILD_ROLE_DELETE.ts +++ b/src/handlers/roles/GUILD_ROLE_DELETE.ts @@ -1,5 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordGuildRoleDelete } from "../../types/guilds/guild_role_delete.ts"; export async function handleGuildRoleDelete(data: DiscordGatewayPayload) { const payload = data.d as DiscordGuildRoleDelete; diff --git a/src/handlers/roles/GUILD_ROLE_UPDATE.ts b/src/handlers/roles/GUILD_ROLE_UPDATE.ts index 55032d3c5..9c02deeb9 100644 --- a/src/handlers/roles/GUILD_ROLE_UPDATE.ts +++ b/src/handlers/roles/GUILD_ROLE_UPDATE.ts @@ -1,6 +1,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; import { structures } from "../../structures/mod.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; export async function handleGuildRoleUpdate(data: DiscordGatewayPayload) { const payload = data.d as DiscordGuildRoleCreateUpdate; diff --git a/src/handlers/voice/VOICE_STATE_UPDATE.ts b/src/handlers/voice/VOICE_STATE_UPDATE.ts index d67f55d58..0a62c2949 100644 --- a/src/handlers/voice/VOICE_STATE_UPDATE.ts +++ b/src/handlers/voice/VOICE_STATE_UPDATE.ts @@ -1,6 +1,8 @@ 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 { DiscordVoiceState } from "../../types/voice/voice_state.ts"; export async function handleVoiceStateUpdate(data: DiscordGatewayPayload) { const payload = data.d as DiscordVoiceState; diff --git a/src/handlers/webhooks/WEBHOOKS_UPDATE.ts b/src/handlers/webhooks/WEBHOOKS_UPDATE.ts index 0b1f53d19..86e10a68e 100644 --- a/src/handlers/webhooks/WEBHOOKS_UPDATE.ts +++ b/src/handlers/webhooks/WEBHOOKS_UPDATE.ts @@ -1,4 +1,6 @@ import { eventHandlers } from "../../bot.ts"; +import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; +import { DiscordWebhooksUpdate } from "../../types/webhooks/webhooks_update.ts"; export function handleWebhooksUpdate(data: DiscordGatewayPayload) { const options = data.d as DiscordWebhooksUpdate;