mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
change(types): move error & file_content to discordeno/ (#903)
* refactor(types): move errors, file_content module to types/discordeno * refactor(types): move error & file_content module to discordeno/ * Update and fix import statements
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
|
||||
import type { CreateGuildChannel } from "../../types/guilds/create_guild_channel.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { bigintToSnowflake } from "../../util/bigint.ts";
|
||||
import { calculatePermissions } from "../../util/permissions.ts";
|
||||
import { createChannel } from "./create_channel.ts";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { ChannelTypes } from "../../types/mod.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { botHasChannelPermissions } from "../../util/permissions.ts";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { cacheHandlers } from "../../../cache.ts";
|
||||
import { rest } from "../../../rest/rest.ts";
|
||||
import { ChannelTypes } from "../../../types/channels/channel_types.ts";
|
||||
import { Errors } from "../../../types/misc/errors.ts";
|
||||
import { Errors } from "../../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../../util/constants.ts";
|
||||
|
||||
// TODO(threads): it seems like the documented return type is wrong
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { cacheHandlers } from "../../../cache.ts";
|
||||
import { rest } from "../../../rest/rest.ts";
|
||||
import { ChannelTypes } from "../../../types/channels/channel_types.ts";
|
||||
import { Errors } from "../../../types/misc/errors.ts";
|
||||
import { Errors } from "../../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../../util/constants.ts";
|
||||
|
||||
/** Removes another user from a thread. Requires the MANAGE_THREADS permission or that you are the creator of the thread. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a Thread Members Update Gateway event. */
|
||||
|
||||
@@ -2,7 +2,7 @@ import { cacheHandlers } from "../../../cache.ts";
|
||||
import { rest } from "../../../rest/rest.ts";
|
||||
import { ChannelTypes } from "../../../types/channels/channel_types.ts";
|
||||
import { StartThread } from "../../../types/channels/threads/start_thread.ts";
|
||||
import { Errors } from "../../../types/misc/errors.ts";
|
||||
import { Errors } from "../../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../../util/constants.ts";
|
||||
import { camelKeysToSnakeCase } from "../../../util/utils.ts";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { rest } from "../../rest/rest.ts";
|
||||
import { structures } from "../../structures/mod.ts";
|
||||
import type { DiscordenoEditWebhookMessage } from "../../types/discordeno/edit_webhook_message.ts";
|
||||
import { DiscordAllowedMentionsTypes } from "../../types/messages/allowed_mentions_types.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
/** To edit your response to a slash command. If a messageId is not provided it will default to editing the original response. */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import type { Emoji } from "../../types/emojis/emoji.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@ import { eventHandlers } from "../../bot.ts";
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import type { Emoji } from "../../types/emojis/emoji.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { snowflakeToBigint } from "../../util/bigint.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import type { GetGuildPruneCountQuery } from "../../types/guilds/get_guild_prune_count.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
||||
import { camelKeysToSnakeCase } from "../../util/utils.ts";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import type { GuildWidgetDetails } from "../../types/guilds/guild_widget_details.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
/** Returns the widget for the guild. */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import type { GetGuildWidgetImageQuery } from "../../types/guilds/get_guild_widget_image.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
/** Returns the widget image URL for the guild. */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import type { CreateChannelInvite } from "../../types/invites/create_channel_invite.ts";
|
||||
import type { Invite } from "../../types/invites/invite.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { requireBotChannelPermissions } from "../../util/permissions.ts";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import type { Invite } from "../../types/invites/invite.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import {
|
||||
botHasChannelPermissions,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import type { User } from "../../types/users/user.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { urlToBase64 } from "../../util/utils.ts";
|
||||
|
||||
@@ -3,7 +3,7 @@ import { rest } from "../../rest/rest.ts";
|
||||
import { structures } from "../../structures/mod.ts";
|
||||
import type { GuildMemberWithUser } from "../../types/guilds/guild_member.ts";
|
||||
import type { ModifyGuildMember } from "../../types/guilds/modify_guild_member.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import type { PermissionStrings } from "../../types/permissions/permission_strings.ts";
|
||||
import { bigintToSnowflake } from "../../util/bigint.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
@@ -3,7 +3,7 @@ import { DiscordenoMember } from "../../structures/member.ts";
|
||||
import { DiscordGatewayOpcodes } from "../../types/codes/gateway_opcodes.ts";
|
||||
import { DiscordGatewayIntents } from "../../types/gateway/gateway_intents.ts";
|
||||
import type { RequestGuildMembers } from "../../types/guilds/request_guild_members.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
import { sendShardMessage } from "../../ws/send_shard_message.ts";
|
||||
import { ws } from "../../ws/ws.ts";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { structures } from "../../structures/mod.ts";
|
||||
import { DiscordGatewayIntents } from "../../types/gateway/gateway_intents.ts";
|
||||
import type { GuildMemberWithUser } from "../../types/guilds/guild_member.ts";
|
||||
import type { ListGuildMembers } from "../../types/guilds/list_guild_members.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { bigintToSnowflake } from "../../util/bigint.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { botId } from "../../bot.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import {
|
||||
highestRole,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import type { BeginGuildPrune } from "../../types/guilds/begin_guild_prune.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
||||
import { camelKeysToSnakeCase } from "../../util/utils.ts";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { DiscordenoMember } from "../../structures/member.ts";
|
||||
import { structures } from "../../structures/mod.ts";
|
||||
import type { GuildMemberWithUser } from "../../types/guilds/guild_member.ts";
|
||||
import type { SearchGuildMembers } from "../../types/members/search_guild_members.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { requireBotChannelPermissions } from "../../util/permissions.ts";
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { DiscordenoMessage } from "../../structures/message.ts";
|
||||
import { structures } from "../../structures/mod.ts";
|
||||
import { EditMessage } from "../../types/messages/edit_message.ts";
|
||||
import type { Message } from "../../types/messages/message.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import type { PermissionStrings } from "../../types/permissions/permission_strings.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { requireBotChannelPermissions } from "../../util/permissions.ts";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { DiscordAllowedMentionsTypes } from "../../types/messages/allowed_mentio
|
||||
import { ButtonStyles } from "../../types/messages/components/button_styles.ts";
|
||||
import type { CreateMessage } from "../../types/messages/create_message.ts";
|
||||
import type { Message } from "../../types/messages/message.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import type { PermissionStrings } from "../../types/permissions/permission_strings.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { requireBotChannelPermissions } from "../../util/permissions.ts";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { botId } from "../../bot.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import {
|
||||
isHigherPosition,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { botId } from "../../bot.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import {
|
||||
isHigherPosition,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import type { CreateWebhook } from "../../types/webhooks/create_webhook.ts";
|
||||
import type { Webhook } from "../../types/webhooks/webhook.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { rest } from "../../rest/rest.ts";
|
||||
import { structures } from "../../structures/mod.ts";
|
||||
import { DiscordAllowedMentionsTypes } from "../../types/messages/allowed_mentions_types.ts";
|
||||
import type { Message } from "../../types/messages/message.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import type { EditWebhookMessage } from "../../types/webhooks/edit_webhook_message.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { rest } from "../../rest/rest.ts";
|
||||
import { structures } from "../../structures/mod.ts";
|
||||
import { DiscordAllowedMentionsTypes } from "../../types/messages/allowed_mentions_types.ts";
|
||||
import type { Message } from "../../types/messages/message.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { Errors } from "../../types/discordeno/errors.ts";
|
||||
import type { ExecuteWebhook } from "../../types/webhooks/execute_webhook.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FileContent } from "../types/misc/file_content.ts";
|
||||
import type { FileContent } from "../types/discordeno/file_content.ts";
|
||||
import { USER_AGENT } from "../util/constants.ts";
|
||||
import { rest, RestPayload, RestRequest } from "./rest.ts";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { cache } from "../cache.ts";
|
||||
import { deleteRole } from "../helpers/roles/delete_role.ts";
|
||||
import { editRole } from "../helpers/roles/edit_role.ts";
|
||||
import { CreateGuildRole } from "../types/guilds/create_guild_role.ts";
|
||||
import { Errors } from "../types/misc/errors.ts";
|
||||
import { Errors } from "../types/discordeno/errors.ts";
|
||||
import type { Role } from "../types/permissions/role.ts";
|
||||
import { snowflakeToBigint } from "../util/bigint.ts";
|
||||
import { Collection } from "../util/collection.ts";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Embed } from "../embeds/embed.ts";
|
||||
import { AllowedMentions } from "../messages/allowed_mentions.ts";
|
||||
import { MessageReference } from "../messages/message_reference.ts";
|
||||
import { FileContent } from "../misc/file_content.ts";
|
||||
import { FileContent } from "../discordeno/file_content.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
import { MessageComponents } from "./components/message_components.ts";
|
||||
|
||||
|
||||
+2
-2
@@ -168,8 +168,8 @@ export * from "./misc/activity_secrets.ts";
|
||||
export * from "./misc/activity_timestamps.ts";
|
||||
export * from "./misc/activity_types.ts";
|
||||
export * from "./misc/client_status.ts";
|
||||
export * from "./misc/errors.ts";
|
||||
export * from "./misc/file_content.ts";
|
||||
export * from "./discordeno/errors.ts";
|
||||
export * from "./discordeno/file_content.ts";
|
||||
export * from "./misc/image_format.ts";
|
||||
export * from "./misc/image_size.ts";
|
||||
export * from "./misc/presence_update.ts";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Embed } from "../embeds/embed.ts";
|
||||
import { AllowedMentions } from "../messages/allowed_mentions.ts";
|
||||
import { Attachment } from "../messages/attachment.ts";
|
||||
import { FileContent } from "../misc/file_content.ts";
|
||||
import { FileContent } from "../discordeno/file_content.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/resources/webhook#edit-webhook-message-jsonform-params */
|
||||
export interface EditWebhookMessage {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Embed } from "../embeds/embed.ts";
|
||||
import { AllowedMentions } from "../messages/allowed_mentions.ts";
|
||||
import { FileContent } from "../misc/file_content.ts";
|
||||
import { FileContent } from "../discordeno/file_content.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/resources/webhook#execute-webhook */
|
||||
|
||||
@@ -5,7 +5,7 @@ import { DiscordenoGuild } from "../structures/guild.ts";
|
||||
import { DiscordenoMember } from "../structures/member.ts";
|
||||
import { DiscordenoRole } from "../structures/role.ts";
|
||||
import { Overwrite } from "../types/channels/overwrite.ts";
|
||||
import { Errors } from "../types/misc/errors.ts";
|
||||
import { Errors } from "../types/discordeno/errors.ts";
|
||||
import { DiscordBitwisePermissionFlags } from "../types/permissions/bitwise_permission_flags.ts";
|
||||
import type { PermissionStrings } from "../types/permissions/permission_strings.ts";
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import type { ApplicationCommandOptionChoice } from "../types/interactions/appli
|
||||
import { DiscordApplicationCommandOptionTypes } from "../types/interactions/application_command_option_types.ts";
|
||||
import type { CreateGlobalApplicationCommand } from "../types/interactions/create_global_application_command.ts";
|
||||
import type { EditGlobalApplicationCommand } from "../types/interactions/edit_global_application_command.ts";
|
||||
import { Errors } from "../types/misc/errors.ts";
|
||||
import { Errors } from "../types/discordeno/errors.ts";
|
||||
import type { DiscordImageFormat } from "../types/misc/image_format.ts";
|
||||
import type { DiscordImageSize } from "../types/misc/image_size.ts";
|
||||
import { SLASH_COMMANDS_NAME_REGEX } from "./constants.ts";
|
||||
|
||||
Reference in New Issue
Block a user