diff --git a/eslint.config.js b/eslint.config.js index 984be61..9a7ea4e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,9 +1,9 @@ -import globals from "globals"; -import pluginJs from "@eslint/js"; -import tseslint from "typescript-eslint"; +const globals = require("globals"); +const pluginJs = require( "@eslint/js"); +const tseslint = require( "typescript-eslint"); -export default [ +module.exports = [ { files: ["**/*.{js,mjs,cjs,ts}"] }, { files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } }, { languageOptions: { globals: globals.browser } }, diff --git a/package.json b/package.json index 26b61b6..01e8c77 100644 --- a/package.json +++ b/package.json @@ -14,14 +14,14 @@ "test:player": "bun test/player.ts" }, "devDependencies": { - "@eslint/js": "^9.7.0", + "@eslint/js": "^9.9.0", "@types/bun": "latest", - "eslint": "^9.7.0", - "globals": "^15.8.0", - "typescript-eslint": "^8.0.0", + "eslint": "^9.9.0", + "globals": "^15.9.0", + "typescript-eslint": "^8.0.1", "@babel/cli": "^7.24.8", - "@babel/core": "^7.24.9", - "@babel/preset-env": "^7.24.8", + "@babel/core": "^7.25.2", + "@babel/preset-env": "^7.25.3", "@babel/preset-typescript": "^7.24.7" }, "publishConfig": { diff --git a/src/structures/Manager.ts b/src/structures/Manager.ts index b0193f2..f3fb71a 100644 --- a/src/structures/Manager.ts +++ b/src/structures/Manager.ts @@ -206,7 +206,7 @@ export class Manager extends TypedEmitter { const _query: SearchQuery = typeof options.query === "string" ? { query: options.query } : options.query; const _source = Manager.DEFAULT_SOURCES[_query.source ?? this.options.defaultSearchPlatform] ?? _query.source; let search = _query.query; - let code = this.CheckURL(options.query); + const code = this.CheckURL(options.query); if (!/^https?:\/\//.test(search)) search = `${_source}:${search}`; return { search, code }; } @@ -219,7 +219,7 @@ export class Manager extends TypedEmitter { return null; } - private async fetchTracks(node: any, search: string): Promise { + private async fetchTracks(node: Node, search: string): Promise { const res = await node.rest.get(`/v4/loadtracks?identifier=${encodeURIComponent(search)}`) as LavalinkResponse; if (!res) throw new Error("Query not found."); return res; @@ -292,7 +292,7 @@ export class Manager extends TypedEmitter { } } private CheckURL(uri: string): string { - let data = this.regex_link(uri); + const data = this.regex_link(uri); if (!data) return uri; if (data === "yt") { const videoCode = uri.match(/v=([^&]+)/)?.[1]; diff --git a/src/structures/Node.ts b/src/structures/Node.ts index ba72d29..c5cc0e1 100644 --- a/src/structures/Node.ts +++ b/src/structures/Node.ts @@ -325,10 +325,8 @@ export class Node { } else if (queueRepeat) { queue.add(queue.current); } - queue.previous = queue.current; queue.current = queue.shift(); - this.manager.emit("TrackEnd", player, track, payload); if (payload.reason === "stopped") { diff --git a/src/structures/Utils.ts b/src/structures/Utils.ts index c1e9b0b..00fa1b8 100644 --- a/src/structures/Utils.ts +++ b/src/structures/Utils.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-var-requires*/ +/* eslint-disable @typescript-eslint/no-unused-vars*/ import { ClientUser, User } from "discord.js"; import { Manager } from "./Manager"; import { Node, NodeStats } from "./Node"; @@ -219,9 +219,9 @@ export class Plugin { } const structures = { - Player: require("./Player").Player, - Queue: require("./Queue").Queue, - Node: require("./Node").Node, + Player: Player, + Queue: Queue, + Node: Node, }; export interface UnresolvedQuery {