fix: remove util/cdn export

This commit is contained in:
ayntee
2020-12-24 17:59:15 +04:00
parent 3d3e2f3363
commit 8e3fab7411
24 changed files with 50 additions and 51 deletions
+3 -4
View File
@@ -13,15 +13,14 @@ export * from "./src/api/handlers/guild.ts";
export * from "./src/api/handlers/member.ts"; export * from "./src/api/handlers/member.ts";
export * from "./src/api/handlers/message.ts"; export * from "./src/api/handlers/message.ts";
export * from "./src/api/handlers/webhook.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/channel.ts";
export * from "./src/api/structures/guild.ts"; export * from "./src/api/structures/guild.ts";
export * from "./src/api/structures/member.ts"; export * from "./src/api/structures/member.ts";
export * from "./src/api/structures/message.ts"; export * from "./src/api/structures/message.ts";
export * from "./src/api/structures/mod.ts"; export * from "./src/api/structures/mod.ts";
export * from "./src/api/structures/role.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/activity.ts";
export * from "./src/types/cdn.ts"; export * from "./src/types/cdn.ts";
export * from "./src/types/channel.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/presence.ts";
export * from "./src/types/role.ts"; export * from "./src/types/role.ts";
export * from "./src/util/cache.ts"; export * from "./src/util/cache.ts";
export * from "./src/util/cdn.ts";
export * from "./src/util/collection.ts"; export * from "./src/util/collection.ts";
export * from "./src/util/permissions.ts"; export * from "./src/util/permissions.ts";
export * from "./src/util/utils.ts"; export * from "./src/util/utils.ts";
export * from "./src/ws/mod.ts";
+1 -1
View File
@@ -1,7 +1,7 @@
import { Channel, Guild, Member, Message } from "../structures/structures.ts";
import { PresenceUpdatePayload } from "../../types/types.ts"; import { PresenceUpdatePayload } from "../../types/types.ts";
import { cache } from "../../util/cache.ts"; import { cache } from "../../util/cache.ts";
import { Collection } from "../../util/collection.ts"; import { Collection } from "../../util/collection.ts";
import { Channel, Guild, Member, Message } from "../structures/structures.ts";
export type TableName = export type TableName =
| "guilds" | "guilds"
+1 -1
View File
@@ -1,10 +1,10 @@
import { eventHandlers } from "../../bot.ts"; import { eventHandlers } from "../../bot.ts";
import { structures } from "../structures/structures.ts";
import { import {
ChannelCreatePayload, ChannelCreatePayload,
ChannelTypes, ChannelTypes,
DiscordPayload, DiscordPayload,
} from "../../types/types.ts"; } from "../../types/types.ts";
import { structures } from "../structures/structures.ts";
import { cacheHandlers } from "./cache.ts"; import { cacheHandlers } from "./cache.ts";
export async function handleInternalChannelCreate(data: DiscordPayload) { export async function handleInternalChannelCreate(data: DiscordPayload) {
+1 -1
View File
@@ -1,5 +1,4 @@
import { eventHandlers } from "../../bot.ts"; import { eventHandlers } from "../../bot.ts";
import { structures } from "../structures/structures.ts";
import { import {
CreateGuildPayload, CreateGuildPayload,
DiscordPayload, DiscordPayload,
@@ -9,6 +8,7 @@ import {
UpdateGuildPayload, UpdateGuildPayload,
} from "../../types/types.ts"; } from "../../types/types.ts";
import { cache } from "../../util/cache.ts"; import { cache } from "../../util/cache.ts";
import { structures } from "../structures/structures.ts";
import { cacheHandlers } from "./cache.ts"; import { cacheHandlers } from "./cache.ts";
export async function handleInternalGuildCreate( export async function handleInternalGuildCreate(
+4 -2
View File
@@ -1,7 +1,9 @@
import { DiscordPayload } from "../../types/types.ts";
import { eventHandlers } from "../../bot.ts"; import { eventHandlers } from "../../bot.ts";
import {
DiscordPayload,
InteractionCommandPayload,
} from "../../types/types.ts";
import { structures } from "../structures/mod.ts"; import { structures } from "../structures/mod.ts";
import { InteractionCommandPayload } from "../../types/types.ts";
export async function handleInternalInteractionsCreate(data: DiscordPayload) { export async function handleInternalInteractionsCreate(data: DiscordPayload) {
if (data.t !== "INTERACTION_CREATE") return; if (data.t !== "INTERACTION_CREATE") return;
+1 -1
View File
@@ -1,5 +1,4 @@
import { eventHandlers } from "../../bot.ts"; import { eventHandlers } from "../../bot.ts";
import { structures } from "../structures/structures.ts";
import { import {
DiscordPayload, DiscordPayload,
GuildBanPayload, GuildBanPayload,
@@ -8,6 +7,7 @@ import {
GuildMemberUpdatePayload, GuildMemberUpdatePayload,
} from "../../types/types.ts"; } from "../../types/types.ts";
import { cache } from "../../util/cache.ts"; import { cache } from "../../util/cache.ts";
import { structures } from "../structures/structures.ts";
import { cacheHandlers } from "./cache.ts"; import { cacheHandlers } from "./cache.ts";
export async function handleInternalGuildMemberAdd(data: DiscordPayload) { export async function handleInternalGuildMemberAdd(data: DiscordPayload) {
+1 -1
View File
@@ -1,11 +1,11 @@
import { eventHandlers } from "../../bot.ts"; import { eventHandlers } from "../../bot.ts";
import { structures } from "../structures/structures.ts";
import { import {
DiscordPayload, DiscordPayload,
MessageCreateOptions, MessageCreateOptions,
MessageDeleteBulkPayload, MessageDeleteBulkPayload,
MessageDeletePayload, MessageDeletePayload,
} from "../../types/types.ts"; } from "../../types/types.ts";
import { structures } from "../structures/structures.ts";
import { cacheHandlers } from "./cache.ts"; import { cacheHandlers } from "./cache.ts";
export async function handleInternalMessageCreate(data: DiscordPayload) { export async function handleInternalMessageCreate(data: DiscordPayload) {
+5 -5
View File
@@ -1,9 +1,4 @@
import {
initialMemberLoadQueue,
structures,
} from "../structures/structures.ts";
import { eventHandlers, setBotID } from "../../bot.ts"; import { eventHandlers, setBotID } from "../../bot.ts";
import { allowNextShard } from "../../ws/shard_manager.ts";
import { import {
DiscordPayload, DiscordPayload,
PresenceUpdatePayload, PresenceUpdatePayload,
@@ -15,6 +10,11 @@ import {
} from "../../types/types.ts"; } from "../../types/types.ts";
import { cache } from "../../util/cache.ts"; import { cache } from "../../util/cache.ts";
import { delay } from "../../util/utils.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"; import { cacheHandlers } from "./cache.ts";
export async function handleInternalReady( export async function handleInternalReady(
+4 -4
View File
@@ -13,6 +13,10 @@ import {
handleInternalGuildEmojisUpdate, handleInternalGuildEmojisUpdate,
handleInternalGuildUpdate, handleInternalGuildUpdate,
} from "./guilds.ts"; } from "./guilds.ts";
import {
handleInternalInteractionsCommandCreate,
handleInternalInteractionsCreate,
} from "./interactions.ts";
import { import {
handleInternalGuildMemberAdd, handleInternalGuildMemberAdd,
handleInternalGuildMemberRemove, handleInternalGuildMemberRemove,
@@ -44,10 +48,6 @@ import {
handleInternalGuildRoleDelete, handleInternalGuildRoleDelete,
handleInternalGuildRoleUpdate, handleInternalGuildRoleUpdate,
} from "./roles.ts"; } from "./roles.ts";
import {
handleInternalInteractionsCommandCreate,
handleInternalInteractionsCreate,
} from "./interactions.ts";
export let controllers = { export let controllers = {
READY: handleInternalReady, READY: handleInternalReady,
+1 -1
View File
@@ -1,11 +1,11 @@
import { botID, eventHandlers } from "../../bot.ts"; import { botID, eventHandlers } from "../../bot.ts";
import { structures } from "../structures/structures.ts";
import { import {
BaseMessageReactionPayload, BaseMessageReactionPayload,
DiscordPayload, DiscordPayload,
MessageReactionPayload, MessageReactionPayload,
MessageReactionRemoveEmojiPayload, MessageReactionRemoveEmojiPayload,
} from "../../types/types.ts"; } from "../../types/types.ts";
import { structures } from "../structures/structures.ts";
import { cacheHandlers } from "./cache.ts"; import { cacheHandlers } from "./cache.ts";
export async function handleInternalMessageReactionAdd(data: DiscordPayload) { export async function handleInternalMessageReactionAdd(data: DiscordPayload) {
+1 -1
View File
@@ -1,10 +1,10 @@
import { eventHandlers } from "../../bot.ts"; import { eventHandlers } from "../../bot.ts";
import { structures } from "../structures/structures.ts";
import { import {
DiscordPayload, DiscordPayload,
GuildRoleDeletePayload, GuildRoleDeletePayload,
GuildRolePayload, GuildRolePayload,
} from "../../types/types.ts"; } from "../../types/types.ts";
import { structures } from "../structures/structures.ts";
import { cacheHandlers } from "./cache.ts"; import { cacheHandlers } from "./cache.ts";
export async function handleInternalGuildRoleCreate(data: DiscordPayload) { export async function handleInternalGuildRoleCreate(data: DiscordPayload) {
+2 -2
View File
@@ -1,6 +1,4 @@
import { cacheHandlers } from "../controllers/cache.ts";
import { RequestManager } from "../../rest/mod.ts"; import { RequestManager } from "../../rest/mod.ts";
import { structures } from "../structures/structures.ts";
import { import {
ChannelEditOptions, ChannelEditOptions,
ChannelTypes, ChannelTypes,
@@ -23,6 +21,8 @@ import {
botHasChannelPermissions, botHasChannelPermissions,
calculateBits, calculateBits,
} from "../../util/permissions.ts"; } 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 */ /** Checks if a channel overwrite for a user id or a role id has permission in this channel */
export function channelOverwriteHasPermission( export function channelOverwriteHasPermission(
+9 -10
View File
@@ -1,13 +1,5 @@
import { cacheHandlers } from "../controllers/cache.ts";
import { identifyPayload } from "../../bot.ts"; import { identifyPayload } from "../../bot.ts";
import { RequestManager } from "../../rest/mod.ts"; import { RequestManager } from "../../rest/mod.ts";
import { requestAllMembers } from "../../ws/shard_manager.ts";
import {
Guild,
Member,
structures,
Template,
} from "../structures/structures.ts";
import { import {
AuditLogs, AuditLogs,
BannedUser, BannedUser,
@@ -40,11 +32,18 @@ import {
UpdateGuildPayload, UpdateGuildPayload,
UserPayload, UserPayload,
} from "../../types/types.ts"; } from "../../types/types.ts";
import { formatImageURL } from "../../util/cdn.ts";
import { Collection } from "../../util/collection.ts"; import { Collection } from "../../util/collection.ts";
import { endpoints } from "../../util/constants.ts"; import { endpoints } from "../../util/constants.ts";
import { botHasPermission, calculateBits } from "../../util/permissions.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. */ /** 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) { export async function createServer(options: CreateServerOptions) {
+3 -4
View File
@@ -1,7 +1,5 @@
import { cacheHandlers } from "../controllers/cache.ts";
import { botID } from "../../bot.ts"; import { botID } from "../../bot.ts";
import { RequestManager } from "../../rest/mod.ts"; import { RequestManager } from "../../rest/mod.ts";
import { Member, structures } from "../structures/structures.ts";
import { import {
DMChannelCreatePayload, DMChannelCreatePayload,
EditMemberOptions, EditMemberOptions,
@@ -10,14 +8,15 @@ import {
ImageSize, ImageSize,
MessageContent, MessageContent,
} from "../../types/types.ts"; } from "../../types/types.ts";
import { formatImageURL } from "../../util/cdn.ts";
import { endpoints } from "../../util/constants.ts"; import { endpoints } from "../../util/constants.ts";
import { import {
botHasPermission, botHasPermission,
higherRolePosition, higherRolePosition,
highestRole, highestRole,
} from "../../util/permissions.ts"; } 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"; import { sendMessage } from "./channel.ts";
/** The users custom avatar or the default avatar if you don't have a member object. */ /** The users custom avatar or the default avatar if you don't have a member object. */
+2 -2
View File
@@ -1,7 +1,5 @@
import { cacheHandlers } from "../controllers/cache.ts";
import { botID } from "../../bot.ts"; import { botID } from "../../bot.ts";
import { RequestManager } from "../../rest/mod.ts"; import { RequestManager } from "../../rest/mod.ts";
import { Message, structures } from "../structures/structures.ts";
import { import {
Errors, Errors,
MessageContent, MessageContent,
@@ -11,6 +9,8 @@ import {
import { endpoints } from "../../util/constants.ts"; import { endpoints } from "../../util/constants.ts";
import { botHasChannelPermissions } from "../../util/permissions.ts"; import { botHasChannelPermissions } from "../../util/permissions.ts";
import { delay } from "../../util/utils.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. */ /** Delete a message with the channel id and message id only. */
export async function deleteMessageByID( export async function deleteMessageByID(
+3 -3
View File
@@ -1,5 +1,5 @@
import { botID } from "../../bot.ts";
import { RequestManager } from "../../rest/mod.ts"; import { RequestManager } from "../../rest/mod.ts";
import { structures } from "../structures/structures.ts";
import { import {
CreateSlashCommandOptions, CreateSlashCommandOptions,
EditSlashCommandOptions, EditSlashCommandOptions,
@@ -13,11 +13,11 @@ import {
WebhookCreateOptions, WebhookCreateOptions,
WebhookPayload, WebhookPayload,
} from "../../types/types.ts"; } from "../../types/types.ts";
import { cache } from "../../util/cache.ts";
import { endpoints } from "../../util/constants.ts"; import { endpoints } from "../../util/constants.ts";
import { botHasChannelPermissions } from "../../util/permissions.ts"; import { botHasChannelPermissions } from "../../util/permissions.ts";
import { urlToBase64 } from "../../util/utils.ts"; import { urlToBase64 } from "../../util/utils.ts";
import { botID } from "../../bot.ts"; import { structures } from "../structures/structures.ts";
import { cache } from "../../util/cache.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: /** 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 -1
View File
@@ -1,5 +1,5 @@
import { cacheHandlers } from "../controllers/cache.ts";
import { ChannelCreatePayload, Unpromise } from "../../types/types.ts"; import { ChannelCreatePayload, Unpromise } from "../../types/types.ts";
import { cacheHandlers } from "../controllers/cache.ts";
export async function createChannel( export async function createChannel(
data: ChannelCreatePayload, data: ChannelCreatePayload,
+1 -1
View File
@@ -1,10 +1,10 @@
import { cacheHandlers } from "../controllers/cache.ts";
import { import {
GuildMember, GuildMember,
MemberCreatePayload, MemberCreatePayload,
Unpromise, Unpromise,
} from "../../types/types.ts"; } from "../../types/types.ts";
import { Collection } from "../../util/collection.ts"; import { Collection } from "../../util/collection.ts";
import { cacheHandlers } from "../controllers/cache.ts";
export async function createMember(data: MemberCreatePayload, guildID: string) { export async function createMember(data: MemberCreatePayload, guildID: string) {
const { const {
+1 -1
View File
@@ -1,6 +1,6 @@
import { Embed } from "./embed.ts"; import { Embed } from "./embed.ts";
import { AllowedMentions } from "./misc.ts";
import { MemberCreatePayload } from "./member.ts"; import { MemberCreatePayload } from "./member.ts";
import { AllowedMentions } from "./misc.ts";
export interface Interaction { export interface Interaction {
/** The id of the interaction */ /** The id of the interaction */
+1 -1
View File
@@ -1,6 +1,6 @@
export * from "./embed.ts"; export * from "./embed.ts";
export * from "./interactions.ts"; export * from "./interactions.ts";
export * from "./member.ts";
export * from "./misc.ts"; export * from "./misc.ts";
export * from "./slash.ts"; export * from "./slash.ts";
export * from "./member.ts";
export * from "./webhook.ts"; export * from "./webhook.ts";
+1 -1
View File
@@ -1,7 +1,7 @@
import { authorization, eventHandlers } from "../bot.ts";
import { Errors, HttpResponseCode, RequestMethods } from "../types/types.ts"; import { Errors, HttpResponseCode, RequestMethods } from "../types/types.ts";
import { baseEndpoints, discordAPIURLS } from "../util/constants.ts"; import { baseEndpoints, discordAPIURLS } from "../util/constants.ts";
import { delay } from "../util/utils.ts"; import { delay } from "../util/utils.ts";
import { authorization, eventHandlers } from "../bot.ts";
const pathQueues: { [key: string]: QueuedRequest[] } = {}; const pathQueues: { [key: string]: QueuedRequest[] } = {};
const ratelimitedPaths = new Map<string, RateLimitedPath>(); const ratelimitedPaths = new Map<string, RateLimitedPath>();
+1 -1
View File
@@ -5,6 +5,7 @@ export * from "./discord.ts";
export * from "./errors.ts"; export * from "./errors.ts";
export * from "./fetch.ts"; export * from "./fetch.ts";
export * from "./guild.ts"; export * from "./guild.ts";
export * from "./interactions.ts";
export * from "./member.ts"; export * from "./member.ts";
export * from "./message.ts"; export * from "./message.ts";
export * from "./misc.ts"; export * from "./misc.ts";
@@ -13,4 +14,3 @@ export * from "./permission.ts";
export * from "./presence.ts"; export * from "./presence.ts";
export * from "./role.ts"; export * from "./role.ts";
export * from "./webhook.ts"; export * from "./webhook.ts";
export * from "./interactions.ts";
+1 -1
View File
@@ -1,6 +1,6 @@
import { cacheHandlers } from "../api/controllers/cache.ts"; import { cacheHandlers } from "../api/controllers/cache.ts";
import { botID } from "../bot.ts";
import { Guild, Role } from "../api/structures/structures.ts"; import { Guild, Role } from "../api/structures/structures.ts";
import { botID } from "../bot.ts";
import { Permission, Permissions, RawOverwrite } from "../types/types.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. */ /** Checks if the member has this permission. If the member is an owner or has admin perms it will always be true. */
+1 -1
View File
@@ -1,5 +1,6 @@
import { controllers } from "../api/controllers/mod.ts"; import { controllers } from "../api/controllers/mod.ts";
import { Guild } from "../api/structures/structures.ts"; import { Guild } from "../api/structures/structures.ts";
import { eventHandlers, IdentifyPayload } from "../bot.ts";
import { import {
DiscordBotGatewayData, DiscordBotGatewayData,
DiscordPayload, DiscordPayload,
@@ -13,7 +14,6 @@ import {
createShard, createShard,
requestGuildMembers, requestGuildMembers,
} from "./mod.ts"; } from "./mod.ts";
import { eventHandlers, IdentifyPayload } from "../bot.ts";
let createNextShard = true; let createNextShard = true;