diff --git a/src/structures/Filters.ts b/src/Structures/Filters.ts similarity index 99% rename from src/structures/Filters.ts rename to src/Structures/Filters.ts index 0991a8e..374c23f 100644 --- a/src/structures/Filters.ts +++ b/src/Structures/Filters.ts @@ -1,4 +1,4 @@ -import { Band, bassBoostEqualizer, softEqualizer, trebleBassEqualizer, tvEqualizer, vaporwaveEqualizer } from "../utils/FiltersEqualizers"; +import { Band, bassBoostEqualizer, softEqualizer, trebleBassEqualizer, tvEqualizer, vaporwaveEqualizer } from "../Utils/FiltersEqualizers"; import { Player } from "./Player"; export class Filters { diff --git a/src/structures/Manager.ts b/src/Structures/Manager.ts similarity index 99% rename from src/structures/Manager.ts rename to src/Structures/Manager.ts index db3a7a8..8fba726 100644 --- a/src/structures/Manager.ts +++ b/src/Structures/Manager.ts @@ -17,7 +17,7 @@ import { Collection } from "@discordjs/collection"; import { Node, NodeOptions } from "./Node"; import { Player, PlayerOptions, Track, UnresolvedTrack } from "./Player"; import { VoiceState } from ".."; -import managerCheck from "../utils/ManagerCheck"; +import managerCheck from "../Utils/ManagerCheck"; import { ClientUser, User } from "discord.js"; import { TypedEmitter } from "tiny-typed-emitter"; @@ -420,7 +420,7 @@ export interface ManagerOptions { defaultSearchPlatform?: SearchPlatform; /** Whether the YouTube video titles should be replaced if the Author does not exactly match. */ replaceYouTubeCredentials?: boolean; - caches?: { + caches: { /** Whether to cache the search results. */ enabled: boolean; /** The time to cache the search results. */ diff --git a/src/structures/Node.ts b/src/Structures/Node.ts similarity index 99% rename from src/structures/Node.ts rename to src/Structures/Node.ts index 03e072a..ae1c5bd 100644 --- a/src/structures/Node.ts +++ b/src/Structures/Node.ts @@ -12,7 +12,7 @@ import { import { LavalinkResponse, Manager, PlaylistRawData } from "./Manager"; import { Player, Track, UnresolvedTrack } from "./Player"; import { Rest } from "./Rest"; -import nodeCheck from "../utils/NodeCheck"; +import nodeCheck from "../Utils/NodeCheck"; import WebSocket from "ws"; export class Node { diff --git a/src/structures/Player.ts b/src/Structures/Player.ts similarity index 99% rename from src/structures/Player.ts rename to src/Structures/Player.ts index 85d5331..ed04415 100644 --- a/src/structures/Player.ts +++ b/src/Structures/Player.ts @@ -4,7 +4,7 @@ import { LavalinkInfo, Node } from "./Node"; import { Queue } from "./Queue"; import { Sizes, State, Structure, TrackSourceName, TrackUtils, VoiceState } from "./Utils"; import * as _ from "lodash"; -import playerCheck from "../utils/PlayerCheck"; +import playerCheck from "../Utils/PlayerCheck"; import { ClientUser, Message, User } from "discord.js"; export class Player { @@ -545,9 +545,7 @@ export class Player { if (!this.queue.current) return undefined; position = Number(position); - if (isNaN(position)) { - throw new RangeError("Position must be a number."); - } + if (isNaN(position)) throw new RangeError("Position must be a number."); if (position < 0 || position > this.queue.current.duration) position = Math.max(Math.min(position, this.queue.current.duration), 0); this.position = position; diff --git a/src/structures/Queue.ts b/src/Structures/Queue.ts similarity index 100% rename from src/structures/Queue.ts rename to src/Structures/Queue.ts diff --git a/src/structures/Rest.ts b/src/Structures/Rest.ts similarity index 100% rename from src/structures/Rest.ts rename to src/Structures/Rest.ts diff --git a/src/structures/Utils.ts b/src/Structures/Utils.ts similarity index 100% rename from src/structures/Utils.ts rename to src/Structures/Utils.ts diff --git a/src/utils/FiltersEqualizers.ts b/src/Utils/FiltersEqualizers.ts similarity index 100% rename from src/utils/FiltersEqualizers.ts rename to src/Utils/FiltersEqualizers.ts diff --git a/src/utils/ManagerCheck.ts b/src/Utils/ManagerCheck.ts similarity index 91% rename from src/utils/ManagerCheck.ts rename to src/Utils/ManagerCheck.ts index 2adf23d..a577517 100644 --- a/src/utils/ManagerCheck.ts +++ b/src/Utils/ManagerCheck.ts @@ -1,9 +1,9 @@ -import { ManagerOptions } from "../structures/Manager"; +import { ManagerOptions } from "../Structures/Manager"; export default function ManagerCheck(options: ManagerOptions) { if (!options) throw new TypeError("ManagerOptions must not be empty."); - const { autoPlay, clientId, clientName, defaultSearchPlatform, nodes, plugins, send, shards, trackPartial, usePriority, useNode, replaceYouTubeCredentials } = + const { autoPlay, clientId, clientName, defaultSearchPlatform, nodes, plugins, send, shards, trackPartial, usePriority, useNode, replaceYouTubeCredentials, caches } = options; if (typeof autoPlay !== "undefined" && typeof autoPlay !== "boolean") { @@ -17,7 +17,9 @@ export default function ManagerCheck(options: ManagerOptions) { if (typeof clientName !== "undefined" && typeof clientName !== "string") { throw new TypeError('Manager option "clientName" must be a string.'); } - + if (typeof caches !== "undefined" && typeof caches !== "object") { + throw new TypeError('Manager option "caches" must be a object.'); + } if (typeof defaultSearchPlatform !== "undefined" && typeof defaultSearchPlatform !== "string") { throw new TypeError('Manager option "defaultSearchPlatform" must be a string.'); } diff --git a/src/utils/NodeCheck.ts b/src/Utils/NodeCheck.ts similarity index 97% rename from src/utils/NodeCheck.ts rename to src/Utils/NodeCheck.ts index b31b277..dc6cdba 100644 --- a/src/utils/NodeCheck.ts +++ b/src/Utils/NodeCheck.ts @@ -1,4 +1,4 @@ -import { NodeOptions } from "../structures/Node"; +import { NodeOptions } from "../Structures/Node"; export default function NodeCheck(options: NodeOptions) { if (!options) throw new TypeError("NodeOptions must not be empty."); diff --git a/src/utils/PlayerCheck.ts b/src/Utils/PlayerCheck.ts similarity index 95% rename from src/utils/PlayerCheck.ts rename to src/Utils/PlayerCheck.ts index 10a9758..379ee3f 100644 --- a/src/utils/PlayerCheck.ts +++ b/src/Utils/PlayerCheck.ts @@ -1,4 +1,4 @@ -import { PlayerOptions } from "../structures/Player"; +import { PlayerOptions } from "../Structures/Player"; export default function PlayerCheck(options: PlayerOptions) { if (!options) throw new TypeError("PlayerOptions must not be empty."); diff --git a/src/index.ts b/src/index.ts index 136b882..6dcd663 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,11 @@ -export * from "./structures/Manager"; -export * from "./structures/Node"; -export * from "./structures/Player"; -export * from "./structures/Queue"; -export * from "./structures/Utils"; -export * from "./structures/Filters"; -export * from "./structures/Rest"; -export * from "./utils/FiltersEqualizers"; -export * from "./utils/ManagerCheck"; -export * from "./utils/NodeCheck"; -export * from "./utils/PlayerCheck"; \ No newline at end of file +export * from "./Structures/Manager"; +export * from "./Structures/Node"; +export * from "./Structures/Player"; +export * from "./Structures/Queue"; +export * from "./Structures/Utils"; +export * from "./Structures/Filters"; +export * from "./Structures/Rest"; +export * from "./Utils/FiltersEqualizers"; +export * from "./Utils/ManagerCheck"; +export * from "./Utils/NodeCheck"; +export * from "./Utils/PlayerCheck"; \ No newline at end of file