From d829c91c3eea837837239defef8e1159dc8c59cf Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Sun, 4 Apr 2021 14:59:56 +0530 Subject: [PATCH] i tried --- deploy.ts | 2 +- src/client/client.ts | 4 +- src/commands/client.ts | 4 +- src/commands/command.ts | 8 +-- src/commands/extension.ts | 2 +- src/gateway/handlers/channelCreate.ts | 7 +- src/gateway/handlers/channelDelete.ts | 2 +- src/gateway/handlers/channelPinsUpdate.ts | 4 +- src/gateway/handlers/channelUpdate.ts | 4 +- src/gateway/handlers/messageCreate.ts | 4 +- src/gateway/handlers/messageDelete.ts | 4 +- src/gateway/handlers/messageDeleteBulk.ts | 6 +- src/gateway/handlers/messageReactionAdd.ts | 8 +-- src/gateway/handlers/messageReactionRemove.ts | 4 +- .../handlers/messageReactionRemoveAll.ts | 4 +- .../handlers/messageReactionRemoveEmoji.ts | 4 +- src/gateway/handlers/messageUpdate.ts | 6 +- src/gateway/handlers/mod.ts | 40 +++++------ src/gateway/handlers/presenceUpdate.ts | 2 +- src/gateway/handlers/ready.ts | 4 +- src/gateway/handlers/resume.ts | 2 +- src/gateway/handlers/typingStart.ts | 4 +- src/gateway/handlers/userUpdate.ts | 4 +- src/gateway/handlers/voiceServerUpdate.ts | 4 +- src/gateway/handlers/voiceStateUpdate.ts | 8 +-- src/gateway/handlers/webhooksUpdate.ts | 6 +- src/gateway/mod.ts | 6 +- src/interactions/slashCommand.ts | 2 +- src/interactions/slashModule.ts | 2 +- src/managers/base.ts | 2 +- src/managers/baseChild.ts | 2 +- src/managers/channels.ts | 4 +- src/managers/emojis.ts | 4 +- src/managers/gatewayCache.ts | 2 +- src/managers/guildChannelVoiceStates.ts | 6 +- src/managers/guildChannels.ts | 8 +-- src/managers/guildEmojis.ts | 8 +-- src/managers/guildVoiceStates.ts | 10 +-- src/managers/guilds.ts | 6 +- src/managers/invites.ts | 8 +-- src/managers/memberRoles.ts | 10 +-- src/managers/members.ts | 6 +- src/managers/messageReactions.ts | 11 ++- src/managers/messages.ts | 6 +- src/managers/presences.ts | 6 +- src/managers/reactionUsers.ts | 6 +- src/managers/roles.ts | 6 +- src/managers/users.ts | 4 +- src/rest/endpoints.ts | 23 +++--- src/rest/manager.ts | 2 +- src/structures/application.ts | 4 +- src/structures/base.ts | 2 +- src/structures/cdn.ts | 2 +- src/structures/channel.ts | 12 ++-- src/structures/dmChannel.ts | 6 +- src/structures/embed.ts | 72 +++++++++++++------ src/structures/emoji.ts | 8 +-- src/structures/groupChannel.ts | 4 +- src/structures/guild.ts | 8 +-- src/structures/guildCategoryChannel.ts | 2 +- src/structures/guildTextChannel.ts | 16 ++--- src/structures/guildVoiceChannel.ts | 16 ++--- src/structures/invite.ts | 10 +-- src/structures/member.ts | 10 +-- src/structures/message.ts | 14 ++-- src/structures/messageMentions.ts | 8 +-- src/structures/messageReaction.ts | 8 +-- src/structures/messageSticker.ts | 4 +- src/structures/presence.ts | 6 +- src/structures/role.ts | 8 +-- src/structures/slash.ts | 18 ++--- src/structures/template.ts | 4 +- src/structures/textChannel.ts | 10 +-- src/structures/user.ts | 8 +-- src/structures/voiceState.ts | 12 ++-- src/structures/webhook.ts | 10 +-- src/types/application.ts | 2 +- src/types/channel.ts | 18 ++--- src/types/emoji.ts | 2 +- src/types/gateway.ts | 16 ++--- src/types/gatewayResponse.ts | 2 +- src/types/guild.ts | 30 ++++---- src/types/invite.ts | 10 +-- src/types/slash.ts | 10 +-- src/types/template.ts | 4 +- src/types/voice.ts | 2 +- src/types/webhook.ts | 2 +- 87 files changed, 357 insertions(+), 324 deletions(-) diff --git a/deploy.ts b/deploy.ts index ffdc907..ccd96cf 100644 --- a/deploy.ts +++ b/deploy.ts @@ -79,4 +79,4 @@ export { commands, client } export * from './src/types/slash.ts' export * from './src/structures/slash.ts' export * from './src/interactions/mod.ts' -export * from './src/types/channel.ts' +// export * from './src/types/channel.ts' diff --git a/src/client/client.ts b/src/client/client.ts index 0b4ea93..acb1ce7 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/method-signature-style */ -import { User } from '../structures/user.ts' +import type { User } from '../structures/user.ts' import { GatewayIntents } from '../types/gateway.ts' import { Gateway } from '../gateway/mod.ts' import { RESTManager, RESTOptions, TokenType } from '../rest/mod.ts' @@ -22,7 +22,7 @@ import type { Collector } from './collectors.ts' import { HarmonyEventEmitter } from '../utils/events.ts' import type { VoiceRegion } from '../types/voice.ts' import { fetchAuto } from '../../deps.ts' -import { DMChannel } from '../structures/dmChannel.ts' +import type { DMChannel } from '../structures/dmChannel.ts' import { Template } from '../structures/template.ts' /** OS related properties sent with Gateway Identify */ diff --git a/src/commands/client.ts b/src/commands/client.ts index 08815a5..9cc8f54 100644 --- a/src/commands/client.ts +++ b/src/commands/client.ts @@ -1,5 +1,5 @@ -import { Message } from '../structures/message.ts' -import { GuildTextBasedChannel } from '../structures/guildTextChannel.ts' +import type { Message } from '../structures/message.ts' +import type { GuildTextBasedChannel } from '../structures/guildTextChannel.ts' import { Client, ClientOptions } from '../client/mod.ts' import { CategoriesManager, diff --git a/src/commands/command.ts b/src/commands/command.ts index 8dda90e..bbe4dee 100644 --- a/src/commands/command.ts +++ b/src/commands/command.ts @@ -1,7 +1,7 @@ -import { Guild } from '../structures/guild.ts' -import { Message } from '../structures/message.ts' -import { TextChannel } from '../structures/textChannel.ts' -import { User } from '../structures/user.ts' +import type { Guild } from '../structures/guild.ts' +import type { Message } from '../structures/message.ts' +import type { TextChannel } from '../structures/textChannel.ts' +import type { User } from '../structures/user.ts' import { Collection } from '../utils/collection.ts' import type { CommandClient } from './client.ts' import type { Extension } from './extension.ts' diff --git a/src/commands/extension.ts b/src/commands/extension.ts index cf6158c..80f4bc1 100644 --- a/src/commands/extension.ts +++ b/src/commands/extension.ts @@ -1,7 +1,7 @@ import { Collection } from '../utils/collection.ts' import { Command } from './command.ts' import { CommandClient } from './client.ts' -import { ClientEvents } from '../gateway/handlers/mod.ts' +import type { ClientEvents } from '../gateway/handlers/mod.ts' export type ExtensionEventCallback = (ext: Extension, ...args: any[]) => any diff --git a/src/gateway/handlers/channelCreate.ts b/src/gateway/handlers/channelCreate.ts index 50930c0..4d63f8f 100644 --- a/src/gateway/handlers/channelCreate.ts +++ b/src/gateway/handlers/channelCreate.ts @@ -1,7 +1,10 @@ import type { Gateway, GatewayEventHandler } from '../mod.ts' import getChannelByType from '../../utils/getChannelByType.ts' -import { ChannelPayload, GuildChannelPayload } from '../../types/channel.ts' -import { Guild } from '../../structures/guild.ts' +import type { + ChannelPayload, + GuildChannelPayload +} from '../../types/channel.ts' +import type { Guild } from '../../structures/guild.ts' export const channelCreate: GatewayEventHandler = async ( gateway: Gateway, diff --git a/src/gateway/handlers/channelDelete.ts b/src/gateway/handlers/channelDelete.ts index e96b035..05b6db2 100644 --- a/src/gateway/handlers/channelDelete.ts +++ b/src/gateway/handlers/channelDelete.ts @@ -1,5 +1,5 @@ import type { Gateway, GatewayEventHandler } from '../mod.ts' -import { ChannelPayload } from '../../types/channel.ts' +import type { ChannelPayload } from '../../types/channel.ts' export const channelDelete: GatewayEventHandler = async ( gateway: Gateway, diff --git a/src/gateway/handlers/channelPinsUpdate.ts b/src/gateway/handlers/channelPinsUpdate.ts index 9c6ca20..e9ac67c 100644 --- a/src/gateway/handlers/channelPinsUpdate.ts +++ b/src/gateway/handlers/channelPinsUpdate.ts @@ -1,6 +1,6 @@ import type { Gateway, GatewayEventHandler } from '../mod.ts' -import { TextChannel } from '../../structures/textChannel.ts' -import { ChannelPinsUpdatePayload } from '../../types/gateway.ts' +import type { TextChannel } from '../../structures/textChannel.ts' +import type { ChannelPinsUpdatePayload } from '../../types/gateway.ts' export const channelPinsUpdate: GatewayEventHandler = async ( gateway: Gateway, diff --git a/src/gateway/handlers/channelUpdate.ts b/src/gateway/handlers/channelUpdate.ts index 22004e0..263caaf 100644 --- a/src/gateway/handlers/channelUpdate.ts +++ b/src/gateway/handlers/channelUpdate.ts @@ -1,5 +1,5 @@ -import { Channel } from '../../structures/channel.ts' -import { ChannelPayload } from '../../types/channel.ts' +import type { Channel } from '../../structures/channel.ts' +import type { ChannelPayload } from '../../types/channel.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' export const channelUpdate: GatewayEventHandler = async ( diff --git a/src/gateway/handlers/messageCreate.ts b/src/gateway/handlers/messageCreate.ts index 599452f..a2aa05f 100644 --- a/src/gateway/handlers/messageCreate.ts +++ b/src/gateway/handlers/messageCreate.ts @@ -1,7 +1,7 @@ import { Message } from '../../structures/message.ts' -import { TextChannel } from '../../structures/textChannel.ts' +import type { TextChannel } from '../../structures/textChannel.ts' import { User } from '../../structures/user.ts' -import { MessagePayload } from '../../types/channel.ts' +import type { MessagePayload } from '../../types/channel.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' export const messageCreate: GatewayEventHandler = async ( diff --git a/src/gateway/handlers/messageDelete.ts b/src/gateway/handlers/messageDelete.ts index 1e0e439..6de103d 100644 --- a/src/gateway/handlers/messageDelete.ts +++ b/src/gateway/handlers/messageDelete.ts @@ -1,5 +1,5 @@ -import { TextChannel } from '../../structures/textChannel.ts' -import { MessageDeletePayload } from '../../types/gateway.ts' +import type { TextChannel } from '../../structures/textChannel.ts' +import type { MessageDeletePayload } from '../../types/gateway.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' export const messageDelete: GatewayEventHandler = async ( diff --git a/src/gateway/handlers/messageDeleteBulk.ts b/src/gateway/handlers/messageDeleteBulk.ts index 56ed026..92574fb 100644 --- a/src/gateway/handlers/messageDeleteBulk.ts +++ b/src/gateway/handlers/messageDeleteBulk.ts @@ -1,6 +1,6 @@ -import { Message } from '../../structures/message.ts' -import { GuildTextBasedChannel } from '../../structures/guildTextChannel.ts' -import { MessageDeleteBulkPayload } from '../../types/gateway.ts' +import type { Message } from '../../structures/message.ts' +import type { GuildTextBasedChannel } from '../../structures/guildTextChannel.ts' +import type { MessageDeleteBulkPayload } from '../../types/gateway.ts' import { Collection } from '../../utils/collection.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' diff --git a/src/gateway/handlers/messageReactionAdd.ts b/src/gateway/handlers/messageReactionAdd.ts index 592e1fa..6dfd608 100644 --- a/src/gateway/handlers/messageReactionAdd.ts +++ b/src/gateway/handlers/messageReactionAdd.ts @@ -1,8 +1,8 @@ import type { Gateway, GatewayEventHandler } from '../mod.ts' -import { MessageReactionAddPayload } from '../../types/gateway.ts' -import { TextChannel } from '../../structures/textChannel.ts' -import { MessageReaction } from '../../structures/messageReaction.ts' -import { UserPayload } from '../../types/user.ts' +import type { MessageReactionAddPayload } from '../../types/gateway.ts' +import type { TextChannel } from '../../structures/textChannel.ts' +import type { MessageReaction } from '../../structures/messageReaction.ts' +import type { UserPayload } from '../../types/user.ts' export const messageReactionAdd: GatewayEventHandler = async ( gateway: Gateway, diff --git a/src/gateway/handlers/messageReactionRemove.ts b/src/gateway/handlers/messageReactionRemove.ts index c0371a9..9d2879c 100644 --- a/src/gateway/handlers/messageReactionRemove.ts +++ b/src/gateway/handlers/messageReactionRemove.ts @@ -1,6 +1,6 @@ import type { Gateway, GatewayEventHandler } from '../mod.ts' -import { MessageReactionRemovePayload } from '../../types/gateway.ts' -import { TextChannel } from '../../structures/textChannel.ts' +import type { MessageReactionRemovePayload } from '../../types/gateway.ts' +import type { TextChannel } from '../../structures/textChannel.ts' export const messageReactionRemove: GatewayEventHandler = async ( gateway: Gateway, diff --git a/src/gateway/handlers/messageReactionRemoveAll.ts b/src/gateway/handlers/messageReactionRemoveAll.ts index 99474fb..2447472 100644 --- a/src/gateway/handlers/messageReactionRemoveAll.ts +++ b/src/gateway/handlers/messageReactionRemoveAll.ts @@ -1,6 +1,6 @@ import type { Gateway, GatewayEventHandler } from '../mod.ts' -import { MessageReactionRemoveAllPayload } from '../../types/gateway.ts' -import { TextChannel } from '../../structures/textChannel.ts' +import type { MessageReactionRemoveAllPayload } from '../../types/gateway.ts' +import type { TextChannel } from '../../structures/textChannel.ts' export const messageReactionRemoveAll: GatewayEventHandler = async ( gateway: Gateway, diff --git a/src/gateway/handlers/messageReactionRemoveEmoji.ts b/src/gateway/handlers/messageReactionRemoveEmoji.ts index 6c29b97..5c19926 100644 --- a/src/gateway/handlers/messageReactionRemoveEmoji.ts +++ b/src/gateway/handlers/messageReactionRemoveEmoji.ts @@ -1,6 +1,6 @@ import type { Gateway, GatewayEventHandler } from '../mod.ts' -import { MessageReactionRemoveEmojiPayload } from '../../types/gateway.ts' -import { TextChannel } from '../../structures/textChannel.ts' +import type { MessageReactionRemoveEmojiPayload } from '../../types/gateway.ts' +import type { TextChannel } from '../../structures/textChannel.ts' export const messageReactionRemoveEmoji: GatewayEventHandler = async ( gateway: Gateway, diff --git a/src/gateway/handlers/messageUpdate.ts b/src/gateway/handlers/messageUpdate.ts index f6e1cdd..0987833 100644 --- a/src/gateway/handlers/messageUpdate.ts +++ b/src/gateway/handlers/messageUpdate.ts @@ -1,6 +1,6 @@ -import { Message } from '../../structures/message.ts' -import { TextChannel } from '../../structures/textChannel.ts' -import { MessagePayload } from '../../types/channel.ts' +import type { Message } from '../../structures/message.ts' +import type { TextChannel } from '../../structures/textChannel.ts' +import type { MessagePayload } from '../../types/channel.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' export const messageUpdate: GatewayEventHandler = async ( diff --git a/src/gateway/handlers/mod.ts b/src/gateway/handlers/mod.ts index 12b2b80..748ebe4 100644 --- a/src/gateway/handlers/mod.ts +++ b/src/gateway/handlers/mod.ts @@ -1,5 +1,5 @@ import type { GatewayEventHandler } from '../mod.ts' -import { +import type { GatewayEvents, MessageDeletePayload, TypingStartGuildData @@ -31,18 +31,18 @@ import { webhooksUpdate } from './webhooksUpdate.ts' import { messageDeleteBulk } from './messageDeleteBulk.ts' import { userUpdate } from './userUpdate.ts' import { typingStart } from './typingStart.ts' -import { TextChannel } from '../../structures/textChannel.ts' +import type { TextChannel } from '../../structures/textChannel.ts' import { GuildTextBasedChannel } from '../../structures/guildTextChannel.ts' -import { Guild } from '../../structures/guild.ts' -import { User } from '../../structures/user.ts' -import { Emoji } from '../../structures/emoji.ts' -import { Member } from '../../structures/member.ts' -import { Role } from '../../structures/role.ts' -import { Message } from '../../structures/message.ts' -import { Collection } from '../../utils/collection.ts' +import type { Guild } from '../../structures/guild.ts' +import type { User } from '../../structures/user.ts' +import type { Emoji } from '../../structures/emoji.ts' +import type { Member } from '../../structures/member.ts' +import type { Role } from '../../structures/role.ts' +import type { Message } from '../../structures/message.ts' +import type { Collection } from '../../utils/collection.ts' import { voiceServerUpdate } from './voiceServerUpdate.ts' import { voiceStateUpdate } from './voiceStateUpdate.ts' -import { VoiceState } from '../../structures/voiceState.ts' +import type { VoiceState } from '../../structures/voiceState.ts' import { messageReactionAdd } from './messageReactionAdd.ts' import { messageReactionRemove } from './messageReactionRemove.ts' import { messageReactionRemoveAll } from './messageReactionRemoveAll.ts' @@ -51,23 +51,23 @@ import { guildMembersChunk } from './guildMembersChunk.ts' import { presenceUpdate } from './presenceUpdate.ts' import { inviteCreate } from './inviteCreate.ts' import { inviteDelete } from './inviteDelete.ts' -import { MessageReaction } from '../../structures/messageReaction.ts' -import { Invite } from '../../structures/invite.ts' -import { Presence } from '../../structures/presence.ts' -import { +import type { MessageReaction } from '../../structures/messageReaction.ts' +import type { Invite } from '../../structures/invite.ts' +import type { Presence } from '../../structures/presence.ts' +import type { EveryChannelTypes, EveryTextChannelTypes } from '../../utils/getChannelByType.ts' import { interactionCreate } from './interactionCreate.ts' -import { Interaction } from '../../structures/slash.ts' -import { CommandContext } from '../../commands/command.ts' -import { RequestMethods } from '../../rest/types.ts' -import { PartialInvitePayload } from '../../types/invite.ts' -import { GuildChannels } from '../../types/guild.ts' +import type { Interaction } from '../../structures/slash.ts' +import type { CommandContext } from '../../commands/command.ts' +import type { RequestMethods } from '../../rest/types.ts' +import type { PartialInvitePayload } from '../../types/invite.ts' +import type { GuildChannels } from '../../types/guild.ts' import { applicationCommandCreate } from './applicationCommandCreate.ts' import { applicationCommandDelete } from './applicationCommandDelete.ts' import { applicationCommandUpdate } from './applicationCommandUpdate.ts' -import { SlashCommand } from '../../interactions/slashCommand.ts' +import type { SlashCommand } from '../../interactions/slashCommand.ts' export const gatewayHandlers: { [eventCode in GatewayEvents]: GatewayEventHandler | undefined diff --git a/src/gateway/handlers/presenceUpdate.ts b/src/gateway/handlers/presenceUpdate.ts index 2ea85eb..191f010 100644 --- a/src/gateway/handlers/presenceUpdate.ts +++ b/src/gateway/handlers/presenceUpdate.ts @@ -1,4 +1,4 @@ -import { PresenceUpdatePayload } from '../../types/gateway.ts' +import type { PresenceUpdatePayload } from '../../types/gateway.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' export const presenceUpdate: GatewayEventHandler = async ( diff --git a/src/gateway/handlers/ready.ts b/src/gateway/handlers/ready.ts index fd880b0..f1ecf3d 100644 --- a/src/gateway/handlers/ready.ts +++ b/src/gateway/handlers/ready.ts @@ -1,6 +1,6 @@ import { User } from '../../structures/user.ts' -import { Ready } from '../../types/gateway.ts' -import { GuildPayload } from '../../types/guild.ts' +import type { Ready } from '../../types/gateway.ts' +import type { GuildPayload } from '../../types/guild.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' export const ready: GatewayEventHandler = async ( diff --git a/src/gateway/handlers/resume.ts b/src/gateway/handlers/resume.ts index af48d81..1c9eaef 100644 --- a/src/gateway/handlers/resume.ts +++ b/src/gateway/handlers/resume.ts @@ -1,6 +1,6 @@ import { User } from '../../structures/user.ts' import { CLIENT_USER } from '../../types/endpoint.ts' -import { Resume } from '../../types/gateway.ts' +import type { Resume } from '../../types/gateway.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' export const resume: GatewayEventHandler = async ( diff --git a/src/gateway/handlers/typingStart.ts b/src/gateway/handlers/typingStart.ts index fd1f5e9..f6cda70 100644 --- a/src/gateway/handlers/typingStart.ts +++ b/src/gateway/handlers/typingStart.ts @@ -1,6 +1,6 @@ import { Member } from '../../structures/member.ts' -import { TextChannel } from '../../structures/textChannel.ts' -import { TypingStartPayload } from '../../types/gateway.ts' +import type { TextChannel } from '../../structures/textChannel.ts' +import type { TypingStartPayload } from '../../types/gateway.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' // TODO: Do we need to add uncached events here? diff --git a/src/gateway/handlers/userUpdate.ts b/src/gateway/handlers/userUpdate.ts index 34de77c..491e449 100644 --- a/src/gateway/handlers/userUpdate.ts +++ b/src/gateway/handlers/userUpdate.ts @@ -1,5 +1,5 @@ -import { User } from '../../structures/user.ts' -import { UserPayload } from '../../types/user.ts' +import type { User } from '../../structures/user.ts' +import type { UserPayload } from '../../types/user.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' export const userUpdate: GatewayEventHandler = async ( diff --git a/src/gateway/handlers/voiceServerUpdate.ts b/src/gateway/handlers/voiceServerUpdate.ts index 7ac0420..2c14fc1 100644 --- a/src/gateway/handlers/voiceServerUpdate.ts +++ b/src/gateway/handlers/voiceServerUpdate.ts @@ -1,5 +1,5 @@ -import { Guild } from '../../structures/guild.ts' -import { VoiceServerUpdatePayload } from '../../types/gateway.ts' +import type { Guild } from '../../structures/guild.ts' +import type { VoiceServerUpdatePayload } from '../../types/gateway.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' export const voiceServerUpdate: GatewayEventHandler = async ( diff --git a/src/gateway/handlers/voiceStateUpdate.ts b/src/gateway/handlers/voiceStateUpdate.ts index 4a68ea3..7babda2 100644 --- a/src/gateway/handlers/voiceStateUpdate.ts +++ b/src/gateway/handlers/voiceStateUpdate.ts @@ -1,7 +1,7 @@ -import { Guild } from '../../structures/guild.ts' -import { VoiceState } from '../../structures/voiceState.ts' -import { MemberPayload } from '../../types/guild.ts' -import { VoiceStatePayload } from '../../types/voice.ts' +import type { Guild } from '../../structures/guild.ts' +import type { VoiceState } from '../../structures/voiceState.ts' +import type { MemberPayload } from '../../types/guild.ts' +import type { VoiceStatePayload } from '../../types/voice.ts' import type { Gateway, GatewayEventHandler } from '../mod.ts' export const voiceStateUpdate: GatewayEventHandler = async ( diff --git a/src/gateway/handlers/webhooksUpdate.ts b/src/gateway/handlers/webhooksUpdate.ts index dc3bf35..eb8a116 100644 --- a/src/gateway/handlers/webhooksUpdate.ts +++ b/src/gateway/handlers/webhooksUpdate.ts @@ -1,7 +1,7 @@ import type { Gateway, GatewayEventHandler } from '../mod.ts' -import { Guild } from '../../structures/guild.ts' -import { WebhooksUpdatePayload } from '../../types/gateway.ts' -import { GuildTextBasedChannel } from '../../structures/guildTextChannel.ts' +import type { Guild } from '../../structures/guild.ts' +import type { WebhooksUpdatePayload } from '../../types/gateway.ts' +import type { GuildTextBasedChannel } from '../../structures/guildTextChannel.ts' export const webhooksUpdate: GatewayEventHandler = async ( gateway: Gateway, diff --git a/src/gateway/mod.ts b/src/gateway/mod.ts index e1f6255..dbf62b6 100644 --- a/src/gateway/mod.ts +++ b/src/gateway/mod.ts @@ -1,5 +1,5 @@ import { unzlib } from '../../deps.ts' -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { GatewayResponse } from '../types/gatewayResponse.ts' import { GatewayOpcodes, @@ -11,8 +11,8 @@ import { import { gatewayHandlers } from './handlers/mod.ts' import { GatewayCache } from '../managers/gatewayCache.ts' import { delay } from '../utils/delay.ts' -import { VoiceChannel } from '../structures/guildVoiceChannel.ts' -import { Guild } from '../structures/guild.ts' +import type { VoiceChannel } from '../structures/guildVoiceChannel.ts' +import type { Guild } from '../structures/guild.ts' import { HarmonyEventEmitter } from '../utils/events.ts' import { decodeText } from '../utils/encoding.ts' import { Constants } from '../types/constants.ts' diff --git a/src/interactions/slashCommand.ts b/src/interactions/slashCommand.ts index cec125a..26237d3 100644 --- a/src/interactions/slashCommand.ts +++ b/src/interactions/slashCommand.ts @@ -1,5 +1,5 @@ import { RESTManager } from '../rest/manager.ts' -import { Guild } from '../structures/guild.ts' +import type { Guild } from '../structures/guild.ts' import { SlashCommandChoice, SlashCommandOption, diff --git a/src/interactions/slashModule.ts b/src/interactions/slashModule.ts index c44368e..2ba0fe3 100644 --- a/src/interactions/slashModule.ts +++ b/src/interactions/slashModule.ts @@ -1,4 +1,4 @@ -import { SlashCommandHandler } from './slashClient.ts' +import type { SlashCommandHandler } from './slashClient.ts' export class SlashModule { name: string = '' diff --git a/src/managers/base.ts b/src/managers/base.ts index ee55df6..39f013b 100644 --- a/src/managers/base.ts +++ b/src/managers/base.ts @@ -1,4 +1,4 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { Collection } from '../utils/collection.ts' /** diff --git a/src/managers/baseChild.ts b/src/managers/baseChild.ts index 8ba5a9a..0d51adf 100644 --- a/src/managers/baseChild.ts +++ b/src/managers/baseChild.ts @@ -1,4 +1,4 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { Collection } from '../utils/collection.ts' import { BaseManager } from './base.ts' diff --git a/src/managers/channels.ts b/src/managers/channels.ts index f1729d1..7738900 100644 --- a/src/managers/channels.ts +++ b/src/managers/channels.ts @@ -2,8 +2,8 @@ import { Client } from '../client/mod.ts' import { Channel } from '../structures/channel.ts' import { Embed } from '../structures/embed.ts' import { Message } from '../structures/message.ts' -import { TextChannel } from '../structures/textChannel.ts' -import { +import type { TextChannel } from '../structures/textChannel.ts' +import type { ChannelPayload, GuildChannelPayload, MessageOptions diff --git a/src/managers/emojis.ts b/src/managers/emojis.ts index bc65d7e..c7068cc 100644 --- a/src/managers/emojis.ts +++ b/src/managers/emojis.ts @@ -1,6 +1,6 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { Emoji } from '../structures/emoji.ts' -import { EmojiPayload } from '../types/emoji.ts' +import type { EmojiPayload } from '../types/emoji.ts' import { GUILD_EMOJI } from '../types/endpoint.ts' import { BaseManager } from './base.ts' diff --git a/src/managers/gatewayCache.ts b/src/managers/gatewayCache.ts index 6719a26..7fc323a 100644 --- a/src/managers/gatewayCache.ts +++ b/src/managers/gatewayCache.ts @@ -1,4 +1,4 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' /** * Cache Manager used for Caching values related to Gateway connection diff --git a/src/managers/guildChannelVoiceStates.ts b/src/managers/guildChannelVoiceStates.ts index aa089e0..68675aa 100644 --- a/src/managers/guildChannelVoiceStates.ts +++ b/src/managers/guildChannelVoiceStates.ts @@ -1,9 +1,9 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { BaseChildManager } from './baseChild.ts' -import { VoiceStatePayload } from '../types/voice.ts' +import type { VoiceStatePayload } from '../types/voice.ts' import { VoiceState } from '../structures/voiceState.ts' import { GuildVoiceStatesManager } from './guildVoiceStates.ts' -import { VoiceChannel } from '../structures/guildVoiceChannel.ts' +import type { VoiceChannel } from '../structures/guildVoiceChannel.ts' export class GuildChannelVoiceStatesManager extends BaseChildManager< VoiceStatePayload, diff --git a/src/managers/guildChannels.ts b/src/managers/guildChannels.ts index d89a3b2..6767647 100644 --- a/src/managers/guildChannels.ts +++ b/src/managers/guildChannels.ts @@ -1,16 +1,16 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { Channel } from '../structures/channel.ts' import { Guild } from '../structures/guild.ts' -import { CategoryChannel } from '../structures/guildCategoryChannel.ts' +import type { CategoryChannel } from '../structures/guildCategoryChannel.ts' import { ChannelTypes, GuildChannelPayload, OverwritePayload } from '../types/channel.ts' -import { GuildChannels, GuildChannelPayloads } from '../types/guild.ts' +import type { GuildChannels, GuildChannelPayloads } from '../types/guild.ts' import { CHANNEL, GUILD_CHANNELS } from '../types/endpoint.ts' import { BaseChildManager } from './baseChild.ts' -import { ChannelsManager } from './channels.ts' +import type { ChannelsManager } from './channels.ts' export interface CreateChannelOptions { name: string diff --git a/src/managers/guildEmojis.ts b/src/managers/guildEmojis.ts index 79aadf6..ba3d76e 100644 --- a/src/managers/guildEmojis.ts +++ b/src/managers/guildEmojis.ts @@ -1,11 +1,11 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { Emoji } from '../structures/emoji.ts' -import { Guild } from '../structures/guild.ts' +import type { Guild } from '../structures/guild.ts' import { Role } from '../structures/role.ts' -import { EmojiPayload } from '../types/emoji.ts' +import type { EmojiPayload } from '../types/emoji.ts' import { CHANNEL, GUILD_EMOJI, GUILD_EMOJIS } from '../types/endpoint.ts' import { BaseChildManager } from './baseChild.ts' -import { EmojisManager } from './emojis.ts' +import type { EmojisManager } from './emojis.ts' import { fetchAuto } from '../../deps.ts' export class GuildEmojisManager extends BaseChildManager { diff --git a/src/managers/guildVoiceStates.ts b/src/managers/guildVoiceStates.ts index 1c7f296..fe791f2 100644 --- a/src/managers/guildVoiceStates.ts +++ b/src/managers/guildVoiceStates.ts @@ -1,9 +1,9 @@ -import { Client } from '../client/mod.ts' -import { Guild } from '../structures/guild.ts' -import { VoiceChannel } from '../structures/guildVoiceChannel.ts' -import { User } from '../structures/user.ts' +import type { Client } from '../client/mod.ts' +import type { Guild } from '../structures/guild.ts' +import type { VoiceChannel } from '../structures/guildVoiceChannel.ts' +import type { User } from '../structures/user.ts' import { VoiceState } from '../structures/voiceState.ts' -import { VoiceStatePayload } from '../types/voice.ts' +import type { VoiceStatePayload } from '../types/voice.ts' import { BaseManager } from './base.ts' export class GuildVoiceStatesManager extends BaseManager< diff --git a/src/managers/guilds.ts b/src/managers/guilds.ts index e69ae1a..714e399 100644 --- a/src/managers/guilds.ts +++ b/src/managers/guilds.ts @@ -1,10 +1,10 @@ import { fetchAuto } from '../../deps.ts' -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { Guild } from '../structures/guild.ts' -import { Template } from '../structures/template.ts' +import type { Template } from '../structures/template.ts' import { Role } from '../structures/role.ts' import { GUILD, GUILDS, GUILD_PREVIEW } from '../types/endpoint.ts' -import { +import type { GuildPayload, MemberPayload, GuildCreateRolePayload, diff --git a/src/managers/invites.ts b/src/managers/invites.ts index 4c875d0..6a7dd4e 100644 --- a/src/managers/invites.ts +++ b/src/managers/invites.ts @@ -1,9 +1,9 @@ -import { GuildTextChannel, User } from '../../mod.ts' -import { Client } from '../client/mod.ts' -import { Guild } from '../structures/guild.ts' +import type { GuildTextChannel, User } from '../../mod.ts' +import type { Client } from '../client/mod.ts' +import type { Guild } from '../structures/guild.ts' import { Invite } from '../structures/invite.ts' import { CHANNEL_INVITES, GUILD_INVITES, INVITE } from '../types/endpoint.ts' -import { InvitePayload } from '../types/invite.ts' +import type { InvitePayload } from '../types/invite.ts' import { BaseManager } from './base.ts' export enum InviteTargetUserType { diff --git a/src/managers/memberRoles.ts b/src/managers/memberRoles.ts index 63f689f..f331e86 100644 --- a/src/managers/memberRoles.ts +++ b/src/managers/memberRoles.ts @@ -1,10 +1,10 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { BaseChildManager } from './baseChild.ts' -import { RolePayload } from '../types/role.ts' +import type { RolePayload } from '../types/role.ts' import { Role } from '../structures/role.ts' -import { Member } from '../structures/member.ts' -import { RolesManager } from './roles.ts' -import { MemberPayload } from '../types/guild.ts' +import type { Member } from '../structures/member.ts' +import type { RolesManager } from './roles.ts' +import type { MemberPayload } from '../types/guild.ts' import { GUILD_MEMBER_ROLE } from '../types/endpoint.ts' export class MemberRolesManager extends BaseChildManager { diff --git a/src/managers/members.ts b/src/managers/members.ts index 77bbe59..9002fb5 100644 --- a/src/managers/members.ts +++ b/src/managers/members.ts @@ -1,9 +1,9 @@ import { User } from '../structures/user.ts' -import { Client } from '../client/mod.ts' -import { Guild } from '../structures/guild.ts' +import type { Client } from '../client/mod.ts' +import type { Guild } from '../structures/guild.ts' import { Member } from '../structures/member.ts' import { GUILD_MEMBER } from '../types/endpoint.ts' -import { MemberPayload } from '../types/guild.ts' +import type { MemberPayload } from '../types/guild.ts' import { BaseManager } from './base.ts' import { Permissions } from '../utils/permissions.ts' diff --git a/src/managers/messageReactions.ts b/src/managers/messageReactions.ts index bca0c3c..71c6231 100644 --- a/src/managers/messageReactions.ts +++ b/src/managers/messageReactions.ts @@ -1,10 +1,9 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { Emoji } from '../structures/emoji.ts' -import { Guild } from '../structures/guild.ts' -import { Message } from '../structures/message.ts' +import type { Message } from '../structures/message.ts' import { MessageReaction } from '../structures/messageReaction.ts' -import { User } from '../structures/user.ts' -import { Reaction } from '../types/channel.ts' +import type { User } from '../structures/user.ts' +import type { Reaction } from '../types/channel.ts' import { MESSAGE_REACTION, MESSAGE_REACTIONS, @@ -19,7 +18,7 @@ export class MessageReactionsManager extends BaseManager< message: Message constructor(client: Client, message: Message) { - super(client, `reactions:${message.id}`, Guild) + super(client, `reactions:${message.id}`, MessageReaction) this.message = message } diff --git a/src/managers/messages.ts b/src/managers/messages.ts index 4f8fa24..05c79aa 100644 --- a/src/managers/messages.ts +++ b/src/managers/messages.ts @@ -1,8 +1,8 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { Message } from '../structures/message.ts' -import { TextChannel } from '../structures/textChannel.ts' +import type { TextChannel } from '../structures/textChannel.ts' import { User } from '../structures/user.ts' -import { MessagePayload } from '../types/channel.ts' +import type { MessagePayload } from '../types/channel.ts' import { CHANNEL_MESSAGE } from '../types/endpoint.ts' import { BaseManager } from './base.ts' diff --git a/src/managers/presences.ts b/src/managers/presences.ts index 7819702..b2fb448 100644 --- a/src/managers/presences.ts +++ b/src/managers/presences.ts @@ -1,8 +1,8 @@ -import { Client } from '../client/mod.ts' -import { Guild } from '../structures/guild.ts' +import type { Client } from '../client/mod.ts' +import type { Guild } from '../structures/guild.ts' import { Presence } from '../structures/presence.ts' import { User } from '../structures/user.ts' -import { PresenceUpdatePayload } from '../types/gateway.ts' +import type { PresenceUpdatePayload } from '../types/gateway.ts' import { BaseManager } from './base.ts' export class GuildPresencesManager extends BaseManager< diff --git a/src/managers/reactionUsers.ts b/src/managers/reactionUsers.ts index 1fb505a..1963150 100644 --- a/src/managers/reactionUsers.ts +++ b/src/managers/reactionUsers.ts @@ -1,6 +1,6 @@ -import { Client } from '../client/mod.ts' -import { MessageReaction } from '../structures/messageReaction.ts' -import { User } from '../structures/user.ts' +import type { Client } from '../client/mod.ts' +import type { MessageReaction } from '../structures/messageReaction.ts' +import type { User } from '../structures/user.ts' import { UsersManager } from './users.ts' export class ReactionUsersManager extends UsersManager { diff --git a/src/managers/roles.ts b/src/managers/roles.ts index 89af0a3..acf2484 100644 --- a/src/managers/roles.ts +++ b/src/managers/roles.ts @@ -1,9 +1,9 @@ import { Permissions } from '../../mod.ts' -import { Client } from '../client/mod.ts' -import { Guild } from '../structures/guild.ts' +import type { Client } from '../client/mod.ts' +import type { Guild } from '../structures/guild.ts' import { Role } from '../structures/role.ts' import { GUILD_ROLE, GUILD_ROLES } from '../types/endpoint.ts' -import { RoleModifyPayload, RolePayload } from '../types/role.ts' +import type { RoleModifyPayload, RolePayload } from '../types/role.ts' import { BaseManager } from './base.ts' export interface CreateGuildRoleOptions { diff --git a/src/managers/users.ts b/src/managers/users.ts index b0c5e85..be526ec 100644 --- a/src/managers/users.ts +++ b/src/managers/users.ts @@ -1,7 +1,7 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { User } from '../structures/user.ts' import { USER } from '../types/endpoint.ts' -import { UserPayload } from '../types/user.ts' +import type { UserPayload } from '../types/user.ts' import { BaseManager } from './base.ts' export class UsersManager extends BaseManager { diff --git a/src/rest/endpoints.ts b/src/rest/endpoints.ts index 8b8207c..ff14299 100644 --- a/src/rest/endpoints.ts +++ b/src/rest/endpoints.ts @@ -1,4 +1,4 @@ -import { ApplicationPayload } from '../types/application.ts' +import type { ApplicationPayload } from '../types/application.ts' import type { ChannelPayload, CreateMessagePayload, @@ -9,9 +9,9 @@ import type { MessagePayload, OverwritePayload } from '../types/channel.ts' -import { CreateEmojiPayload, EmojiPayload } from '../types/emoji.ts' -import { GuildBanAddPayload } from '../types/gateway.ts' -import { GatewayBotPayload } from '../types/gatewayBot.ts' +import type { CreateEmojiPayload, EmojiPayload } from '../types/emoji.ts' +import type { GuildBanAddPayload } from '../types/gateway.ts' +import type { GatewayBotPayload } from '../types/gatewayBot.ts' import type { AuditLogPayload, GuildBanPayload, @@ -25,18 +25,21 @@ import type { GuildWidgetPayload, MemberPayload } from '../types/guild.ts' -import { InvitePayload, InviteWithMetadataPayload } from '../types/invite.ts' -import { RoleModifyPayload, RolePayload } from '../types/role.ts' +import type { + InvitePayload, + InviteWithMetadataPayload +} from '../types/invite.ts' +import type { RoleModifyPayload, RolePayload } from '../types/role.ts' import type { InteractionResponsePayload, SlashCommandPartial, SlashCommandPayload } from '../types/slash.ts' -import { TemplatePayload } from '../types/template.ts' +import type { TemplatePayload } from '../types/template.ts' import type { UserPayload } from '../types/user.ts' -import { VoiceRegion } from '../types/voice.ts' -import { WebhookPayload } from '../types/webhook.ts' -import { Dict } from '../utils/dict.ts' +import type { VoiceRegion } from '../types/voice.ts' +import type { WebhookPayload } from '../types/webhook.ts' +import type { Dict } from '../utils/dict.ts' import type { RESTManager } from './manager.ts' export class RESTEndpoints { diff --git a/src/rest/manager.ts b/src/rest/manager.ts index b0c5166..6e5d334 100644 --- a/src/rest/manager.ts +++ b/src/rest/manager.ts @@ -1,7 +1,7 @@ import { Embed } from '../structures/embed.ts' import { MessageAttachment } from '../structures/message.ts' import { Collection } from '../utils/collection.ts' -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { simplifyAPIError } from '../utils/err_fmt.ts' import { DiscordAPIErrorPayload, diff --git a/src/structures/application.ts b/src/structures/application.ts index 67b4b9a..ea64a35 100644 --- a/src/structures/application.ts +++ b/src/structures/application.ts @@ -1,5 +1,5 @@ -import { Client } from '../client/mod.ts' -import { ApplicationPayload } from '../types/application.ts' +import type { Client } from '../client/mod.ts' +import type { ApplicationPayload } from '../types/application.ts' import { SnowflakeBase } from './base.ts' import { User } from './user.ts' diff --git a/src/structures/base.ts b/src/structures/base.ts index 6d1fb03..56d6eeb 100644 --- a/src/structures/base.ts +++ b/src/structures/base.ts @@ -1,4 +1,4 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { Snowflake } from '../utils/snowflake.ts' export class Base { diff --git a/src/structures/cdn.ts b/src/structures/cdn.ts index 78c8495..2754f7a 100644 --- a/src/structures/cdn.ts +++ b/src/structures/cdn.ts @@ -1,4 +1,4 @@ -import { ImageFormats, ImageSize } from '../types/cdn.ts' +import type { ImageFormats, ImageSize } from '../types/cdn.ts' /** Function to get Image URL from a resource on Discord CDN */ export const ImageURL = ( diff --git a/src/structures/channel.ts b/src/structures/channel.ts index 1e6887b..eea3074 100644 --- a/src/structures/channel.ts +++ b/src/structures/channel.ts @@ -1,20 +1,20 @@ -import { Client } from '../client/mod.ts' -import { +import type { Client } from '../client/mod.ts' +import type { ChannelPayload, ChannelTypes, ModifyChannelOption, ModifyChannelPayload, Overwrite, OverwritePayload, - OverwriteAsArg, - OverrideType + OverwriteAsArg } from '../types/channel.ts' +import { OverrideType } from '../types/channel.ts' import { CHANNEL } from '../types/endpoint.ts' -import { GuildChannelPayloads, GuildChannels } from '../types/guild.ts' +import type { GuildChannelPayloads, GuildChannels } from '../types/guild.ts' import getChannelByType from '../utils/getChannelByType.ts' import { Permissions } from '../utils/permissions.ts' import { SnowflakeBase } from './base.ts' -import { Guild } from './guild.ts' +import type { Guild } from './guild.ts' import { Member } from './member.ts' import { Role } from './role.ts' diff --git a/src/structures/dmChannel.ts b/src/structures/dmChannel.ts index f1afd4a..d2970bb 100644 --- a/src/structures/dmChannel.ts +++ b/src/structures/dmChannel.ts @@ -1,6 +1,6 @@ -import { Client } from '../client/mod.ts' -import { DMChannelPayload } from '../types/channel.ts' -import { UserPayload } from '../types/user.ts' +import type { Client } from '../client/mod.ts' +import type { DMChannelPayload } from '../types/channel.ts' +import type { UserPayload } from '../types/user.ts' import { TextChannel } from './textChannel.ts' export class DMChannel extends TextChannel { diff --git a/src/structures/embed.ts b/src/structures/embed.ts index 5dd32cc..bac6233 100644 --- a/src/structures/embed.ts +++ b/src/structures/embed.ts @@ -1,4 +1,4 @@ -import { +import type { EmbedAuthor, EmbedField, EmbedFooter, @@ -10,7 +10,7 @@ import { EmbedVideo } from '../types/channel.ts' import { Colors, ColorUtil } from '../utils/colorutil.ts' -import { MessageAttachment } from './message.ts' +import type { MessageAttachment } from './message.ts' /** Message Embed Object */ export class Embed { @@ -56,44 +56,72 @@ export class Embed { /** Convert Embed Object to Embed Payload JSON */ toJSON(): EmbedPayload { - let total = 0; - if (this.title?.length !== undefined && this.title?.length > Embed.MAX_TITLE_LENGTH) { + let total = 0 + if ( + this.title?.length !== undefined && + this.title?.length > Embed.MAX_TITLE_LENGTH + ) { total += Number(this.title.length) - throw new Error(`Embed title cannot exceed ${Embed.MAX_TITLE_LENGTH} characters.`) + throw new Error( + `Embed title cannot exceed ${Embed.MAX_TITLE_LENGTH} characters.` + ) } - - if (this.description?.length !== undefined && this.description?.length > Embed.MAX_DESCRIPTION_LENGTH) { + + if ( + this.description?.length !== undefined && + this.description?.length > Embed.MAX_DESCRIPTION_LENGTH + ) { total += Number(this.description.length) - throw new Error(`Embed description cannot exceed ${Embed.MAX_DESCRIPTION_LENGTH} characters.`) + throw new Error( + `Embed description cannot exceed ${Embed.MAX_DESCRIPTION_LENGTH} characters.` + ) } - + if (this.fields?.length !== undefined) { this.fields.forEach((field) => { if (field.name.length > Embed.MAX_FIELD_NAME_LENGTH) { total += Number(field.name.length) - throw new Error(`Embed field name cannot exceed ${Embed.MAX_FIELD_NAME_LENGTH} characters.`) + throw new Error( + `Embed field name cannot exceed ${Embed.MAX_FIELD_NAME_LENGTH} characters.` + ) } - + if (field.value.length > Embed.MAX_FIELD_VALUE_LENGTH) { total += Number(field.value.length) - throw new Error(`Embed field value cannot exceed ${Embed.MAX_FIELD_VALUE_LENGTH} characters.`) + throw new Error( + `Embed field value cannot exceed ${Embed.MAX_FIELD_VALUE_LENGTH} characters.` + ) } }) - if (this.fields.length > Embed.MAX_FIELDS_LENGTH) throw new Error('Embed fields cannot exceed 25 field objects.') + if (this.fields.length > Embed.MAX_FIELDS_LENGTH) + throw new Error('Embed fields cannot exceed 25 field objects.') } - - if (this.footer?.text?.length !== undefined && this.footer?.text?.length > Embed.MAX_FOOTER_TEXT_LENGTH) { + + if ( + this.footer?.text?.length !== undefined && + this.footer?.text?.length > Embed.MAX_FOOTER_TEXT_LENGTH + ) { total += Number(this.footer?.text?.length) - throw new Error(`Embed footer text cannot exceed ${Embed.MAX_FOOTER_TEXT_LENGTH}.`) + throw new Error( + `Embed footer text cannot exceed ${Embed.MAX_FOOTER_TEXT_LENGTH}.` + ) } - - if (this.author?.name?.length !== undefined && this.author?.name?.length > Embed.MAX_AUTHOR_NAME_LENGTH) { + + if ( + this.author?.name?.length !== undefined && + this.author?.name?.length > Embed.MAX_AUTHOR_NAME_LENGTH + ) { total += Number(this.author?.name?.length) - throw new Error(`Embed author name cannot exceed ${Embed.MAX_AUTHOR_NAME_LENGTH}.`) + throw new Error( + `Embed author name cannot exceed ${Embed.MAX_AUTHOR_NAME_LENGTH}.` + ) } - - if (total > Embed.MAX_EMBED_LENGTH) throw new Error(`Embed characters cannot exceed ${Embed.MAX_EMBED_LENGTH} characters in total.`) - + + if (total > Embed.MAX_EMBED_LENGTH) + throw new Error( + `Embed characters cannot exceed ${Embed.MAX_EMBED_LENGTH} characters in total.` + ) + return { title: this.title, type: this.type, diff --git a/src/structures/emoji.ts b/src/structures/emoji.ts index 30d3926..57628cb 100644 --- a/src/structures/emoji.ts +++ b/src/structures/emoji.ts @@ -1,11 +1,11 @@ -import { Client } from '../client/mod.ts' -import { ImageSize } from '../types/cdn.ts' -import { EmojiPayload } from '../types/emoji.ts' +import type { Client } from '../client/mod.ts' +import type { ImageSize } from '../types/cdn.ts' +import type { EmojiPayload } from '../types/emoji.ts' import { CUSTOM_EMOJI, EMOJI } from '../types/endpoint.ts' import { Snowflake } from '../utils/snowflake.ts' import { Base } from './base.ts' import { ImageURL } from './cdn.ts' -import { Guild } from './guild.ts' +import type { Guild } from './guild.ts' import { Role } from './role.ts' import { User } from './user.ts' diff --git a/src/structures/groupChannel.ts b/src/structures/groupChannel.ts index 5d83f72..e318cc2 100644 --- a/src/structures/groupChannel.ts +++ b/src/structures/groupChannel.ts @@ -1,5 +1,5 @@ -import { Client } from '../client/mod.ts' -import { GroupDMChannelPayload } from '../types/channel.ts' +import type { Client } from '../client/mod.ts' +import type { GroupDMChannelPayload } from '../types/channel.ts' import { Channel } from './channel.ts' export class GroupDMChannel extends Channel { diff --git a/src/structures/guild.ts b/src/structures/guild.ts index 0b5843d..022f70a 100644 --- a/src/structures/guild.ts +++ b/src/structures/guild.ts @@ -1,4 +1,4 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { GuildBanPayload, GuildFeatures, @@ -41,12 +41,12 @@ import { GUILD_SPLASH } from '../types/endpoint.ts' import { GuildVoiceStatesManager } from '../managers/guildVoiceStates.ts' -import { RequestMembersOptions } from '../gateway/mod.ts' +import type { RequestMembersOptions } from '../gateway/mod.ts' import { GuildPresencesManager } from '../managers/presences.ts' -import { TemplatePayload } from '../types/template.ts' +import type { TemplatePayload } from '../types/template.ts' import { Template } from './template.ts' import { DiscordAPIError } from '../rest/mod.ts' -import { ImageFormats, ImageSize } from '../types/cdn.ts' +import type { ImageFormats, ImageSize } from '../types/cdn.ts' import { ImageURL } from './cdn.ts' export class GuildBan extends Base { diff --git a/src/structures/guildCategoryChannel.ts b/src/structures/guildCategoryChannel.ts index 02a00f0..be4ab23 100644 --- a/src/structures/guildCategoryChannel.ts +++ b/src/structures/guildCategoryChannel.ts @@ -1,5 +1,5 @@ import { GuildChannel } from './channel.ts' -import { +import type { GuildCategoryChannelPayload, ModifyGuildCategoryChannelOption, ModifyGuildCategoryChannelPayload diff --git a/src/structures/guildTextChannel.ts b/src/structures/guildTextChannel.ts index 05420bd..b5142fd 100644 --- a/src/structures/guildTextChannel.ts +++ b/src/structures/guildTextChannel.ts @@ -1,9 +1,8 @@ import { Mixin } from '../../deps.ts' import { TextChannel } from './textChannel.ts' import { GuildChannel } from './channel.ts' -import { Client } from '../client/mod.ts' -import { - ChannelTypes, +import type { Client } from '../client/mod.ts' +import type { GuildTextBasedChannelPayload, GuildTextChannelPayload, ModifyGuildTextBasedChannelOption, @@ -11,12 +10,13 @@ import { ModifyGuildTextChannelOption, ModifyGuildTextChannelPayload } from '../types/channel.ts' -import { Guild } from './guild.ts' +import { ChannelTypes } from '../types/channel.ts' +import type { Guild } from './guild.ts' import { CHANNEL } from '../types/endpoint.ts' -import { Message } from './message.ts' -import { CreateInviteOptions } from '../managers/invites.ts' -import { Invite } from './invite.ts' -import { CategoryChannel } from './guildCategoryChannel.ts' +import type { Message } from './message.ts' +import type { CreateInviteOptions } from '../managers/invites.ts' +import type { Invite } from './invite.ts' +import type { CategoryChannel } from './guildCategoryChannel.ts' const GUILD_TEXT_BASED_CHANNEL_TYPES: ChannelTypes[] = [ ChannelTypes.GUILD_TEXT, diff --git a/src/structures/guildVoiceChannel.ts b/src/structures/guildVoiceChannel.ts index de4669e..9e41325 100644 --- a/src/structures/guildVoiceChannel.ts +++ b/src/structures/guildVoiceChannel.ts @@ -1,18 +1,18 @@ -import { VoiceServerUpdateData } from '../gateway/handlers/mod.ts' -import { VoiceStateOptions } from '../gateway/mod.ts' -import { Client } from '../client/mod.ts' -import { +import type { VoiceServerUpdateData } from '../gateway/handlers/mod.ts' +import type { VoiceStateOptions } from '../gateway/mod.ts' +import type { Client } from '../client/mod.ts' +import type { GuildVoiceChannelPayload, ModifyVoiceChannelOption, ModifyVoiceChannelPayload } from '../types/channel.ts' import { CHANNEL } from '../types/endpoint.ts' import { GuildChannel } from './channel.ts' -import { Guild } from './guild.ts' -import { VoiceState } from './voiceState.ts' +import type { Guild } from './guild.ts' +import type { VoiceState } from './voiceState.ts' import { GuildChannelVoiceStatesManager } from '../managers/guildChannelVoiceStates.ts' -import { User } from './user.ts' -import { Member } from './member.ts' +import type { User } from './user.ts' +import type { Member } from './member.ts' export interface VoiceServerData extends VoiceServerUpdateData { sessionID: string diff --git a/src/structures/invite.ts b/src/structures/invite.ts index c863a5a..9df9378 100644 --- a/src/structures/invite.ts +++ b/src/structures/invite.ts @@ -1,9 +1,9 @@ -import { Client } from '../client/mod.ts' -import { ChannelPayload } from '../types/channel.ts' +import type { Client } from '../client/mod.ts' +import type { ChannelPayload } from '../types/channel.ts' import { INVITE } from '../types/endpoint.ts' -import { GuildPayload } from '../types/guild.ts' -import { InvitePayload } from '../types/invite.ts' -import { UserPayload } from '../types/user.ts' +import type { GuildPayload } from '../types/guild.ts' +import type { InvitePayload } from '../types/invite.ts' +import type { UserPayload } from '../types/user.ts' import { Base } from './base.ts' export class Invite extends Base { diff --git a/src/structures/member.ts b/src/structures/member.ts index 8d626cd..ef2faaf 100644 --- a/src/structures/member.ts +++ b/src/structures/member.ts @@ -1,13 +1,13 @@ import { MemberRolesManager } from '../managers/memberRoles.ts' -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { GUILD_MEMBER } from '../types/endpoint.ts' -import { MemberPayload } from '../types/guild.ts' +import type { MemberPayload } from '../types/guild.ts' import { Permissions } from '../utils/permissions.ts' import { SnowflakeBase } from './base.ts' -import { Guild } from './guild.ts' +import type { Guild } from './guild.ts' import { VoiceChannel } from './guildVoiceChannel.ts' -import { Role } from './role.ts' -import { User } from './user.ts' +import type { Role } from './role.ts' +import type { User } from './user.ts' export interface MemberData { nick?: string | null diff --git a/src/structures/message.ts b/src/structures/message.ts index 4beb488..1fd5e4e 100644 --- a/src/structures/message.ts +++ b/src/structures/message.ts @@ -8,19 +8,19 @@ import { MessagePayload, MessageReference } from '../types/channel.ts' -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { User } from './user.ts' -import { Member } from './member.ts' +import type { Member } from './member.ts' import { Embed } from './embed.ts' import { CHANNEL_MESSAGE } from '../types/endpoint.ts' import { MessageMentions } from './messageMentions.ts' -import { TextChannel } from './textChannel.ts' -import { GuildTextBasedChannel } from './guildTextChannel.ts' -import { Guild } from './guild.ts' +import type { TextChannel } from './textChannel.ts' +import type { GuildTextBasedChannel } from './guildTextChannel.ts' +import type { Guild } from './guild.ts' import { MessageReactionsManager } from '../managers/messageReactions.ts' import { MessageSticker } from './messageSticker.ts' -import { Emoji } from './emoji.ts' -import { InteractionType } from '../types/slash.ts' +import type { Emoji } from './emoji.ts' +import type { InteractionType } from '../types/slash.ts' import { encodeText } from '../utils/encoding.ts' type AllMessageOptions = MessageOptions | Embed diff --git a/src/structures/messageMentions.ts b/src/structures/messageMentions.ts index 576045f..84c188f 100644 --- a/src/structures/messageMentions.ts +++ b/src/structures/messageMentions.ts @@ -1,9 +1,9 @@ -import { Client } from '../client/mod.ts' -import { MessagePayload } from '../types/channel.ts' +import type { Client } from '../client/mod.ts' +import type { MessagePayload } from '../types/channel.ts' import { Collection } from '../utils/collection.ts' import { GuildTextBasedChannel } from './guildTextChannel.ts' -import { Message } from './message.ts' -import { Role } from './role.ts' +import type { Message } from './message.ts' +import type { Role } from './role.ts' import { User } from './user.ts' export class MessageMentions { diff --git a/src/structures/messageReaction.ts b/src/structures/messageReaction.ts index 91eb410..0802f0b 100644 --- a/src/structures/messageReaction.ts +++ b/src/structures/messageReaction.ts @@ -1,9 +1,9 @@ import { ReactionUsersManager } from '../managers/reactionUsers.ts' -import { Client } from '../client/mod.ts' -import { Reaction } from '../types/channel.ts' +import type { Client } from '../client/mod.ts' +import type { Reaction } from '../types/channel.ts' import { Base } from './base.ts' -import { Emoji } from './emoji.ts' -import { Message } from './message.ts' +import type { Emoji } from './emoji.ts' +import type { Message } from './message.ts' export class MessageReaction extends Base { message: Message diff --git a/src/structures/messageSticker.ts b/src/structures/messageSticker.ts index 300323c..aa04fda 100644 --- a/src/structures/messageSticker.ts +++ b/src/structures/messageSticker.ts @@ -1,5 +1,5 @@ -import { Client } from '../client/mod.ts' -import { +import type { Client } from '../client/mod.ts' +import type { MessageStickerFormatTypes, MessageStickerPayload } from '../types/channel.ts' diff --git a/src/structures/presence.ts b/src/structures/presence.ts index f921555..63eb2c2 100644 --- a/src/structures/presence.ts +++ b/src/structures/presence.ts @@ -7,9 +7,9 @@ import { } from '../types/presence.ts' import { PresenceUpdatePayload, StatusUpdatePayload } from '../types/gateway.ts' import { Base } from './base.ts' -import { Guild } from './guild.ts' -import { User } from './user.ts' -import { Client } from '../client/mod.ts' +import type { Guild } from './guild.ts' +import type { User } from './user.ts' +import type { Client } from '../client/mod.ts' export enum ActivityTypes { PLAYING = 0, diff --git a/src/structures/role.ts b/src/structures/role.ts index 12ec75e..8e05e04 100644 --- a/src/structures/role.ts +++ b/src/structures/role.ts @@ -1,9 +1,9 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { SnowflakeBase } from './base.ts' -import { RoleModifyPayload, RolePayload } from '../types/role.ts' +import type { RoleModifyPayload, RolePayload } from '../types/role.ts' import { Permissions } from '../utils/permissions.ts' -import { Guild } from './guild.ts' -import { Member } from './member.ts' +import type { Guild } from './guild.ts' +import type { Member } from './member.ts' import { User } from './user.ts' /** Represents a Guild Role */ diff --git a/src/structures/slash.ts b/src/structures/slash.ts index 07f4ee7..e8c59f4 100644 --- a/src/structures/slash.ts +++ b/src/structures/slash.ts @@ -1,5 +1,5 @@ -import { Client } from '../client/mod.ts' -import { +import type { Client } from '../client/mod.ts' +import type { AllowedMentionsPayload, ChannelTypes, EmbedPayload, @@ -17,17 +17,17 @@ import { InteractionType, SlashCommandOptionType } from '../types/slash.ts' -import { Dict } from '../utils/dict.ts' +import type { Dict } from '../utils/dict.ts' import { Permissions } from '../utils/permissions.ts' import { SnowflakeBase } from './base.ts' -import { Channel } from './channel.ts' +import type { Channel } from './channel.ts' import { Embed } from './embed.ts' -import { Guild } from './guild.ts' -import { GuildTextChannel } from './guildTextChannel.ts' -import { Member } from './member.ts' +import type { Guild } from './guild.ts' +import type { GuildTextChannel } from './guildTextChannel.ts' +import type { Member } from './member.ts' import { Message } from './message.ts' -import { Role } from './role.ts' -import { TextChannel } from './textChannel.ts' +import type { Role } from './role.ts' +import type { TextChannel } from './textChannel.ts' import { User } from './user.ts' interface WebhookMessageOptions extends MessageOptions { diff --git a/src/structures/template.ts b/src/structures/template.ts index 0c3381a..f29ec73 100644 --- a/src/structures/template.ts +++ b/src/structures/template.ts @@ -1,6 +1,6 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { TEMPLATE } from '../types/endpoint.ts' -import { TemplatePayload } from '../types/template.ts' +import type { TemplatePayload } from '../types/template.ts' import { Base } from './base.ts' import { Guild } from './guild.ts' import { User } from './user.ts' diff --git a/src/structures/textChannel.ts b/src/structures/textChannel.ts index 847d372..7c39672 100644 --- a/src/structures/textChannel.ts +++ b/src/structures/textChannel.ts @@ -1,6 +1,6 @@ import { MessagesManager } from '../managers/messages.ts' -import { Client } from '../client/mod.ts' -import { +import type { Client } from '../client/mod.ts' +import type { MessageOptions, MessagePayload, TextChannelPayload @@ -11,11 +11,11 @@ import { } from '../types/endpoint.ts' import { Collection } from '../utils/collection.ts' import { Channel } from './channel.ts' -import { Embed } from './embed.ts' +import type { Embed } from './embed.ts' import { Emoji } from './emoji.ts' -import { Member } from './member.ts' +import type { Member } from './member.ts' import { Message } from './message.ts' -import { User } from './user.ts' +import type { User } from './user.ts' export type AllMessageOptions = MessageOptions | Embed diff --git a/src/structures/user.ts b/src/structures/user.ts index 5767a7b..4f1ede0 100644 --- a/src/structures/user.ts +++ b/src/structures/user.ts @@ -1,11 +1,11 @@ -import { Client } from '../client/mod.ts' -import { UserPayload } from '../types/user.ts' +import type { Client } from '../client/mod.ts' +import type { UserPayload } from '../types/user.ts' import { UserFlagsManager } from '../utils/userFlags.ts' import { SnowflakeBase } from './base.ts' import { ImageURL } from './cdn.ts' -import { ImageSize, ImageFormats } from '../types/cdn.ts' +import type { ImageSize, ImageFormats } from '../types/cdn.ts' import { DEFAULT_USER_AVATAR, USER_AVATAR } from '../types/endpoint.ts' -import { DMChannel } from './dmChannel.ts' +import type { DMChannel } from './dmChannel.ts' export class User extends SnowflakeBase { id: string diff --git a/src/structures/voiceState.ts b/src/structures/voiceState.ts index 16791e8..634bfbc 100644 --- a/src/structures/voiceState.ts +++ b/src/structures/voiceState.ts @@ -1,11 +1,11 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { ChannelTypes } from '../types/channel.ts' -import { VoiceStatePayload } from '../types/voice.ts' +import type { VoiceStatePayload } from '../types/voice.ts' import { Base } from './base.ts' -import { Guild } from './guild.ts' -import { VoiceChannel } from './guildVoiceChannel.ts' -import { Member } from './member.ts' -import { User } from './user.ts' +import type { Guild } from './guild.ts' +import type { VoiceChannel } from './guildVoiceChannel.ts' +import type { Member } from './member.ts' +import type { User } from './user.ts' export class VoiceState extends Base { guild?: Guild diff --git a/src/structures/webhook.ts b/src/structures/webhook.ts index d7b6ee5..e6fbe9d 100644 --- a/src/structures/webhook.ts +++ b/src/structures/webhook.ts @@ -1,11 +1,11 @@ -import { Client } from '../client/mod.ts' +import type { Client } from '../client/mod.ts' import { RESTManager } from '../rest/mod.ts' -import { MessageOptions } from '../types/channel.ts' -import { UserPayload } from '../types/user.ts' -import { WebhookPayload } from '../types/webhook.ts' +import type { MessageOptions } from '../types/channel.ts' +import type { UserPayload } from '../types/user.ts' +import type { WebhookPayload } from '../types/webhook.ts' import { Embed } from './embed.ts' import { Message } from './message.ts' -import { TextChannel } from './textChannel.ts' +import type { TextChannel } from './textChannel.ts' import { User } from './user.ts' import { fetchAuto } from '../../deps.ts' import { WEBHOOK_MESSAGE } from '../types/endpoint.ts' diff --git a/src/types/application.ts b/src/types/application.ts index ce3782c..4869dfd 100644 --- a/src/types/application.ts +++ b/src/types/application.ts @@ -1,4 +1,4 @@ -import { UserPayload } from './user.ts' +import type { UserPayload } from './user.ts' export interface ApplicationPayload { id: string diff --git a/src/types/channel.ts b/src/types/channel.ts index d3c5180..39e792c 100644 --- a/src/types/channel.ts +++ b/src/types/channel.ts @@ -1,12 +1,12 @@ -import { Embed } from '../structures/embed.ts' -import { Member } from '../structures/member.ts' -import { Message, MessageAttachment } from '../structures/message.ts' -import { Role } from '../structures/role.ts' -import { Permissions } from '../utils/permissions.ts' -import { EmojiPayload } from './emoji.ts' -import { MemberPayload } from './guild.ts' -import { InteractionType } from './slash.ts' -import { UserPayload } from './user.ts' +import type { Embed } from '../structures/embed.ts' +import type { Member } from '../structures/member.ts' +import type { Message, MessageAttachment } from '../structures/message.ts' +import type { Role } from '../structures/role.ts' +import type { Permissions } from '../utils/permissions.ts' +import type { EmojiPayload } from './emoji.ts' +import type { MemberPayload } from './guild.ts' +import type { InteractionType } from './slash.ts' +import type { UserPayload } from './user.ts' export interface ChannelPayload { id: string diff --git a/src/types/emoji.ts b/src/types/emoji.ts index 4228842..d577d54 100644 --- a/src/types/emoji.ts +++ b/src/types/emoji.ts @@ -1,4 +1,4 @@ -import { UserPayload } from './user.ts' +import type { UserPayload } from './user.ts' export interface EmojiPayload { id: string | null diff --git a/src/types/gateway.ts b/src/types/gateway.ts index 8186f6f..d5c2a64 100644 --- a/src/types/gateway.ts +++ b/src/types/gateway.ts @@ -1,18 +1,18 @@ // https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway // https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events -import { Guild } from '../structures/guild.ts' -import { Member } from '../structures/member.ts' -import { EmojiPayload } from './emoji.ts' -import { MemberPayload } from './guild.ts' -import { +import type { Guild } from '../structures/guild.ts' +import type { Member } from '../structures/member.ts' +import type { EmojiPayload } from './emoji.ts' +import type { MemberPayload } from './guild.ts' +import type { ActivityGame, ActivityPayload, StatusType, ClientStatus } from './presence.ts' -import { RolePayload } from './role.ts' -import { SlashCommandPayload } from './slash.ts' -import { UserPayload } from './user.ts' +import type { RolePayload } from './role.ts' +import type { SlashCommandPayload } from './slash.ts' +import type { UserPayload } from './user.ts' /** * Gateway OPcodes from Discord docs. diff --git a/src/types/gatewayResponse.ts b/src/types/gatewayResponse.ts index 6620df8..ce0c366 100644 --- a/src/types/gatewayResponse.ts +++ b/src/types/gatewayResponse.ts @@ -1,4 +1,4 @@ -import { GatewayOpcodes, GatewayEvents } from './gateway.ts' +import type { GatewayOpcodes, GatewayEvents } from './gateway.ts' /** * Gateway response from Discord. diff --git a/src/types/guild.ts b/src/types/guild.ts index 105eb6b..8dcbcac 100644 --- a/src/types/guild.ts +++ b/src/types/guild.ts @@ -1,15 +1,15 @@ -import { GuildChannel } from '../structures/channel.ts' -import { Emoji } from '../structures/emoji.ts' -import { CategoryChannel } from '../structures/guildCategoryChannel.ts' -import { NewsChannel } from '../structures/guildNewsChannel.ts' -import { VoiceChannel } from '../structures/guildVoiceChannel.ts' -import { Role } from '../structures/role.ts' -import { +import type { GuildChannel } from '../structures/channel.ts' +import type { Emoji } from '../structures/emoji.ts' +import type { CategoryChannel } from '../structures/guildCategoryChannel.ts' +import type { NewsChannel } from '../structures/guildNewsChannel.ts' +import type { VoiceChannel } from '../structures/guildVoiceChannel.ts' +import type { Role } from '../structures/role.ts' +import type { GuildTextChannel, GuildTextBasedChannel } from '../structures/guildTextChannel.ts' -import { ApplicationPayload } from './application.ts' -import { +import type { ApplicationPayload } from './application.ts' +import type { ChannelPayload, ChannelTypes, GuildCategoryChannelPayload, @@ -18,12 +18,12 @@ import { GuildTextChannelPayload, GuildVoiceChannelPayload } from './channel.ts' -import { EmojiPayload } from './emoji.ts' -import { PresenceUpdatePayload } from './gateway.ts' -import { RolePayload } from './role.ts' -import { UserPayload } from './user.ts' -import { VoiceStatePayload } from './voice.ts' -import { WebhookPayload } from './webhook.ts' +import type { EmojiPayload } from './emoji.ts' +import type { PresenceUpdatePayload } from './gateway.ts' +import type { RolePayload } from './role.ts' +import type { UserPayload } from './user.ts' +import type { VoiceStatePayload } from './voice.ts' +import type { WebhookPayload } from './webhook.ts' export interface GuildPayload { id: string diff --git a/src/types/invite.ts b/src/types/invite.ts index 7c820c5..0a37a75 100644 --- a/src/types/invite.ts +++ b/src/types/invite.ts @@ -1,8 +1,8 @@ -import { Channel } from '../structures/channel.ts' -import { Guild } from '../structures/guild.ts' -import { ChannelPayload } from './channel.ts' -import { GuildPayload } from './guild.ts' -import { UserPayload } from './user.ts' +import type { Channel } from '../structures/channel.ts' +import type { Guild } from '../structures/guild.ts' +import type { ChannelPayload } from './channel.ts' +import type { GuildPayload } from './guild.ts' +import type { UserPayload } from './user.ts' export interface InvitePayload { code: string diff --git a/src/types/slash.ts b/src/types/slash.ts index faf6221..9b16ea9 100644 --- a/src/types/slash.ts +++ b/src/types/slash.ts @@ -1,12 +1,12 @@ -import { Dict } from '../utils/dict.ts' -import { +import type { Dict } from '../utils/dict.ts' +import type { AllowedMentionsPayload, ChannelTypes, EmbedPayload } from './channel.ts' -import { MemberPayload } from './guild.ts' -import { RolePayload } from './role.ts' -import { UserPayload } from './user.ts' +import type { MemberPayload } from './guild.ts' +import type { RolePayload } from './role.ts' +import type { UserPayload } from './user.ts' export interface InteractionApplicationCommandOption { /** Option name */ diff --git a/src/types/template.ts b/src/types/template.ts index 05fb0a8..d7a462a 100644 --- a/src/types/template.ts +++ b/src/types/template.ts @@ -1,5 +1,5 @@ -import { GuildPayload } from './guild.ts' -import { UserPayload } from './user.ts' +import type { GuildPayload } from './guild.ts' +import type { UserPayload } from './user.ts' export interface TemplatePayload { code: string diff --git a/src/types/voice.ts b/src/types/voice.ts index 76bd9cf..6bb6ffc 100644 --- a/src/types/voice.ts +++ b/src/types/voice.ts @@ -1,4 +1,4 @@ -import { MemberPayload } from './guild.ts' +import type { MemberPayload } from './guild.ts' export enum VoiceOpcodes { IDENTIFY = 0, diff --git a/src/types/webhook.ts b/src/types/webhook.ts index 970f1a7..903d6ae 100644 --- a/src/types/webhook.ts +++ b/src/types/webhook.ts @@ -1,4 +1,4 @@ -import { UserPayload } from './user.ts' +import type { UserPayload } from './user.ts' export interface WebhookPayload { id: string