From dd8c51f3d211fbac236c1d780b883495fb6c11ed Mon Sep 17 00:00:00 2001 From: rigormorrtiss Date: Tue, 18 May 2021 20:31:49 +0400 Subject: [PATCH] change: import types from specific files (#953) * fix: import types from specific files * Use import syntax for enums --- src/handlers/roles/GUILD_ROLE_CREATE.ts | 2 +- src/handlers/roles/GUILD_ROLE_UPDATE.ts | 2 +- src/helpers/channels/delete_channel.ts | 2 +- src/helpers/channels/threads/add_to_thread.ts | 3 ++- src/helpers/guilds/get_welcome_screen.ts | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/handlers/roles/GUILD_ROLE_CREATE.ts b/src/handlers/roles/GUILD_ROLE_CREATE.ts index c8801e2ce..1cae6d396 100644 --- a/src/handlers/roles/GUILD_ROLE_CREATE.ts +++ b/src/handlers/roles/GUILD_ROLE_CREATE.ts @@ -2,7 +2,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; import { structures } from "../../structures/mod.ts"; import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; -import type { GuildRoleCreate } from "../../types/mod.ts"; +import type { GuildRoleCreate } from "../../types/guilds/guild_role_create.ts"; import { snowflakeToBigint } from "../../util/bigint.ts"; export async function handleGuildRoleCreate(data: DiscordGatewayPayload) { diff --git a/src/handlers/roles/GUILD_ROLE_UPDATE.ts b/src/handlers/roles/GUILD_ROLE_UPDATE.ts index e3c1b445f..6ee6f7cba 100644 --- a/src/handlers/roles/GUILD_ROLE_UPDATE.ts +++ b/src/handlers/roles/GUILD_ROLE_UPDATE.ts @@ -2,7 +2,7 @@ import { eventHandlers } from "../../bot.ts"; import { cacheHandlers } from "../../cache.ts"; import { structures } from "../../structures/mod.ts"; import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts"; -import type { GuildRoleUpdate } from "../../types/mod.ts"; +import type { GuildRoleUpdate } from "../../types/guilds/guild_role_update.ts"; import { snowflakeToBigint } from "../../util/bigint.ts"; export async function handleGuildRoleUpdate(data: DiscordGatewayPayload) { diff --git a/src/helpers/channels/delete_channel.ts b/src/helpers/channels/delete_channel.ts index ed443c78a..a6b0fc5e2 100644 --- a/src/helpers/channels/delete_channel.ts +++ b/src/helpers/channels/delete_channel.ts @@ -1,7 +1,7 @@ import { cacheHandlers } from "../../cache.ts"; import { rest } from "../../rest/rest.ts"; import { Errors } from "../../types/discordeno/errors.ts"; -import { ChannelTypes } from "../../types/mod.ts"; +import { ChannelTypes } from "../../types/channels/channel_types.ts"; import { endpoints } from "../../util/constants.ts"; import { requireBotGuildPermissions } from "../../util/permissions.ts"; diff --git a/src/helpers/channels/threads/add_to_thread.ts b/src/helpers/channels/threads/add_to_thread.ts index c38ce9ebe..aa5d3f1e5 100644 --- a/src/helpers/channels/threads/add_to_thread.ts +++ b/src/helpers/channels/threads/add_to_thread.ts @@ -1,6 +1,7 @@ import { cacheHandlers } from "../../../cache.ts"; import { rest } from "../../../rest/rest.ts"; -import { ChannelTypes, Errors } from "../../../types/mod.ts"; +import { ChannelTypes } from "../../../types/channels/channel_types.ts"; +import { Errors } from "../../../types/discordeno/errors.ts"; import { endpoints } from "../../../util/constants.ts"; //TODO(threads): this does not work rn /** Adds the current user to a thread. Returns a 204 empty response on success. Also requires the thread is not archived. Fires a Thread Members Update Gateway event.Adds another user to a thread. Requires the ability to send messages in the thread. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a Thread Members Update Gateway event. diff --git a/src/helpers/guilds/get_welcome_screen.ts b/src/helpers/guilds/get_welcome_screen.ts index 2b20e2826..22a570e6a 100644 --- a/src/helpers/guilds/get_welcome_screen.ts +++ b/src/helpers/guilds/get_welcome_screen.ts @@ -1,5 +1,5 @@ import { rest } from "../../rest/rest.ts"; -import type { WelcomeScreen } from "../../types/mod.ts"; +import type { WelcomeScreen } from "../../types/guilds/welcome_screen.ts"; import { endpoints } from "../../util/constants.ts"; export async function getWelcomeScreen(guildId: bigint) {