mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 17:00:08 +00:00
Merge pull request #110 from Skillz4Killz/deps
Segregate all external dependencies to deps.ts
This commit is contained in:
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"deno.enable": true,
|
||||
"editor.formatOnSave": true
|
||||
"editor.formatOnSave": true,
|
||||
"deno.import_intellisense_origins": {
|
||||
"https://deno.land": true
|
||||
}
|
||||
}
|
||||
|
||||
10
deps.ts
Normal file
10
deps.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export { encode } from "https://deno.land/std@0.67.0/encoding/base64.ts";
|
||||
export {
|
||||
WebSocket,
|
||||
connectWebSocket,
|
||||
isWebSocketCloseEvent,
|
||||
isWebSocketPingEvent,
|
||||
isWebSocketPongEvent,
|
||||
} from "https://deno.land/std@0.67.0/ws/mod.ts";
|
||||
export { delay } from "https://deno.land/std@0.67.0/async/delay.ts";
|
||||
export { inflate } from "https://deno.land/x/zlib.es@v1.0.0/mod.ts";
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
} from "../types/discord.ts";
|
||||
|
||||
import { allowNextShard } from "../module/shardingManager.ts";
|
||||
import { delay } from "https://deno.land/std@0.67.0/async/delay.ts";
|
||||
import { delay } from "../../deps.ts";
|
||||
import { eventHandlers, setBotID } from "../module/client.ts";
|
||||
import { structures } from "../structures/mod.ts";
|
||||
import { cache } from "../utils/cache.ts";
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { MessageContent } from "../types/channel.ts";
|
||||
import type { UserPayload } from "../types/guild.ts";
|
||||
import type { MessageCreateOptions } from "../types/message.ts";
|
||||
|
||||
import { delay } from "https://deno.land/std@0.67.0/async/delay.ts";
|
||||
import { delay } from "../../deps.ts";
|
||||
import { structures } from "../structures/mod.ts";
|
||||
import { cacheHandlers } from "../controllers/cache.ts";
|
||||
import { botID } from "../module/client.ts";
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
isWebSocketPingEvent,
|
||||
isWebSocketPongEvent,
|
||||
WebSocket,
|
||||
} from "https://deno.land/std@0.67.0/ws/mod.ts";
|
||||
} from "../../deps.ts";
|
||||
import type { DiscordHeartbeatPayload } from "../types/discord.ts";
|
||||
import type { FetchMembersOptions } from "../types/guild.ts";
|
||||
import type { BotStatusRequest } from "../utils/utils.ts";
|
||||
@@ -17,8 +17,8 @@ import {
|
||||
eventHandlers,
|
||||
botGatewayData,
|
||||
} from "./client.ts";
|
||||
import { delay } from "https://deno.land/std@0.67.0/async/delay.ts";
|
||||
import { inflate } from "https://deno.land/x/zlib.es@v1.0.0/mod.ts";
|
||||
import { delay } from "../../deps.ts";
|
||||
import { inflate } from "../../deps.ts";
|
||||
|
||||
const basicShards = new Map<number, BasicShard>();
|
||||
const heartbeating = new Set<number>();
|
||||
|
||||
@@ -4,7 +4,7 @@ import { baseEndpoints } from "../constants/discord.ts";
|
||||
import type { RequestMethods } from "../types/fetch.ts";
|
||||
|
||||
import { Errors } from "../types/errors.ts";
|
||||
import { delay } from "https://deno.land/std@0.67.0/async/delay.ts";
|
||||
import { delay } from "../../deps.ts";
|
||||
|
||||
const pathQueues: { [key: string]: QueuedRequest[] } = {};
|
||||
const ratelimitedPaths = new Map<string, RateLimitedPath>();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { WebSocket } from "https://deno.land/std@0.67.0/ws/mod.ts";
|
||||
import type { WebSocket } from "../../deps.ts";
|
||||
import type {
|
||||
DiscordBotGatewayData,
|
||||
DiscordHeartbeatPayload,
|
||||
@@ -8,11 +8,11 @@ import type { FetchMembersOptions } from "../types/guild.ts";
|
||||
import type { DebugArg } from "../types/options.ts";
|
||||
|
||||
import { GatewayOpcode } from "../types/discord.ts";
|
||||
import { delay } from "https://deno.land/std@0.67.0/async/delay.ts";
|
||||
import { delay } from "../../deps.ts";
|
||||
import {
|
||||
connectWebSocket,
|
||||
isWebSocketCloseEvent,
|
||||
} from "https://deno.land/std@0.67.0/ws/mod.ts";
|
||||
} from "../../deps.ts";
|
||||
|
||||
let shardSocket: WebSocket;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
identifyPayload,
|
||||
} from "./client.ts";
|
||||
import { GatewayOpcode } from "../types/discord.ts";
|
||||
import { delay } from "https://deno.land/std@0.67.0/async/delay.ts";
|
||||
import { delay } from "../../deps.ts";
|
||||
|
||||
let shardCounter = 0;
|
||||
let basicSharding = false;
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { StatusType } from "../types/discord.ts";
|
||||
|
||||
import { ActivityType } from "../types/activity.ts";
|
||||
import { sendGatewayCommand } from "../module/shardingManager.ts";
|
||||
import { encode } from "https://deno.land/std@0.67.0/encoding/base64.ts";
|
||||
import { encode } from "../../deps.ts";
|
||||
|
||||
export const sleep = (timeout: number) => {
|
||||
return new Promise((resolve) => setTimeout(resolve, timeout));
|
||||
|
||||
Reference in New Issue
Block a user