mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
fix: remove util/cdn export
This commit is contained in:
@@ -13,15 +13,14 @@ export * from "./src/api/handlers/guild.ts";
|
||||
export * from "./src/api/handlers/member.ts";
|
||||
export * from "./src/api/handlers/message.ts";
|
||||
export * from "./src/api/handlers/webhook.ts";
|
||||
export * from "./src/bot.ts";
|
||||
export * from "./src/rest/mod.ts";
|
||||
export * from "./src/ws/mod.ts";
|
||||
export * from "./src/api/structures/channel.ts";
|
||||
export * from "./src/api/structures/guild.ts";
|
||||
export * from "./src/api/structures/member.ts";
|
||||
export * from "./src/api/structures/message.ts";
|
||||
export * from "./src/api/structures/mod.ts";
|
||||
export * from "./src/api/structures/role.ts";
|
||||
export * from "./src/bot.ts";
|
||||
export * from "./src/rest/mod.ts";
|
||||
export * from "./src/types/activity.ts";
|
||||
export * from "./src/types/cdn.ts";
|
||||
export * from "./src/types/channel.ts";
|
||||
@@ -36,7 +35,7 @@ export * from "./src/types/permission.ts";
|
||||
export * from "./src/types/presence.ts";
|
||||
export * from "./src/types/role.ts";
|
||||
export * from "./src/util/cache.ts";
|
||||
export * from "./src/util/cdn.ts";
|
||||
export * from "./src/util/collection.ts";
|
||||
export * from "./src/util/permissions.ts";
|
||||
export * from "./src/util/utils.ts";
|
||||
export * from "./src/ws/mod.ts";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Channel, Guild, Member, Message } from "../structures/structures.ts";
|
||||
import { PresenceUpdatePayload } from "../../types/types.ts";
|
||||
import { cache } from "../../util/cache.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
import { Channel, Guild, Member, Message } from "../structures/structures.ts";
|
||||
|
||||
export type TableName =
|
||||
| "guilds"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import {
|
||||
ChannelCreatePayload,
|
||||
ChannelTypes,
|
||||
DiscordPayload,
|
||||
} from "../../types/types.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import { cacheHandlers } from "./cache.ts";
|
||||
|
||||
export async function handleInternalChannelCreate(data: DiscordPayload) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import {
|
||||
CreateGuildPayload,
|
||||
DiscordPayload,
|
||||
@@ -9,6 +8,7 @@ import {
|
||||
UpdateGuildPayload,
|
||||
} from "../../types/types.ts";
|
||||
import { cache } from "../../util/cache.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import { cacheHandlers } from "./cache.ts";
|
||||
|
||||
export async function handleInternalGuildCreate(
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { DiscordPayload } from "../../types/types.ts";
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import {
|
||||
DiscordPayload,
|
||||
InteractionCommandPayload,
|
||||
} from "../../types/types.ts";
|
||||
import { structures } from "../structures/mod.ts";
|
||||
import { InteractionCommandPayload } from "../../types/types.ts";
|
||||
|
||||
export async function handleInternalInteractionsCreate(data: DiscordPayload) {
|
||||
if (data.t !== "INTERACTION_CREATE") return;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import {
|
||||
DiscordPayload,
|
||||
GuildBanPayload,
|
||||
@@ -8,6 +7,7 @@ import {
|
||||
GuildMemberUpdatePayload,
|
||||
} from "../../types/types.ts";
|
||||
import { cache } from "../../util/cache.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import { cacheHandlers } from "./cache.ts";
|
||||
|
||||
export async function handleInternalGuildMemberAdd(data: DiscordPayload) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import {
|
||||
DiscordPayload,
|
||||
MessageCreateOptions,
|
||||
MessageDeleteBulkPayload,
|
||||
MessageDeletePayload,
|
||||
} from "../../types/types.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import { cacheHandlers } from "./cache.ts";
|
||||
|
||||
export async function handleInternalMessageCreate(data: DiscordPayload) {
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
initialMemberLoadQueue,
|
||||
structures,
|
||||
} from "../structures/structures.ts";
|
||||
import { eventHandlers, setBotID } from "../../bot.ts";
|
||||
import { allowNextShard } from "../../ws/shard_manager.ts";
|
||||
import {
|
||||
DiscordPayload,
|
||||
PresenceUpdatePayload,
|
||||
@@ -15,6 +10,11 @@ import {
|
||||
} from "../../types/types.ts";
|
||||
import { cache } from "../../util/cache.ts";
|
||||
import { delay } from "../../util/utils.ts";
|
||||
import { allowNextShard } from "../../ws/shard_manager.ts";
|
||||
import {
|
||||
initialMemberLoadQueue,
|
||||
structures,
|
||||
} from "../structures/structures.ts";
|
||||
import { cacheHandlers } from "./cache.ts";
|
||||
|
||||
export async function handleInternalReady(
|
||||
|
||||
@@ -13,6 +13,10 @@ import {
|
||||
handleInternalGuildEmojisUpdate,
|
||||
handleInternalGuildUpdate,
|
||||
} from "./guilds.ts";
|
||||
import {
|
||||
handleInternalInteractionsCommandCreate,
|
||||
handleInternalInteractionsCreate,
|
||||
} from "./interactions.ts";
|
||||
import {
|
||||
handleInternalGuildMemberAdd,
|
||||
handleInternalGuildMemberRemove,
|
||||
@@ -44,10 +48,6 @@ import {
|
||||
handleInternalGuildRoleDelete,
|
||||
handleInternalGuildRoleUpdate,
|
||||
} from "./roles.ts";
|
||||
import {
|
||||
handleInternalInteractionsCommandCreate,
|
||||
handleInternalInteractionsCreate,
|
||||
} from "./interactions.ts";
|
||||
|
||||
export let controllers = {
|
||||
READY: handleInternalReady,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { botID, eventHandlers } from "../../bot.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import {
|
||||
BaseMessageReactionPayload,
|
||||
DiscordPayload,
|
||||
MessageReactionPayload,
|
||||
MessageReactionRemoveEmojiPayload,
|
||||
} from "../../types/types.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import { cacheHandlers } from "./cache.ts";
|
||||
|
||||
export async function handleInternalMessageReactionAdd(data: DiscordPayload) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import {
|
||||
DiscordPayload,
|
||||
GuildRoleDeletePayload,
|
||||
GuildRolePayload,
|
||||
} from "../../types/types.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import { cacheHandlers } from "./cache.ts";
|
||||
|
||||
export async function handleInternalGuildRoleCreate(data: DiscordPayload) {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
import { RequestManager } from "../../rest/mod.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import {
|
||||
ChannelEditOptions,
|
||||
ChannelTypes,
|
||||
@@ -23,6 +21,8 @@ import {
|
||||
botHasChannelPermissions,
|
||||
calculateBits,
|
||||
} from "../../util/permissions.ts";
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
|
||||
/** Checks if a channel overwrite for a user id or a role id has permission in this channel */
|
||||
export function channelOverwriteHasPermission(
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
import { identifyPayload } from "../../bot.ts";
|
||||
import { RequestManager } from "../../rest/mod.ts";
|
||||
import { requestAllMembers } from "../../ws/shard_manager.ts";
|
||||
import {
|
||||
Guild,
|
||||
Member,
|
||||
structures,
|
||||
Template,
|
||||
} from "../structures/structures.ts";
|
||||
import {
|
||||
AuditLogs,
|
||||
BannedUser,
|
||||
@@ -40,11 +32,18 @@ import {
|
||||
UpdateGuildPayload,
|
||||
UserPayload,
|
||||
} from "../../types/types.ts";
|
||||
import { formatImageURL } from "../../util/cdn.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { botHasPermission, calculateBits } from "../../util/permissions.ts";
|
||||
import { urlToBase64 } from "../../util/utils.ts";
|
||||
import { formatImageURL, urlToBase64 } from "../../util/utils.ts";
|
||||
import { requestAllMembers } from "../../ws/shard_manager.ts";
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
import {
|
||||
Guild,
|
||||
Member,
|
||||
structures,
|
||||
Template,
|
||||
} from "../structures/structures.ts";
|
||||
|
||||
/** Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event. This endpoint can be used only by bots in less than 10 guilds. */
|
||||
export async function createServer(options: CreateServerOptions) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
import { botID } from "../../bot.ts";
|
||||
import { RequestManager } from "../../rest/mod.ts";
|
||||
import { Member, structures } from "../structures/structures.ts";
|
||||
import {
|
||||
DMChannelCreatePayload,
|
||||
EditMemberOptions,
|
||||
@@ -10,14 +8,15 @@ import {
|
||||
ImageSize,
|
||||
MessageContent,
|
||||
} from "../../types/types.ts";
|
||||
import { formatImageURL } from "../../util/cdn.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import {
|
||||
botHasPermission,
|
||||
higherRolePosition,
|
||||
highestRole,
|
||||
} from "../../util/permissions.ts";
|
||||
import { urlToBase64 } from "../../util/utils.ts";
|
||||
import { formatImageURL, urlToBase64 } from "../../util/utils.ts";
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
import { Member, structures } from "../structures/structures.ts";
|
||||
import { sendMessage } from "./channel.ts";
|
||||
|
||||
/** The users custom avatar or the default avatar if you don't have a member object. */
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
import { botID } from "../../bot.ts";
|
||||
import { RequestManager } from "../../rest/mod.ts";
|
||||
import { Message, structures } from "../structures/structures.ts";
|
||||
import {
|
||||
Errors,
|
||||
MessageContent,
|
||||
@@ -11,6 +9,8 @@ import {
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { botHasChannelPermissions } from "../../util/permissions.ts";
|
||||
import { delay } from "../../util/utils.ts";
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
import { Message, structures } from "../structures/structures.ts";
|
||||
|
||||
/** Delete a message with the channel id and message id only. */
|
||||
export async function deleteMessageByID(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { botID } from "../../bot.ts";
|
||||
import { RequestManager } from "../../rest/mod.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
import {
|
||||
CreateSlashCommandOptions,
|
||||
EditSlashCommandOptions,
|
||||
@@ -13,11 +13,11 @@ import {
|
||||
WebhookCreateOptions,
|
||||
WebhookPayload,
|
||||
} from "../../types/types.ts";
|
||||
import { cache } from "../../util/cache.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { botHasChannelPermissions } from "../../util/permissions.ts";
|
||||
import { urlToBase64 } from "../../util/utils.ts";
|
||||
import { botID } from "../../bot.ts";
|
||||
import { cache } from "../../util/cache.ts";
|
||||
import { structures } from "../structures/structures.ts";
|
||||
|
||||
/** Create a new webhook. Requires the MANAGE_WEBHOOKS permission. Returns a webhook object on success. Webhook names follow our naming restrictions that can be found in our Usernames and Nicknames documentation, with the following additional stipulations:
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
import { ChannelCreatePayload, Unpromise } from "../../types/types.ts";
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
|
||||
export async function createChannel(
|
||||
data: ChannelCreatePayload,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
import {
|
||||
GuildMember,
|
||||
MemberCreatePayload,
|
||||
Unpromise,
|
||||
} from "../../types/types.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
|
||||
export async function createMember(data: MemberCreatePayload, guildID: string) {
|
||||
const {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Embed } from "./embed.ts";
|
||||
import { AllowedMentions } from "./misc.ts";
|
||||
import { MemberCreatePayload } from "./member.ts";
|
||||
import { AllowedMentions } from "./misc.ts";
|
||||
|
||||
export interface Interaction {
|
||||
/** The id of the interaction */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export * from "./embed.ts";
|
||||
export * from "./interactions.ts";
|
||||
export * from "./member.ts";
|
||||
export * from "./misc.ts";
|
||||
export * from "./slash.ts";
|
||||
export * from "./member.ts";
|
||||
export * from "./webhook.ts";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { authorization, eventHandlers } from "../bot.ts";
|
||||
import { Errors, HttpResponseCode, RequestMethods } from "../types/types.ts";
|
||||
import { baseEndpoints, discordAPIURLS } from "../util/constants.ts";
|
||||
import { delay } from "../util/utils.ts";
|
||||
import { authorization, eventHandlers } from "../bot.ts";
|
||||
|
||||
const pathQueues: { [key: string]: QueuedRequest[] } = {};
|
||||
const ratelimitedPaths = new Map<string, RateLimitedPath>();
|
||||
|
||||
+1
-1
@@ -5,6 +5,7 @@ export * from "./discord.ts";
|
||||
export * from "./errors.ts";
|
||||
export * from "./fetch.ts";
|
||||
export * from "./guild.ts";
|
||||
export * from "./interactions.ts";
|
||||
export * from "./member.ts";
|
||||
export * from "./message.ts";
|
||||
export * from "./misc.ts";
|
||||
@@ -13,4 +14,3 @@ export * from "./permission.ts";
|
||||
export * from "./presence.ts";
|
||||
export * from "./role.ts";
|
||||
export * from "./webhook.ts";
|
||||
export * from "./interactions.ts";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cacheHandlers } from "../api/controllers/cache.ts";
|
||||
import { botID } from "../bot.ts";
|
||||
import { Guild, Role } from "../api/structures/structures.ts";
|
||||
import { botID } from "../bot.ts";
|
||||
import { Permission, Permissions, RawOverwrite } from "../types/types.ts";
|
||||
|
||||
/** Checks if the member has this permission. If the member is an owner or has admin perms it will always be true. */
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { controllers } from "../api/controllers/mod.ts";
|
||||
import { Guild } from "../api/structures/structures.ts";
|
||||
import { eventHandlers, IdentifyPayload } from "../bot.ts";
|
||||
import {
|
||||
DiscordBotGatewayData,
|
||||
DiscordPayload,
|
||||
@@ -13,7 +14,6 @@ import {
|
||||
createShard,
|
||||
requestGuildMembers,
|
||||
} from "./mod.ts";
|
||||
import { eventHandlers, IdentifyPayload } from "../bot.ts";
|
||||
|
||||
let createNextShard = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user