diff --git a/package.json b/package.json index 0d9eca62..6c63531b 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,6 @@ "dependencies": { "@hammerhq/localization": "^0.1.5", "axios": "^1.6.0", - "better-kazagumo": "^0.0.4", "bufferutil": "^4.0.8", "chalk": "^5.3.0", "chillout": "^5.0.0", @@ -58,6 +57,7 @@ "fs-extra": "^11.1.1", "humanize-duration": "^3.30.0", "js-yaml": "^4.1.0", + "kazagumo.mod": "^1.0.0", "lodash": "^4.17.21", "markdown-it": "^13.0.2", "moment": "^2.29.4", @@ -71,7 +71,7 @@ "plsargs": "^0.1.6", "pretty-ms": "^8.0.0", "recursive-readdir": "^2.2.3", - "shoukaku": "^3.4.0", + "shoukaku": "^4.0.1", "stuffs": "^0.1.34", "utf-8-validate": "^5.0.2", "voucher-code-generator": "^1.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a01f4cd..1e1e2ccd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,9 +15,6 @@ dependencies: axios: specifier: ^1.6.0 version: 1.6.0 - better-kazagumo: - specifier: ^0.0.4 - version: 0.0.4(discord.js@14.13.0)(typescript@5.2.2) bufferutil: specifier: ^4.0.8 version: 4.0.8 @@ -60,6 +57,9 @@ dependencies: js-yaml: specifier: ^4.1.0 version: 4.1.0 + kazagumo.mod: + specifier: ^1.0.0 + version: 1.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.2) lodash: specifier: ^4.17.21 version: 4.17.21 @@ -98,8 +98,8 @@ dependencies: specifier: ^2.2.3 version: 2.2.3 shoukaku: - specifier: ^3.4.0 - version: 3.4.0(bufferutil@4.0.8)(utf-8-validate@5.0.2) + specifier: ^4.0.1 + version: 4.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.2) stuffs: specifier: ^0.1.34 version: 0.1.34 @@ -867,10 +867,6 @@ packages: engines: {node: '>=12'} dev: true - /ansi-sequence-parser@1.1.1: - resolution: {integrity: sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==} - dev: false - /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -1001,6 +997,16 @@ packages: - debug dev: false + /axios@1.6.2: + resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} + dependencies: + follow-redirects: 1.15.3 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1008,24 +1014,6 @@ packages: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} dev: true - /better-kazagumo@0.0.4(discord.js@14.13.0)(typescript@5.2.2): - resolution: {integrity: sha512-GFHQNb8teeZEuDSH3IbYuhLtmLXVaMRhcBi9Al6YfoWjHMiDAsCctaSdpHbbNTUuI010kQm5Pr+YHJnFl0tJug==} - engines: {node: '>=16.5.0'} - dependencies: - axios: 1.6.0 - dokdo: 1.0.1(discord.js@14.13.0) - events: 3.3.0 - node-html-parser: 6.1.11 - typedoc: 0.25.3(typescript@5.2.2) - typedocs: 0.6.7 - undici: 5.27.2 - transitivePeerDependencies: - - debug - - discord.js - - encoding - - typescript - dev: false - /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} @@ -1073,6 +1061,7 @@ packages: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: balanced-match: 1.0.2 + dev: true /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} @@ -1465,18 +1454,6 @@ packages: - utf-8-validate dev: false - /dokdo@1.0.1(discord.js@14.13.0): - resolution: {integrity: sha512-DquSmyQeSQbYhCMZO67z7toDMSd7fJef+0dgDXxFwRuPEE5shk0ggitdVGwKGXj36cf7ISuO3Ka5S8FZKcQXFQ==} - engines: {node: '>=16.9.0'} - peerDependencies: - discord.js: '14' - dependencies: - discord.js: 14.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.2) - node-fetch: 2.7.0 - transitivePeerDependencies: - - encoding - dev: false - /dom-serializer@2.0.0: resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} dependencies: @@ -2268,10 +2245,6 @@ packages: resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} dev: true - /jsonc-parser@3.2.0: - resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} - dev: false - /jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} dependencies: @@ -2294,6 +2267,20 @@ packages: engines: {node: '>=12.0.0'} dev: false + /kazagumo.mod@1.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.2): + resolution: {integrity: sha512-Qadlfc/S0R+YUu8CMJ+nDO7AFfvsrqDtsuUeV1wJOL3CW+EXArvAnFC+TlgNFxxMQhHnpONbpeLYA8lkxqSofw==} + engines: {node: '>=16.5.0 <=20'} + dependencies: + axios: 1.6.2 + events: 3.3.0 + node-html-parser: 6.1.11 + shoukaku: 4.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.2) + transitivePeerDependencies: + - bufferutil + - debug + - utf-8-validate + dev: false + /kuler@2.0.0: resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} dev: false @@ -2399,10 +2386,6 @@ packages: engines: {node: '>=16.14'} dev: false - /lunr@2.3.9: - resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} - dev: false - /magic-bytes.js@1.5.0: resolution: {integrity: sha512-wJkXvutRbNWcc37tt5j1HyOK1nosspdh3dj6LUYYAvF6JYNqs53IfRvK9oEpcwiDA1NdoIi64yAMfdivPeVAyw==} dev: false @@ -2422,12 +2405,6 @@ packages: uc.micro: 1.0.6 dev: false - /marked@4.3.0: - resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} - engines: {node: '>= 12'} - hasBin: true - dev: false - /mdurl@1.0.1: resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} dev: false @@ -2504,6 +2481,7 @@ packages: engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 + dev: true /minipass@7.0.4: resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} @@ -3305,24 +3283,13 @@ packages: resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} dev: true - /shiki@0.14.5: - resolution: {integrity: sha512-1gCAYOcmCFONmErGTrS1fjzJLA7MGZmKzrBNX7apqSwhyITJg2O102uFzXUeBxNnEkDA9vHIKLyeKq0V083vIw==} - dependencies: - ansi-sequence-parser: 1.1.1 - jsonc-parser: 3.2.0 - vscode-oniguruma: 1.7.0 - vscode-textmate: 8.0.0 - dev: false - - /shoukaku@3.4.0(bufferutil@4.0.8)(utf-8-validate@5.0.2): - resolution: {integrity: sha512-IxkicImqMy7fu2QDXsQaqajR66oI2xL4FFEKaxIKLSPZTs/51ZlmsevnvwcZdABm+mfVkWFNQJotP1WcBeZ+Dg==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /shoukaku@4.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.2): + resolution: {integrity: sha512-+Y94AnUFabCkE8O2Y3MSfnVmiiQ1MMVK/DO962Q23KPTWJkuqs+S/CPRQSOPWqo+ISq7teVxGJsSapwnJOrFgQ==} + engines: {node: '>=18.0.0', npm: '>=7.0.0'} dependencies: - node-fetch: 2.7.0 ws: 8.14.2(bufferutil@4.0.8)(utf-8-validate@5.0.2) transitivePeerDependencies: - bufferutil - - encoding - utf-8-validate dev: false @@ -3683,33 +3650,6 @@ packages: is-typed-array: 1.1.12 dev: true - /typedoc@0.25.3(typescript@5.2.2): - resolution: {integrity: sha512-Ow8Bo7uY1Lwy7GTmphRIMEo6IOZ+yYUyrc8n5KXIZg1svpqhZSWgni2ZrDhe+wLosFS8yswowUzljTAV/3jmWw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x - dependencies: - lunr: 2.3.9 - marked: 4.3.0 - minimatch: 9.0.3 - shiki: 0.14.5 - typescript: 5.2.2 - dev: false - - /typedocs@0.6.7: - resolution: {integrity: sha512-ZWpgwfPyJoqpLVUX+XdOqQLGcZJneSIWDLSlKt0ItkGeFrz2BFPIr38/mfR11Yw50mmPInkd4MC0KLU7PV+XUA==} - dependencies: - marked: 4.3.0 - typescript: 3.2.4 - dev: false - - /typescript@3.2.4: - resolution: {integrity: sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg==} - engines: {node: '>=4.2.0'} - hasBin: true - dev: false - /typescript@4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} @@ -3720,6 +3660,7 @@ packages: resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} hasBin: true + dev: true /uc.micro@1.0.6: resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} @@ -3809,14 +3750,6 @@ packages: resolution: {integrity: sha512-t4wnI91KC58LtjX2I0rJDhRm1JTXD+G7A+7iqp0sRSgpeJP4eKLexDRDLe2nedR7xFQcVlZudDZRBLrMP5+KTA==} dev: false - /vscode-oniguruma@1.7.0: - resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} - dev: false - - /vscode-textmate@8.0.0: - resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} - dev: false - /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: false diff --git a/src/commands/context/Play.ts b/src/commands/context/Play.ts index 118f06b8..03e13867 100644 --- a/src/commands/context/Play.ts +++ b/src/commands/context/Play.ts @@ -101,7 +101,7 @@ export default class implements ContextCommand { .setDescription( `${client.i18n.get(language, "music", "play_track", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: new ConvertTime().parse(tracks[0].length as number), request: String(tracks[0].requester), })}` @@ -112,7 +112,7 @@ export default class implements ContextCommand { const embed = new EmbedBuilder().setColor(client.color).setDescription( `${client.i18n.get(language, "music", "play_result", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: new ConvertTime().parse(tracks[0].length as number), request: String(tracks[0].requester), })}` diff --git a/src/commands/prefix/Filter/3d.ts b/src/commands/prefix/Filter/3d.ts index 968c76c9..23621fac 100644 --- a/src/commands/prefix/Filter/3d.ts +++ b/src/commands/prefix/Filter/3d.ts @@ -58,12 +58,15 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - rotation: { rotationHz: 0.2 }, + playerOptions: { + filters: { + rotation: { rotationHz: 0.2 }, + }, + }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/prefix/Filter/Bass.ts b/src/commands/prefix/Filter/Bass.ts index 9cb19ce6..0bce8b1f 100644 --- a/src/commands/prefix/Filter/Bass.ts +++ b/src/commands/prefix/Filter/Bass.ts @@ -58,24 +58,27 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - equalizer: [ - { band: 0, gain: 0.1 }, - { band: 1, gain: 0.1 }, - { band: 2, gain: 0.05 }, - { band: 3, gain: 0.05 }, - { band: 4, gain: -0.05 }, - { band: 5, gain: -0.05 }, - { band: 6, gain: 0 }, - { band: 7, gain: -0.05 }, - { band: 8, gain: -0.05 }, - { band: 9, gain: 0 }, - { band: 10, gain: 0.05 }, - { band: 11, gain: 0.05 }, - { band: 12, gain: 0.1 }, - { band: 13, gain: 0.1 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0.1 }, + { band: 1, gain: 0.1 }, + { band: 2, gain: 0.05 }, + { band: 3, gain: 0.05 }, + { band: 4, gain: -0.05 }, + { band: 5, gain: -0.05 }, + { band: 6, gain: 0 }, + { band: 7, gain: -0.05 }, + { band: 8, gain: -0.05 }, + { band: 9, gain: 0 }, + { band: 10, gain: 0.05 }, + { band: 11, gain: 0.05 }, + { band: 12, gain: 0.1 }, + { band: 13, gain: 0.1 }, + ], + }, + }, }; await player["send"](data); diff --git a/src/commands/prefix/Filter/Bassboost.ts b/src/commands/prefix/Filter/Bassboost.ts index edb61fc0..27f7dd09 100644 --- a/src/commands/prefix/Filter/Bassboost.ts +++ b/src/commands/prefix/Filter/Bassboost.ts @@ -69,24 +69,27 @@ export default class implements PrefixCommand { if (!value) { const data = { - op: "filters", guildId: message.guild!.id, - equalizer: [ - { band: 0, gain: 0.1 }, - { band: 1, gain: 0.1 }, - { band: 2, gain: 0.05 }, - { band: 3, gain: 0.05 }, - { band: 4, gain: -0.05 }, - { band: 5, gain: -0.05 }, - { band: 6, gain: 0 }, - { band: 7, gain: -0.05 }, - { band: 8, gain: -0.05 }, - { band: 9, gain: 0 }, - { band: 10, gain: 0.05 }, - { band: 11, gain: 0.05 }, - { band: 12, gain: 0.1 }, - { band: 13, gain: 0.1 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0.1 }, + { band: 1, gain: 0.1 }, + { band: 2, gain: 0.05 }, + { band: 3, gain: 0.05 }, + { band: 4, gain: -0.05 }, + { band: 5, gain: -0.05 }, + { band: 6, gain: 0 }, + { band: 7, gain: -0.05 }, + { band: 8, gain: -0.05 }, + { band: 9, gain: 0 }, + { band: 10, gain: 0.05 }, + { band: 11, gain: 0.05 }, + { band: 12, gain: 0.1 }, + { band: 13, gain: 0.1 }, + ], + }, + }, }; await player["send"](data); @@ -135,24 +138,27 @@ export default class implements PrefixCommand { ], }); const data = { - op: "filters", guildId: message.guild!.id, - equalizer: [ - { band: 0, gain: Number(value) / 10 }, - { band: 1, gain: Number(value) / 10 }, - { band: 2, gain: Number(value) / 10 }, - { band: 3, gain: Number(value) / 10 }, - { band: 4, gain: Number(value) / 10 }, - { band: 5, gain: Number(value) / 10 }, - { band: 6, gain: Number(value) / 10 }, - { band: 7, gain: 0 }, - { band: 8, gain: 0 }, - { band: 9, gain: 0 }, - { band: 10, gain: 0 }, - { band: 11, gain: 0 }, - { band: 12, gain: 0 }, - { band: 13, gain: 0 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: Number(value) / 10 }, + { band: 1, gain: Number(value) / 10 }, + { band: 2, gain: Number(value) / 10 }, + { band: 3, gain: Number(value) / 10 }, + { band: 4, gain: Number(value) / 10 }, + { band: 5, gain: Number(value) / 10 }, + { band: 6, gain: Number(value) / 10 }, + { band: 7, gain: 0 }, + { band: 8, gain: 0 }, + { band: 9, gain: 0 }, + { band: 10, gain: 0 }, + { band: 11, gain: 0 }, + { band: 12, gain: 0 }, + { band: 13, gain: 0 }, + ], + }, + }, }; await player["send"](data); const msg2 = await message.reply({ diff --git a/src/commands/prefix/Filter/China.ts b/src/commands/prefix/Filter/China.ts index 5e613a08..7bd00b65 100644 --- a/src/commands/prefix/Filter/China.ts +++ b/src/commands/prefix/Filter/China.ts @@ -58,12 +58,15 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - timescale: { - speed: 0.75, - pitch: 1.25, - rate: 1.25, + playerOptions: { + filters: { + timescale: { + speed: 0.75, + pitch: 1.25, + rate: 1.25, + }, + }, }, }; diff --git a/src/commands/prefix/Filter/Chipmunk.ts b/src/commands/prefix/Filter/Chipmunk.ts index c2cc6a17..6e4b088e 100644 --- a/src/commands/prefix/Filter/Chipmunk.ts +++ b/src/commands/prefix/Filter/Chipmunk.ts @@ -58,16 +58,19 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - timescale: { - speed: 1.05, - pitch: 1.35, - rate: 1.25, + playerOptions: { + filters: { + timescale: { + speed: 1.05, + pitch: 1.35, + rate: 1.25, + }, + }, }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/prefix/Filter/Darthvader.ts b/src/commands/prefix/Filter/Darthvader.ts index a8fea58a..4062eda2 100644 --- a/src/commands/prefix/Filter/Darthvader.ts +++ b/src/commands/prefix/Filter/Darthvader.ts @@ -58,12 +58,15 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - timescale: { - speed: 0.975, - pitch: 0.5, - rate: 0.8, + playerOptions: { + filters: { + timescale: { + speed: 0.975, + pitch: 0.5, + rate: 0.8, + }, + }, }, }; diff --git a/src/commands/prefix/Filter/Daycore.ts b/src/commands/prefix/Filter/Daycore.ts index 5ca51bed..c9ef02c4 100644 --- a/src/commands/prefix/Filter/Daycore.ts +++ b/src/commands/prefix/Filter/Daycore.ts @@ -58,27 +58,30 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - equalizer: [ - { band: 0, gain: 0 }, - { band: 1, gain: 0 }, - { band: 2, gain: 0 }, - { band: 3, gain: 0 }, - { band: 4, gain: 0 }, - { band: 5, gain: 0 }, - { band: 6, gain: 0 }, - { band: 7, gain: 0 }, - { band: 8, gain: -0.25 }, - { band: 9, gain: -0.25 }, - { band: 10, gain: -0.25 }, - { band: 11, gain: -0.25 }, - { band: 12, gain: -0.25 }, - { band: 13, gain: -0.25 }, - ], - timescale: { - pitch: 0.63, - rate: 1.05, + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0 }, + { band: 1, gain: 0 }, + { band: 2, gain: 0 }, + { band: 3, gain: 0 }, + { band: 4, gain: 0 }, + { band: 5, gain: 0 }, + { band: 6, gain: 0 }, + { band: 7, gain: 0 }, + { band: 8, gain: -0.25 }, + { band: 9, gain: -0.25 }, + { band: 10, gain: -0.25 }, + { band: 11, gain: -0.25 }, + { band: 12, gain: -0.25 }, + { band: 13, gain: -0.25 }, + ], + timescale: { + pitch: 0.63, + rate: 1.05, + }, + }, }, }; diff --git a/src/commands/prefix/Filter/Doubletime.ts b/src/commands/prefix/Filter/Doubletime.ts index 99130924..d2fbc67a 100644 --- a/src/commands/prefix/Filter/Doubletime.ts +++ b/src/commands/prefix/Filter/Doubletime.ts @@ -58,10 +58,13 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - timescale: { - speed: 1.165, + playerOptions: { + filters: { + timescale: { + speed: 1.165, + }, + }, }, }; diff --git a/src/commands/prefix/Filter/Earrape.ts b/src/commands/prefix/Filter/Earrape.ts index 18096602..c668ab43 100644 --- a/src/commands/prefix/Filter/Earrape.ts +++ b/src/commands/prefix/Filter/Earrape.ts @@ -58,11 +58,6 @@ export default class implements PrefixCommand { }); await player.setVolume(500); - const data = { - op: "filters", - guildId: message.guild!.id, - }; - await player["send"](data); const earrapped = new EmbedBuilder() .setDescription( diff --git a/src/commands/prefix/Filter/Equalizer.ts b/src/commands/prefix/Filter/Equalizer.ts index 3a7f39f4..98360134 100644 --- a/src/commands/prefix/Filter/Equalizer.ts +++ b/src/commands/prefix/Filter/Equalizer.ts @@ -85,8 +85,10 @@ export default class implements PrefixCommand { return message.reply({ embeds: [embed] }); } else if (value == "off" || value == "reset") { const data = { - op: "filters", guildId: message.guild!.id, + playerOptions: { + filters: {}, + }, }; return player["send"](data); } @@ -124,9 +126,12 @@ export default class implements PrefixCommand { for (let i = 0; i < bands.length; i++) { if (i > 13) break; const data = { - op: "filters", guildId: message.guild!.id, - equalizer: [{ band: i, gain: Number(bands[i]) / 10 }], + playerOptions: { + filters: { + equalizer: [{ band: i, gain: Number(bands[i]) / 10 }], + }, + }, }; player["send"](data); bandsStr += `${bands[i]} `; diff --git a/src/commands/prefix/Filter/Karaoke.ts b/src/commands/prefix/Filter/Karaoke.ts index 3efdc882..006fb7c2 100644 --- a/src/commands/prefix/Filter/Karaoke.ts +++ b/src/commands/prefix/Filter/Karaoke.ts @@ -57,13 +57,16 @@ export default class implements PrefixCommand { ], }); const data = { - op: "filters", guildId: message.guild!.id, - karaoke: { - level: 1.0, - monoLevel: 1.0, - filterBand: 220.0, - filterWidth: 100.0, + playerOptions: { + filters: { + karaoke: { + level: 1.0, + monoLevel: 1.0, + filterBand: 220.0, + filterWidth: 100.0, + }, + }, }, }; diff --git a/src/commands/prefix/Filter/Nightcore.ts b/src/commands/prefix/Filter/Nightcore.ts index 6f1254bb..ac8809f3 100644 --- a/src/commands/prefix/Filter/Nightcore.ts +++ b/src/commands/prefix/Filter/Nightcore.ts @@ -58,12 +58,15 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - timescale: { - speed: 1.05, - pitch: 1.125, - rate: 1.05, + playerOptions: { + filters: { + timescale: { + speed: 1.05, + pitch: 1.125, + rate: 1.05, + }, + }, }, }; diff --git a/src/commands/prefix/Filter/Pitch.ts b/src/commands/prefix/Filter/Pitch.ts index e5ec3313..41955a0d 100644 --- a/src/commands/prefix/Filter/Pitch.ts +++ b/src/commands/prefix/Filter/Pitch.ts @@ -77,9 +77,12 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - timescale: { pitch: value }, + playerOptions: { + filters: { + timescale: { pitch: Number(value) }, + }, + }, }; await player["send"](data); diff --git a/src/commands/prefix/Filter/Pop.ts b/src/commands/prefix/Filter/Pop.ts index 5a6eb3c3..84fb7bb0 100644 --- a/src/commands/prefix/Filter/Pop.ts +++ b/src/commands/prefix/Filter/Pop.ts @@ -60,22 +60,26 @@ export default class implements PrefixCommand { const data = { op: "filters", guildId: message.guild!.id, - equalizer: [ - { band: 0, gain: 0.65 }, - { band: 1, gain: 0.45 }, - { band: 2, gain: -0.45 }, - { band: 3, gain: -0.65 }, - { band: 4, gain: -0.35 }, - { band: 5, gain: 0.45 }, - { band: 6, gain: 0.55 }, - { band: 7, gain: 0.6 }, - { band: 8, gain: 0.6 }, - { band: 9, gain: 0.6 }, - { band: 10, gain: 0 }, - { band: 11, gain: 0 }, - { band: 12, gain: 0 }, - { band: 13, gain: 0 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0.65 }, + { band: 1, gain: 0.45 }, + { band: 2, gain: -0.45 }, + { band: 3, gain: -0.65 }, + { band: 4, gain: -0.35 }, + { band: 5, gain: 0.45 }, + { band: 6, gain: 0.55 }, + { band: 7, gain: 0.6 }, + { band: 8, gain: 0.6 }, + { band: 9, gain: 0.6 }, + { band: 10, gain: 0 }, + { band: 11, gain: 0 }, + { band: 12, gain: 0 }, + { band: 13, gain: 0 }, + ], + }, + }, }; await player["send"](data); diff --git a/src/commands/prefix/Filter/Rate.ts b/src/commands/prefix/Filter/Rate.ts index b1e24241..e3daf29f 100644 --- a/src/commands/prefix/Filter/Rate.ts +++ b/src/commands/prefix/Filter/Rate.ts @@ -78,9 +78,12 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - timescale: { rate: value }, + playerOptions: { + filters: { + timescale: { rate: Number(value) }, + }, + }, }; await player["send"](data); diff --git a/src/commands/prefix/Filter/Reset.ts b/src/commands/prefix/Filter/Reset.ts index 4a0f8005..6b265fd2 100644 --- a/src/commands/prefix/Filter/Reset.ts +++ b/src/commands/prefix/Filter/Reset.ts @@ -56,8 +56,10 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, + playerOptions: { + filters: {}, + }, }; await player["send"](data); diff --git a/src/commands/prefix/Filter/Slowmotion.ts b/src/commands/prefix/Filter/Slowmotion.ts index 34c7b78b..2ac6ae68 100644 --- a/src/commands/prefix/Filter/Slowmotion.ts +++ b/src/commands/prefix/Filter/Slowmotion.ts @@ -58,12 +58,15 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - timescale: { - speed: 0.5, - pitch: 1.0, - rate: 0.8, + playerOptions: { + filters: { + timescale: { + speed: 0.5, + pitch: 1.0, + rate: 0.8, + }, + }, }, }; diff --git a/src/commands/prefix/Filter/Soft.ts b/src/commands/prefix/Filter/Soft.ts index 726736b4..253db9da 100644 --- a/src/commands/prefix/Filter/Soft.ts +++ b/src/commands/prefix/Filter/Soft.ts @@ -58,24 +58,27 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - equalizer: [ - { band: 0, gain: 0 }, - { band: 1, gain: 0 }, - { band: 2, gain: 0 }, - { band: 3, gain: 0 }, - { band: 4, gain: 0 }, - { band: 5, gain: 0 }, - { band: 6, gain: 0 }, - { band: 7, gain: 0 }, - { band: 8, gain: -0.25 }, - { band: 9, gain: -0.25 }, - { band: 10, gain: -0.25 }, - { band: 11, gain: -0.25 }, - { band: 12, gain: -0.25 }, - { band: 13, gain: -0.25 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0 }, + { band: 1, gain: 0 }, + { band: 2, gain: 0 }, + { band: 3, gain: 0 }, + { band: 4, gain: 0 }, + { band: 5, gain: 0 }, + { band: 6, gain: 0 }, + { band: 7, gain: 0 }, + { band: 8, gain: -0.25 }, + { band: 9, gain: -0.25 }, + { band: 10, gain: -0.25 }, + { band: 11, gain: -0.25 }, + { band: 12, gain: -0.25 }, + { band: 13, gain: -0.25 }, + ], + }, + }, }; await player["send"](data); diff --git a/src/commands/prefix/Filter/Speed.ts b/src/commands/prefix/Filter/Speed.ts index 10a896d5..68c4be98 100644 --- a/src/commands/prefix/Filter/Speed.ts +++ b/src/commands/prefix/Filter/Speed.ts @@ -78,9 +78,12 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - timescale: { speed: value }, + playerOptions: { + filters: { + timescale: { speed: Number(value) }, + }, + }, }; await player["send"](data); diff --git a/src/commands/prefix/Filter/Superbass.ts b/src/commands/prefix/Filter/Superbass.ts index 3502d156..5a88e51a 100644 --- a/src/commands/prefix/Filter/Superbass.ts +++ b/src/commands/prefix/Filter/Superbass.ts @@ -58,24 +58,27 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - equalizer: [ - { band: 0, gain: 0.2 }, - { band: 1, gain: 0.3 }, - { band: 2, gain: 0 }, - { band: 3, gain: 0.8 }, - { band: 4, gain: 0 }, - { band: 5, gain: 0.5 }, - { band: 6, gain: 0 }, - { band: 7, gain: -0.5 }, - { band: 8, gain: 0 }, - { band: 9, gain: 0 }, - { band: 10, gain: 0 }, - { band: 11, gain: 0 }, - { band: 12, gain: 0 }, - { band: 13, gain: 0 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0.2 }, + { band: 1, gain: 0.3 }, + { band: 2, gain: 0 }, + { band: 3, gain: 0.8 }, + { band: 4, gain: 0 }, + { band: 5, gain: 0.5 }, + { band: 6, gain: 0 }, + { band: 7, gain: -0.5 }, + { band: 8, gain: 0 }, + { band: 9, gain: 0 }, + { band: 10, gain: 0 }, + { band: 11, gain: 0 }, + { band: 12, gain: 0 }, + { band: 13, gain: 0 }, + ], + }, + }, }; await player["send"](data); diff --git a/src/commands/prefix/Filter/Television.ts b/src/commands/prefix/Filter/Television.ts index 97c3293e..1e65f340 100644 --- a/src/commands/prefix/Filter/Television.ts +++ b/src/commands/prefix/Filter/Television.ts @@ -58,24 +58,27 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - equalizer: [ - { band: 0, gain: 0 }, - { band: 1, gain: 0 }, - { band: 2, gain: 0 }, - { band: 3, gain: 0 }, - { band: 4, gain: 0 }, - { band: 5, gain: 0 }, - { band: 6, gain: 0 }, - { band: 7, gain: 0.65 }, - { band: 8, gain: 0.65 }, - { band: 9, gain: 0.65 }, - { band: 10, gain: 0.65 }, - { band: 11, gain: 0.65 }, - { band: 12, gain: 0.65 }, - { band: 13, gain: 0.65 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0 }, + { band: 1, gain: 0 }, + { band: 2, gain: 0 }, + { band: 3, gain: 0 }, + { band: 4, gain: 0 }, + { band: 5, gain: 0 }, + { band: 6, gain: 0 }, + { band: 7, gain: 0.65 }, + { band: 8, gain: 0.65 }, + { band: 9, gain: 0.65 }, + { band: 10, gain: 0.65 }, + { band: 11, gain: 0.65 }, + { band: 12, gain: 0.65 }, + { band: 13, gain: 0.65 }, + ], + }, + }, }; await player["send"](data); diff --git a/src/commands/prefix/Filter/Treblebass.ts b/src/commands/prefix/Filter/Treblebass.ts index 98345fa7..377946fe 100644 --- a/src/commands/prefix/Filter/Treblebass.ts +++ b/src/commands/prefix/Filter/Treblebass.ts @@ -57,24 +57,27 @@ export default class implements PrefixCommand { ], }); const data = { - op: "filters", guildId: message.guild!.id, - equalizer: [ - { band: 0, gain: 0.6 }, - { band: 1, gain: 0.67 }, - { band: 2, gain: 0.67 }, - { band: 3, gain: 0 }, - { band: 4, gain: -0.5 }, - { band: 5, gain: 0.15 }, - { band: 6, gain: -0.45 }, - { band: 7, gain: 0.23 }, - { band: 8, gain: 0.35 }, - { band: 9, gain: 0.45 }, - { band: 10, gain: 0.55 }, - { band: 11, gain: 0.6 }, - { band: 12, gain: 0.55 }, - { band: 13, gain: 0 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0.6 }, + { band: 1, gain: 0.67 }, + { band: 2, gain: 0.67 }, + { band: 3, gain: 0 }, + { band: 4, gain: -0.5 }, + { band: 5, gain: 0.15 }, + { band: 6, gain: -0.45 }, + { band: 7, gain: 0.23 }, + { band: 8, gain: 0.35 }, + { band: 9, gain: 0.45 }, + { band: 10, gain: 0.55 }, + { band: 11, gain: 0.6 }, + { band: 12, gain: 0.55 }, + { band: 13, gain: 0 }, + ], + }, + }, }; await player["send"](data); diff --git a/src/commands/prefix/Filter/Tremolo.ts b/src/commands/prefix/Filter/Tremolo.ts index 8469c94c..66779052 100644 --- a/src/commands/prefix/Filter/Tremolo.ts +++ b/src/commands/prefix/Filter/Tremolo.ts @@ -58,11 +58,14 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - tremolo: { - frequency: 4.0, - depth: 0.75, + playerOptions: { + filters: { + tremolo: { + frequency: 4.0, + depth: 0.75, + }, + }, }, }; diff --git a/src/commands/prefix/Filter/Vaporwave.ts b/src/commands/prefix/Filter/Vaporwave.ts index fe65d1e8..8e95b7d7 100644 --- a/src/commands/prefix/Filter/Vaporwave.ts +++ b/src/commands/prefix/Filter/Vaporwave.ts @@ -58,26 +58,29 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - equalizer: [ - { band: 0, gain: 0 }, - { band: 1, gain: 0 }, - { band: 2, gain: 0 }, - { band: 3, gain: 0 }, - { band: 4, gain: 0 }, - { band: 5, gain: 0 }, - { band: 6, gain: 0 }, - { band: 7, gain: 0 }, - { band: 8, gain: 0.15 }, - { band: 9, gain: 0.15 }, - { band: 10, gain: 0.15 }, - { band: 11, gain: 0.15 }, - { band: 12, gain: 0.15 }, - { band: 13, gain: 0.15 }, - ], - timescale: { - pitch: 0.55, + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0 }, + { band: 1, gain: 0 }, + { band: 2, gain: 0 }, + { band: 3, gain: 0 }, + { band: 4, gain: 0 }, + { band: 5, gain: 0 }, + { band: 6, gain: 0 }, + { band: 7, gain: 0 }, + { band: 8, gain: 0.15 }, + { band: 9, gain: 0.15 }, + { band: 10, gain: 0.15 }, + { band: 11, gain: 0.15 }, + { band: 12, gain: 0.15 }, + { band: 13, gain: 0.15 }, + ], + timescale: { + pitch: 0.55, + }, + }, }, }; diff --git a/src/commands/prefix/Filter/Vibrate.ts b/src/commands/prefix/Filter/Vibrate.ts index 7d1c84e9..65feab6e 100644 --- a/src/commands/prefix/Filter/Vibrate.ts +++ b/src/commands/prefix/Filter/Vibrate.ts @@ -58,15 +58,18 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - vibrato: { - frequency: 4.0, - depth: 0.75, - }, - tremolo: { - frequency: 4.0, - depth: 0.75, + playerOptions: { + filters: { + vibrato: { + frequency: 4.0, + depth: 0.75, + }, + tremolo: { + frequency: 4.0, + depth: 0.75, + }, + }, }, }; diff --git a/src/commands/prefix/Filter/Vibrato.ts b/src/commands/prefix/Filter/Vibrato.ts index 0948f42d..d16570fc 100644 --- a/src/commands/prefix/Filter/Vibrato.ts +++ b/src/commands/prefix/Filter/Vibrato.ts @@ -58,11 +58,18 @@ export default class implements PrefixCommand { }); const data = { - op: "filters", guildId: message.guild!.id, - vibrato: { - frequency: 4.0, - depth: 0.75, + playerOptions: { + vibrato: { + frequency: 4.0, + depth: 0.75, + }, + filters: { + vibrato: { + frequency: 4.0, + depth: 0.75, + }, + }, }, }; diff --git a/src/commands/prefix/Music/247.ts b/src/commands/prefix/Music/247.ts index 09a789be..0a6e89f9 100644 --- a/src/commands/prefix/Music/247.ts +++ b/src/commands/prefix/Music/247.ts @@ -1,7 +1,7 @@ import { EmbedBuilder, Message } from "discord.js"; import { Manager } from "../../../manager.js"; import { Accessableby, PrefixCommand } from "../../../@types/Command.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; export default class implements PrefixCommand { @@ -30,27 +30,28 @@ export default class implements PrefixCommand { ], }); - const player = client.manager.players.get(message.guild!.id); - if (!player) + const { channel } = message.member!.voice; + if ( + !channel || + message.member!.voice.channel !== message.guild!.members.me!.voice.channel + ) return msg.edit({ embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "noplayer", "no_player")}` + `${client.i18n.get(language, "noplayer", "no_voice")}` ) .setColor(client.color), ], }); - const { channel } = message.member!.voice; - if ( - !channel || - message.member!.voice.channel !== message.guild!.members.me!.voice.channel - ) + + const player = client.manager.players.get(message.guild!.id); + if (!player) return msg.edit({ embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "noplayer", "no_voice")}` + `${client.i18n.get(language, "noplayer", "no_player")}` ) .setColor(client.color), ], diff --git a/src/commands/prefix/Music/Forward.ts b/src/commands/prefix/Music/Forward.ts index d05fa9b4..85573c18 100644 --- a/src/commands/prefix/Music/Forward.ts +++ b/src/commands/prefix/Music/Forward.ts @@ -65,10 +65,11 @@ export default class implements PrefixCommand { if (value && !isNaN(+value)) { if (song_position + Number(value) * 1000 < song!.length!) { - player["send"]({ - op: "seek", + player.send({ guildId: message.guild!.id, - position: song_position + Number(value) * 1000, + playerOptions: { + position: song_position + Number(value) * 1000, + }, }); const forward1 = new EmbedBuilder() @@ -108,9 +109,10 @@ export default class implements PrefixCommand { if (!value) { if (song_position + fastForwardNum * 1000 < song!.length!) { player["send"]({ - op: "seek", guildId: message.guild!.id, - position: song_position + fastForwardNum * 1000, + playerOptions: { + position: song_position + fastForwardNum * 1000, + }, }); const forward2 = new EmbedBuilder() diff --git a/src/commands/prefix/Music/Lofi.ts b/src/commands/prefix/Music/Lofi.ts index 26150e5e..497d2240 100644 --- a/src/commands/prefix/Music/Lofi.ts +++ b/src/commands/prefix/Music/Lofi.ts @@ -88,7 +88,7 @@ export default class implements PrefixCommand { .setDescription( `${client.i18n.get(language, "music", "radio_track", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: new ConvertTime().parse(tracks[0].length as number), request: String(tracks[0].requester), })}` @@ -99,7 +99,7 @@ export default class implements PrefixCommand { const embed = new EmbedBuilder().setColor(client.color).setDescription( `${client.i18n.get(language, "music", "play_result", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: new ConvertTime().parse(tracks[0].length as number), request: String(tracks[0].requester), })}` diff --git a/src/commands/prefix/Music/Loop.ts b/src/commands/prefix/Music/Loop.ts index 5582a3f1..b6e913a5 100644 --- a/src/commands/prefix/Music/Loop.ts +++ b/src/commands/prefix/Music/Loop.ts @@ -2,7 +2,7 @@ import { EmbedBuilder, Message, PermissionsBitField } from "discord.js"; import { Manager } from "../../../manager.js"; import { KazagumoLoop } from "../../../@types/Lavalink.js"; import { Accessableby, PrefixCommand } from "../../../@types/Command.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; export default class implements PrefixCommand { diff --git a/src/commands/prefix/Music/LoopQueue.ts b/src/commands/prefix/Music/LoopQueue.ts index e040879d..36c176e8 100644 --- a/src/commands/prefix/Music/LoopQueue.ts +++ b/src/commands/prefix/Music/LoopQueue.ts @@ -2,7 +2,7 @@ import { EmbedBuilder, Message } from "discord.js"; import { Manager } from "../../../manager.js"; import { KazagumoLoop, KazagumoLoopMode } from "../../../@types/Lavalink.js"; import { Accessableby, PrefixCommand } from "../../../@types/Command.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; // Main code diff --git a/src/commands/prefix/Music/Play.ts b/src/commands/prefix/Music/Play.ts index fe9d8626..355acd47 100644 --- a/src/commands/prefix/Music/Play.ts +++ b/src/commands/prefix/Music/Play.ts @@ -57,17 +57,8 @@ export default class implements PrefixCommand { textId: message.channel.id, deaf: true, }); - else if (player && !this.checkSameVoice(message)) { - msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "noplayer", "no_voice")}` - ) - .setColor(client.color), - ], - }); - return + else if (player && !this.checkSameVoice(message, client, language, msg)) { + return; } const result = await player.search(value, { requester: message.author }); @@ -100,7 +91,7 @@ export default class implements PrefixCommand { .setDescription( `${client.i18n.get(language, "music", "play_track", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: new ConvertTime().parse(tracks[0].length as number), request: String(tracks[0].requester), })}` @@ -127,7 +118,7 @@ export default class implements PrefixCommand { const embed = new EmbedBuilder().setColor(client.color).setDescription( `${client.i18n.get(language, "music", "play_result", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: new ConvertTime().parse(tracks[0].length as number), request: String(tracks[0].requester), })}` @@ -137,11 +128,27 @@ export default class implements PrefixCommand { } } - private checkSameVoice( + checkSameVoice( message: Message, + client: Manager, + language: string, + msg: Message ) { - return ( + if ( message.member!.voice.channel !== message.guild!.members.me!.voice.channel - ) + ) { + msg.edit({ + embeds: [ + new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "noplayer", "no_voice")}` + ) + .setColor(client.color), + ], + }); + return false; + } + + return true; } } diff --git a/src/commands/prefix/Music/Previous.ts b/src/commands/prefix/Music/Previous.ts index 7c3beba9..014ca69e 100644 --- a/src/commands/prefix/Music/Previous.ts +++ b/src/commands/prefix/Music/Previous.ts @@ -65,7 +65,7 @@ export default class implements PrefixCommand { ], }); - await player.queue.unshift(player.queue.previous); + await player.queue.unshift(player.queue.previous[0]); await player.skip(); const embed = new EmbedBuilder() diff --git a/src/commands/prefix/Music/Radio.ts b/src/commands/prefix/Music/Radio.ts index b61608ea..ce9b5e33 100644 --- a/src/commands/prefix/Music/Radio.ts +++ b/src/commands/prefix/Music/Radio.ts @@ -265,7 +265,7 @@ export default class implements PrefixCommand { .setDescription( `${client.i18n.get(language, "music", "play_track", { title: args2[0], - url: res.tracks[0].uri, + url: String(res.tracks[0].uri), duration: new ConvertTime().parse(res.tracks[0].length as number), request: String(res.tracks[0].requester), })}` diff --git a/src/commands/prefix/Music/Remove.ts b/src/commands/prefix/Music/Remove.ts index 347876a4..c1544ccd 100644 --- a/src/commands/prefix/Music/Remove.ts +++ b/src/commands/prefix/Music/Remove.ts @@ -97,7 +97,7 @@ export default class implements PrefixCommand { .setDescription( `${client.i18n.get(language, "music", "removetrack_desc", { name: song.title, - url: song.uri, + url: String(song.uri), duration: new ConvertTime().parse(player.shoukaku.position), request: String(song.requester), })}` diff --git a/src/commands/prefix/Music/RemoveDuplicate.ts b/src/commands/prefix/Music/RemoveDuplicate.ts index 0b11aff5..97b27eae 100644 --- a/src/commands/prefix/Music/RemoveDuplicate.ts +++ b/src/commands/prefix/Music/RemoveDuplicate.ts @@ -1,6 +1,6 @@ import { EmbedBuilder, Message } from "discord.js"; import { Manager } from "../../../manager.js"; -import { KazagumoTrack } from "better-kazagumo"; +import { KazagumoTrack } from "kazagumo.mod"; import { Accessableby, PrefixCommand } from "../../../@types/Command.js"; // Main code diff --git a/src/commands/prefix/Music/Replay.ts b/src/commands/prefix/Music/Replay.ts index 511c9e85..294c56d6 100644 --- a/src/commands/prefix/Music/Replay.ts +++ b/src/commands/prefix/Music/Replay.ts @@ -55,10 +55,11 @@ export default class implements PrefixCommand { ], }); - await player["send"]({ - op: "seek", + await player.send({ guildId: message.guild!.id, - position: 0, + playerOptions: { + position: 0, + }, }); const embed = new EmbedBuilder() diff --git a/src/commands/prefix/Music/Rewind.ts b/src/commands/prefix/Music/Rewind.ts index 74ad282d..7a50c67a 100644 --- a/src/commands/prefix/Music/Rewind.ts +++ b/src/commands/prefix/Music/Rewind.ts @@ -69,9 +69,10 @@ export default class implements PrefixCommand { if (value && !isNaN(+value)) { if (song_position - Number(value) * 1000 > 0) { await player["send"]({ - op: "seek", guildId: message.guild!.id, - position: song_position - Number(value) * 1000, + playerOptions: { + position: song_position - Number(value) * 1000, + }, }); const rewind1 = new EmbedBuilder() @@ -111,9 +112,10 @@ export default class implements PrefixCommand { if (!value) { if (song_position - rewindNum * 1000 > 0) { await player["send"]({ - op: "seek", guildId: message.guild!.id, - position: song_position - rewindNum * 1000, + playerOptions: { + position: song_position - rewindNum * 1000, + }, }); const rewind2 = new EmbedBuilder() diff --git a/src/commands/prefix/Music/Volume.ts b/src/commands/prefix/Music/Volume.ts index 4319fb7f..c6723397 100644 --- a/src/commands/prefix/Music/Volume.ts +++ b/src/commands/prefix/Music/Volume.ts @@ -1,7 +1,7 @@ import { EmbedBuilder, Message } from "discord.js"; import { Manager } from "../../../manager.js"; import { Accessableby, PrefixCommand } from "../../../@types/Command.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; // Main code diff --git a/src/commands/prefix/Playlist/Add.ts b/src/commands/prefix/Playlist/Add.ts index d4604678..b970db74 100644 --- a/src/commands/prefix/Playlist/Add.ts +++ b/src/commands/prefix/Playlist/Add.ts @@ -5,7 +5,7 @@ import { } from "discord.js"; import { ConvertTime } from "../../../structures/ConvertTime.js"; import { StartQueueDuration } from "../../../structures/QueueDuration.js"; -import { KazagumoTrack } from "better-kazagumo"; +import { KazagumoTrack } from "kazagumo.mod"; import { Manager } from "../../../manager.js"; import { Accessableby, PrefixCommand } from "../../../@types/Command.js"; @@ -103,7 +103,7 @@ export default class implements PrefixCommand { .setDescription( `${client.i18n.get(language, "playlist", "add_track", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: Duration, user: String(message.author), })}` @@ -115,7 +115,7 @@ export default class implements PrefixCommand { .setDescription( `${client.i18n.get(language, "playlist", "add_search", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: Duration, user: String(message.author), })}` diff --git a/src/commands/prefix/Playlist/SaveQueue.ts b/src/commands/prefix/Playlist/SaveQueue.ts index 4536f069..41bbc97f 100644 --- a/src/commands/prefix/Playlist/SaveQueue.ts +++ b/src/commands/prefix/Playlist/SaveQueue.ts @@ -1,6 +1,6 @@ import { EmbedBuilder, Message } from "discord.js"; import { Manager } from "../../../manager.js"; -import { KazagumoTrack } from "better-kazagumo"; +import { KazagumoTrack } from "kazagumo.mod"; import { Accessableby, PrefixCommand } from "../../../@types/Command.js"; const TrackAdd: KazagumoTrack[] = []; @@ -109,7 +109,9 @@ export default class implements PrefixCommand { const element = playlist.tracks[i].uri; TrackExist.push(element); } - Result = TrackAdd.filter((track) => !TrackExist.includes(track.uri)); + Result = TrackAdd.filter( + (track) => !TrackExist.includes(String(track.uri)) + ); } if (Result!.length == 0) { diff --git a/src/commands/slash/Filter/3d.ts b/src/commands/slash/Filter/3d.ts index 6a8d960c..c363e9eb 100644 --- a/src/commands/slash/Filter/3d.ts +++ b/src/commands/slash/Filter/3d.ts @@ -57,13 +57,14 @@ export default class implements SlashCommand { ], }); - const data = { - op: "filters", - guildId: interaction.guild!.id, - rotation: { rotationHz: 0.2 }, - }; - - await player["send"](data); + await player.send({ + guildId: String(interaction.guild?.id), + playerOptions: { + filters: { + rotation: { rotationHz: 0.2 }, + }, + }, + }); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Bass.ts b/src/commands/slash/Filter/Bass.ts index 3b397701..c9f87b8b 100644 --- a/src/commands/slash/Filter/Bass.ts +++ b/src/commands/slash/Filter/Bass.ts @@ -59,27 +59,30 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - equalizer: [ - { band: 0, gain: 0.1 }, - { band: 1, gain: 0.1 }, - { band: 2, gain: 0.05 }, - { band: 3, gain: 0.05 }, - { band: 4, gain: -0.05 }, - { band: 5, gain: -0.05 }, - { band: 6, gain: 0 }, - { band: 7, gain: -0.05 }, - { band: 8, gain: -0.05 }, - { band: 9, gain: 0 }, - { band: 10, gain: 0.05 }, - { band: 11, gain: 0.05 }, - { band: 12, gain: 0.1 }, - { band: 13, gain: 0.1 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0.1 }, + { band: 1, gain: 0.1 }, + { band: 2, gain: 0.05 }, + { band: 3, gain: 0.05 }, + { band: 4, gain: -0.05 }, + { band: 5, gain: -0.05 }, + { band: 6, gain: 0 }, + { band: 7, gain: -0.05 }, + { band: 8, gain: -0.05 }, + { band: 9, gain: 0 }, + { band: 10, gain: 0.05 }, + { band: 11, gain: 0.05 }, + { band: 12, gain: 0.1 }, + { band: 13, gain: 0.1 }, + ], + }, + }, }; - await player["send"](data); + await player.send(data); const bassed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Bassboost.ts b/src/commands/slash/Filter/Bassboost.ts index 38dba785..9f299170 100644 --- a/src/commands/slash/Filter/Bassboost.ts +++ b/src/commands/slash/Filter/Bassboost.ts @@ -60,27 +60,30 @@ export default class implements SlashCommand { }); if (!value) { const data = { - op: "filters", guildId: interaction.guild!.id, - equalizer: [ - { band: 0, gain: 0.1 }, - { band: 1, gain: 0.1 }, - { band: 2, gain: 0.05 }, - { band: 3, gain: 0.05 }, - { band: 4, gain: -0.05 }, - { band: 5, gain: -0.05 }, - { band: 6, gain: 0 }, - { band: 7, gain: -0.05 }, - { band: 8, gain: -0.05 }, - { band: 9, gain: 0 }, - { band: 10, gain: 0.05 }, - { band: 11, gain: 0.05 }, - { band: 12, gain: 0.1 }, - { band: 13, gain: 0.1 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0.1 }, + { band: 1, gain: 0.1 }, + { band: 2, gain: 0.05 }, + { band: 3, gain: 0.05 }, + { band: 4, gain: -0.05 }, + { band: 5, gain: -0.05 }, + { band: 6, gain: 0 }, + { band: 7, gain: -0.05 }, + { band: 8, gain: -0.05 }, + { band: 9, gain: 0 }, + { band: 10, gain: 0.05 }, + { band: 11, gain: 0.05 }, + { band: 12, gain: 0.1 }, + { band: 13, gain: 0.1 }, + ], + }, + }, }; - await player["send"](data); + await player.send(data); const msg1 = await interaction.editReply({ embeds: [ @@ -126,26 +129,29 @@ export default class implements SlashCommand { ], }); const data = { - op: "filters", guildId: interaction.guild!.id, - equalizer: [ - { band: 0, gain: value / 10 }, - { band: 1, gain: value / 10 }, - { band: 2, gain: value / 10 }, - { band: 3, gain: value / 10 }, - { band: 4, gain: value / 10 }, - { band: 5, gain: value / 10 }, - { band: 6, gain: value / 10 }, - { band: 7, gain: 0 }, - { band: 8, gain: 0 }, - { band: 9, gain: 0 }, - { band: 10, gain: 0 }, - { band: 11, gain: 0 }, - { band: 12, gain: 0 }, - { band: 13, gain: 0 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: value / 10 }, + { band: 1, gain: value / 10 }, + { band: 2, gain: value / 10 }, + { band: 3, gain: value / 10 }, + { band: 4, gain: value / 10 }, + { band: 5, gain: value / 10 }, + { band: 6, gain: value / 10 }, + { band: 7, gain: 0 }, + { band: 8, gain: 0 }, + { band: 9, gain: 0 }, + { band: 10, gain: 0 }, + { band: 11, gain: 0 }, + { band: 12, gain: 0 }, + { band: 13, gain: 0 }, + ], + }, + }, }; - await player["send"](data); + await player.send(data); const msg2 = await interaction.editReply({ embeds: [ new EmbedBuilder() diff --git a/src/commands/slash/Filter/China.ts b/src/commands/slash/Filter/China.ts index 72ab6fc0..3e4599b0 100644 --- a/src/commands/slash/Filter/China.ts +++ b/src/commands/slash/Filter/China.ts @@ -58,16 +58,19 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - timescale: { - speed: 0.75, - pitch: 1.25, - rate: 1.25, + playerOptions: { + filters: { + timescale: { + speed: 0.75, + pitch: 1.25, + rate: 1.25, + }, + }, }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Chipmunk.ts b/src/commands/slash/Filter/Chipmunk.ts index 2a1168aa..167cc7f4 100644 --- a/src/commands/slash/Filter/Chipmunk.ts +++ b/src/commands/slash/Filter/Chipmunk.ts @@ -58,16 +58,19 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - timescale: { - speed: 1.05, - pitch: 1.35, - rate: 1.25, + playerOptions: { + filters: { + timescale: { + speed: 1.05, + pitch: 1.35, + rate: 1.25, + }, + }, }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Darthvader.ts b/src/commands/slash/Filter/Darthvader.ts index 43eaa0e7..05ba74c1 100644 --- a/src/commands/slash/Filter/Darthvader.ts +++ b/src/commands/slash/Filter/Darthvader.ts @@ -2,6 +2,7 @@ import { EmbedBuilder, CommandInteraction, GuildMember } from "discord.js"; import delay from "delay"; import { Manager } from "../../../manager.js"; import { Accessableby, SlashCommand } from "../../../@types/Command.js"; +import { filter } from "lodash"; export default class implements SlashCommand { name = ["filter", "darthvader"]; @@ -58,16 +59,19 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - timescale: { - speed: 0.975, - pitch: 0.5, - rate: 0.8, + playerOptions: { + filters: { + timescale: { + speed: 0.975, + pitch: 0.5, + rate: 0.8, + }, + }, }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Daycore.ts b/src/commands/slash/Filter/Daycore.ts index 11a7a96b..f784d690 100644 --- a/src/commands/slash/Filter/Daycore.ts +++ b/src/commands/slash/Filter/Daycore.ts @@ -58,31 +58,34 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - equalizer: [ - { band: 0, gain: 0 }, - { band: 1, gain: 0 }, - { band: 2, gain: 0 }, - { band: 3, gain: 0 }, - { band: 4, gain: 0 }, - { band: 5, gain: 0 }, - { band: 6, gain: 0 }, - { band: 7, gain: 0 }, - { band: 8, gain: -0.25 }, - { band: 9, gain: -0.25 }, - { band: 10, gain: -0.25 }, - { band: 11, gain: -0.25 }, - { band: 12, gain: -0.25 }, - { band: 13, gain: -0.25 }, - ], - timescale: { - pitch: 0.63, - rate: 1.05, + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0 }, + { band: 1, gain: 0 }, + { band: 2, gain: 0 }, + { band: 3, gain: 0 }, + { band: 4, gain: 0 }, + { band: 5, gain: 0 }, + { band: 6, gain: 0 }, + { band: 7, gain: 0 }, + { band: 8, gain: -0.25 }, + { band: 9, gain: -0.25 }, + { band: 10, gain: -0.25 }, + { band: 11, gain: -0.25 }, + { band: 12, gain: -0.25 }, + { band: 13, gain: -0.25 }, + ], + timescale: { + pitch: 0.63, + rate: 1.05, + }, + }, }, }; - await player["send"](data); + await player.send(data); const daycored = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Doubletime.ts b/src/commands/slash/Filter/Doubletime.ts index d2986ba5..73285827 100644 --- a/src/commands/slash/Filter/Doubletime.ts +++ b/src/commands/slash/Filter/Doubletime.ts @@ -58,14 +58,17 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - timescale: { - speed: 1.165, + playerOptions: { + filters: { + timescale: { + speed: 1.165, + }, + }, }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Earrape.ts b/src/commands/slash/Filter/Earrape.ts index 0951f8b2..4a241cac 100644 --- a/src/commands/slash/Filter/Earrape.ts +++ b/src/commands/slash/Filter/Earrape.ts @@ -57,11 +57,6 @@ export default class implements SlashCommand { ], }); await player.setVolume(500); - const data = { - op: "filters", - guildId: interaction.guild!.id, - }; - await player["send"](data); const earrapped = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Equalizer.ts b/src/commands/slash/Filter/Equalizer.ts index 4c9974fb..9c5e2bfc 100644 --- a/src/commands/slash/Filter/Equalizer.ts +++ b/src/commands/slash/Filter/Equalizer.ts @@ -82,10 +82,12 @@ export default class implements SlashCommand { return interaction.editReply({ embeds: [embed] }); } else if (value == "off" || value == "reset") { const data = { - op: "filters", guildId: interaction.guild!.id, + playerOptions: { + filters: {}, + }, }; - return player["send"](data); + return player.send(data); } const bands = value.split(/[ ]+/); @@ -121,11 +123,14 @@ export default class implements SlashCommand { for (let i = 0; i < bands.length; i++) { if (i > 13) break; const data = { - op: "filters", guildId: interaction.guild!.id, - equalizer: [{ band: i, gain: Number(bands[i]) / 10 }], + playerOptions: { + filters: { + equalizer: [{ band: i, gain: Number(bands[i]) / 10 }], + }, + }, }; - player["send"](data); + player.send(data); bandsStr += `${bands[i]} `; } diff --git a/src/commands/slash/Filter/Karaoke.ts b/src/commands/slash/Filter/Karaoke.ts index c61d659d..d729b33a 100644 --- a/src/commands/slash/Filter/Karaoke.ts +++ b/src/commands/slash/Filter/Karaoke.ts @@ -58,17 +58,20 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - karaoke: { - level: 1.0, - monoLevel: 1.0, - filterBand: 220.0, - filterWidth: 100.0, + playerOptions: { + filters: { + karaoke: { + level: 1.0, + monoLevel: 1.0, + filterBand: 220.0, + filterWidth: 100.0, + }, + }, }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Nightcore.ts b/src/commands/slash/Filter/Nightcore.ts index 13c0ac9f..e0c0df92 100644 --- a/src/commands/slash/Filter/Nightcore.ts +++ b/src/commands/slash/Filter/Nightcore.ts @@ -59,16 +59,19 @@ export default class implements SlashCommand { ], }); const data = { - op: "filters", guildId: interaction.guild!.id, - timescale: { - speed: 1.05, - pitch: 1.125, - rate: 1.05, + playerOptions: { + filters: { + timescale: { + speed: 1.05, + pitch: 1.125, + rate: 1.05, + }, + }, }, }; - await player["send"](data); + await player.send(data); const nightcored = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Pitch.ts b/src/commands/slash/Filter/Pitch.ts index bbf72015..6ed4920b 100644 --- a/src/commands/slash/Filter/Pitch.ts +++ b/src/commands/slash/Filter/Pitch.ts @@ -83,12 +83,15 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - timescale: { pitch: value }, + playerOptions: { + filters: { + timescale: { pitch: Number(value) }, + }, + }, }; - await player["send"](data); + await player.send(data); const msg = await interaction.editReply({ embeds: [ diff --git a/src/commands/slash/Filter/Pop.ts b/src/commands/slash/Filter/Pop.ts index c1b197f1..e1969de8 100644 --- a/src/commands/slash/Filter/Pop.ts +++ b/src/commands/slash/Filter/Pop.ts @@ -59,27 +59,30 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - equalizer: [ - { band: 0, gain: 0.65 }, - { band: 1, gain: 0.45 }, - { band: 2, gain: -0.45 }, - { band: 3, gain: -0.65 }, - { band: 4, gain: -0.35 }, - { band: 5, gain: 0.45 }, - { band: 6, gain: 0.55 }, - { band: 7, gain: 0.6 }, - { band: 8, gain: 0.6 }, - { band: 9, gain: 0.6 }, - { band: 10, gain: 0 }, - { band: 11, gain: 0 }, - { band: 12, gain: 0 }, - { band: 13, gain: 0 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0.65 }, + { band: 1, gain: 0.45 }, + { band: 2, gain: -0.45 }, + { band: 3, gain: -0.65 }, + { band: 4, gain: -0.35 }, + { band: 5, gain: 0.45 }, + { band: 6, gain: 0.55 }, + { band: 7, gain: 0.6 }, + { band: 8, gain: 0.6 }, + { band: 9, gain: 0.6 }, + { band: 10, gain: 0 }, + { band: 11, gain: 0 }, + { band: 12, gain: 0 }, + { band: 13, gain: 0 }, + ], + }, + }, }; - await player["send"](data); + await player.send(data); const popped = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Rate.ts b/src/commands/slash/Filter/Rate.ts index 33dc7eb6..c7a38128 100644 --- a/src/commands/slash/Filter/Rate.ts +++ b/src/commands/slash/Filter/Rate.ts @@ -83,12 +83,15 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - timescale: { rate: value }, + playerOptions: { + filters: { + timescale: { rate: Number(value) }, + }, + }, }; - await player["send"](data); + await player.send(data); const msg = await interaction.editReply({ embeds: [ diff --git a/src/commands/slash/Filter/Reset.ts b/src/commands/slash/Filter/Reset.ts index 42e445fe..665714cc 100644 --- a/src/commands/slash/Filter/Reset.ts +++ b/src/commands/slash/Filter/Reset.ts @@ -56,11 +56,13 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, + playerOptions: { + filters: {}, + }, }; - await player["send"](data); + await player.send(data); await player.setVolume(100); const resetted = new EmbedBuilder() diff --git a/src/commands/slash/Filter/Slowmotion.ts b/src/commands/slash/Filter/Slowmotion.ts index 20a8d9e6..7cc3bb56 100644 --- a/src/commands/slash/Filter/Slowmotion.ts +++ b/src/commands/slash/Filter/Slowmotion.ts @@ -58,16 +58,19 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - timescale: { - speed: 0.5, - pitch: 1.0, - rate: 0.8, + playerOptions: { + filters: { + timescale: { + speed: 0.5, + pitch: 1.0, + rate: 0.8, + }, + }, }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Soft.ts b/src/commands/slash/Filter/Soft.ts index 48a7ac6c..3ec07f98 100644 --- a/src/commands/slash/Filter/Soft.ts +++ b/src/commands/slash/Filter/Soft.ts @@ -58,27 +58,30 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - equalizer: [ - { band: 0, gain: 0 }, - { band: 1, gain: 0 }, - { band: 2, gain: 0 }, - { band: 3, gain: 0 }, - { band: 4, gain: 0 }, - { band: 5, gain: 0 }, - { band: 6, gain: 0 }, - { band: 7, gain: 0 }, - { band: 8, gain: -0.25 }, - { band: 9, gain: -0.25 }, - { band: 10, gain: -0.25 }, - { band: 11, gain: -0.25 }, - { band: 12, gain: -0.25 }, - { band: 13, gain: -0.25 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0 }, + { band: 1, gain: 0 }, + { band: 2, gain: 0 }, + { band: 3, gain: 0 }, + { band: 4, gain: 0 }, + { band: 5, gain: 0 }, + { band: 6, gain: 0 }, + { band: 7, gain: 0 }, + { band: 8, gain: -0.25 }, + { band: 9, gain: -0.25 }, + { band: 10, gain: -0.25 }, + { band: 11, gain: -0.25 }, + { band: 12, gain: -0.25 }, + { band: 13, gain: -0.25 }, + ], + }, + }, }; - await player["send"](data); + await player.send(data); const softed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Speed.ts b/src/commands/slash/Filter/Speed.ts index 75e58458..04b9087d 100644 --- a/src/commands/slash/Filter/Speed.ts +++ b/src/commands/slash/Filter/Speed.ts @@ -83,12 +83,15 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - timescale: { speed: value }, + playerOptions: { + filters: { + timescale: { speed: Number(value) }, + }, + }, }; - await player["send"](data); + await player.send(data); const msg = await interaction.editReply({ embeds: [ diff --git a/src/commands/slash/Filter/Superbass.ts b/src/commands/slash/Filter/Superbass.ts index e13c21f2..5a57600b 100644 --- a/src/commands/slash/Filter/Superbass.ts +++ b/src/commands/slash/Filter/Superbass.ts @@ -58,27 +58,30 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - equalizer: [ - { band: 0, gain: 0.2 }, - { band: 1, gain: 0.3 }, - { band: 2, gain: 0 }, - { band: 3, gain: 0.8 }, - { band: 4, gain: 0 }, - { band: 5, gain: 0.5 }, - { band: 6, gain: 0 }, - { band: 7, gain: -0.5 }, - { band: 8, gain: 0 }, - { band: 9, gain: 0 }, - { band: 10, gain: 0 }, - { band: 11, gain: 0 }, - { band: 12, gain: 0 }, - { band: 13, gain: 0 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0.2 }, + { band: 1, gain: 0.3 }, + { band: 2, gain: 0 }, + { band: 3, gain: 0.8 }, + { band: 4, gain: 0 }, + { band: 5, gain: 0.5 }, + { band: 6, gain: 0 }, + { band: 7, gain: -0.5 }, + { band: 8, gain: 0 }, + { band: 9, gain: 0 }, + { band: 10, gain: 0 }, + { band: 11, gain: 0 }, + { band: 12, gain: 0 }, + { band: 13, gain: 0 }, + ], + }, + }, }; - await player["send"](data); + await player.send(data); const sbed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Television.ts b/src/commands/slash/Filter/Television.ts index 254fa620..683c82aa 100644 --- a/src/commands/slash/Filter/Television.ts +++ b/src/commands/slash/Filter/Television.ts @@ -60,25 +60,29 @@ export default class implements SlashCommand { const data = { op: "filters", guildId: interaction.guild!.id, - equalizer: [ - { band: 0, gain: 0 }, - { band: 1, gain: 0 }, - { band: 2, gain: 0 }, - { band: 3, gain: 0 }, - { band: 4, gain: 0 }, - { band: 5, gain: 0 }, - { band: 6, gain: 0 }, - { band: 7, gain: 0.65 }, - { band: 8, gain: 0.65 }, - { band: 9, gain: 0.65 }, - { band: 10, gain: 0.65 }, - { band: 11, gain: 0.65 }, - { band: 12, gain: 0.65 }, - { band: 13, gain: 0.65 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0 }, + { band: 1, gain: 0 }, + { band: 2, gain: 0 }, + { band: 3, gain: 0 }, + { band: 4, gain: 0 }, + { band: 5, gain: 0 }, + { band: 6, gain: 0 }, + { band: 7, gain: 0.65 }, + { band: 8, gain: 0.65 }, + { band: 9, gain: 0.65 }, + { band: 10, gain: 0.65 }, + { band: 11, gain: 0.65 }, + { band: 12, gain: 0.65 }, + { band: 13, gain: 0.65 }, + ], + }, + }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Treblebass.ts b/src/commands/slash/Filter/Treblebass.ts index ffebd867..060e6871 100644 --- a/src/commands/slash/Filter/Treblebass.ts +++ b/src/commands/slash/Filter/Treblebass.ts @@ -60,25 +60,29 @@ export default class implements SlashCommand { const data = { op: "filters", guildId: interaction.guild!.id, - equalizer: [ - { band: 0, gain: 0.6 }, - { band: 1, gain: 0.67 }, - { band: 2, gain: 0.67 }, - { band: 3, gain: 0 }, - { band: 4, gain: -0.5 }, - { band: 5, gain: 0.15 }, - { band: 6, gain: -0.45 }, - { band: 7, gain: 0.23 }, - { band: 8, gain: 0.35 }, - { band: 9, gain: 0.45 }, - { band: 10, gain: 0.55 }, - { band: 11, gain: 0.6 }, - { band: 12, gain: 0.55 }, - { band: 13, gain: 0 }, - ], + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0.6 }, + { band: 1, gain: 0.67 }, + { band: 2, gain: 0.67 }, + { band: 3, gain: 0 }, + { band: 4, gain: -0.5 }, + { band: 5, gain: 0.15 }, + { band: 6, gain: -0.45 }, + { band: 7, gain: 0.23 }, + { band: 8, gain: 0.35 }, + { band: 9, gain: 0.45 }, + { band: 10, gain: 0.55 }, + { band: 11, gain: 0.6 }, + { band: 12, gain: 0.55 }, + { band: 13, gain: 0 }, + ], + }, + }, }; - await player["send"](data); + await player.send(data); const tbed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Tremolo.ts b/src/commands/slash/Filter/Tremolo.ts index 6f3f37ec..50707a8b 100644 --- a/src/commands/slash/Filter/Tremolo.ts +++ b/src/commands/slash/Filter/Tremolo.ts @@ -58,15 +58,18 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - tremolo: { - frequency: 4.0, - depth: 0.75, + playerOptions: { + filters: { + tremolo: { + frequency: 4.0, + depth: 0.75, + }, + }, }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Vaporwave.ts b/src/commands/slash/Filter/Vaporwave.ts index b352cb46..08832f9c 100644 --- a/src/commands/slash/Filter/Vaporwave.ts +++ b/src/commands/slash/Filter/Vaporwave.ts @@ -57,30 +57,33 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - equalizer: [ - { band: 0, gain: 0 }, - { band: 1, gain: 0 }, - { band: 2, gain: 0 }, - { band: 3, gain: 0 }, - { band: 4, gain: 0 }, - { band: 5, gain: 0 }, - { band: 6, gain: 0 }, - { band: 7, gain: 0 }, - { band: 8, gain: 0.15 }, - { band: 9, gain: 0.15 }, - { band: 10, gain: 0.15 }, - { band: 11, gain: 0.15 }, - { band: 12, gain: 0.15 }, - { band: 13, gain: 0.15 }, - ], - timescale: { - pitch: 0.55, + playerOptions: { + filters: { + equalizer: [ + { band: 0, gain: 0 }, + { band: 1, gain: 0 }, + { band: 2, gain: 0 }, + { band: 3, gain: 0 }, + { band: 4, gain: 0 }, + { band: 5, gain: 0 }, + { band: 6, gain: 0 }, + { band: 7, gain: 0 }, + { band: 8, gain: 0.15 }, + { band: 9, gain: 0.15 }, + { band: 10, gain: 0.15 }, + { band: 11, gain: 0.15 }, + { band: 12, gain: 0.15 }, + { band: 13, gain: 0.15 }, + ], + timescale: { + pitch: 0.55, + }, + }, }, }; - await player["send"](data); + await player.send(data); const vaporwaved = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Vibrate.ts b/src/commands/slash/Filter/Vibrate.ts index e9d1836a..e7a30037 100644 --- a/src/commands/slash/Filter/Vibrate.ts +++ b/src/commands/slash/Filter/Vibrate.ts @@ -58,19 +58,22 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - vibrato: { - frequency: 4.0, - depth: 0.75, - }, - tremolo: { - frequency: 4.0, - depth: 0.75, + playerOptions: { + filters: { + vibrato: { + frequency: 4.0, + depth: 0.75, + }, + tremolo: { + frequency: 4.0, + depth: 0.75, + }, + }, }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Filter/Vibrato.ts b/src/commands/slash/Filter/Vibrato.ts index 1ba3b4d8..42bcc7ac 100644 --- a/src/commands/slash/Filter/Vibrato.ts +++ b/src/commands/slash/Filter/Vibrato.ts @@ -57,15 +57,18 @@ export default class implements SlashCommand { }); const data = { - op: "filters", guildId: interaction.guild!.id, - vibrato: { - frequency: 4.0, - depth: 0.75, + playerOptions: { + filters: { + vibrato: { + frequency: 4.0, + depth: 0.75, + }, + }, }, }; - await player["send"](data); + await player.send(data); const embed = new EmbedBuilder() .setDescription( diff --git a/src/commands/slash/Music/247.ts b/src/commands/slash/Music/247.ts index c7187a58..e1a34aba 100644 --- a/src/commands/slash/Music/247.ts +++ b/src/commands/slash/Music/247.ts @@ -1,11 +1,6 @@ import { EmbedBuilder, CommandInteraction, GuildMember } from "discord.js"; import { Manager } from "../../../manager.js"; -import { - Accessableby, - CommandOptionInterface, - SlashCommand, -} from "../../../@types/Command.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { Accessableby, SlashCommand } from "../../../@types/Command.js"; import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; export default class implements SlashCommand { @@ -31,28 +26,29 @@ export default class implements SlashCommand { ], }); - const player = client.manager.players.get(interaction.guild!.id); - if (!player) + const { channel } = (interaction.member as GuildMember)!.voice; + if ( + !channel || + (interaction.member as GuildMember)!.voice.channel !== + interaction.guild!.members.me!.voice.channel + ) return msg.edit({ embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "noplayer", "no_player")}` + `${client.i18n.get(language, "noplayer", "no_voice")}` ) .setColor(client.color), ], }); - const { channel } = (interaction.member as GuildMember)!.voice; - if ( - !channel || - (interaction.member as GuildMember)!.voice.channel !== - interaction.guild!.members.me!.voice.channel - ) + + const player = client.manager.players.get(interaction.guild!.id); + if (!player) return msg.edit({ embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "noplayer", "no_voice")}` + `${client.i18n.get(language, "noplayer", "no_player")}` ) .setColor(client.color), ], diff --git a/src/commands/slash/Music/Forward.ts b/src/commands/slash/Music/Forward.ts index e38519a4..2f541bf5 100644 --- a/src/commands/slash/Music/Forward.ts +++ b/src/commands/slash/Music/Forward.ts @@ -77,10 +77,11 @@ export default class implements SlashCommand { if (value && !isNaN(value)) { if (song_position + value * 1000 < song!.length!) { - player["send"]({ - op: "seek", - guildId: interaction.guild!.id, - position: song_position + value * 1000, + player.send({ + guildId: String(interaction.guild?.id), + playerOptions: { + position: song_position + value * 1000, + }, }); const forward1 = new EmbedBuilder() @@ -107,10 +108,11 @@ export default class implements SlashCommand { if (!value) { if (song_position + fastForwardNum * 1000 < song!.length!) { - player["send"]({ - op: "seek", - guildId: interaction.guild!.id, - position: song_position + fastForwardNum * 1000, + player.send({ + guildId: String(interaction.guild?.id), + playerOptions: { + position: song_position + fastForwardNum * 1000, + }, }); const forward2 = new EmbedBuilder() diff --git a/src/commands/slash/Music/Lofi.ts b/src/commands/slash/Music/Lofi.ts index c213bca3..679f465a 100644 --- a/src/commands/slash/Music/Lofi.ts +++ b/src/commands/slash/Music/Lofi.ts @@ -85,7 +85,7 @@ export default class implements SlashCommand { .setDescription( `${client.i18n.get(language, "music", "radio_track", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: new ConvertTime().parse(tracks[0].length as number), request: String(tracks[0].requester), })}` @@ -96,7 +96,7 @@ export default class implements SlashCommand { const embed = new EmbedBuilder().setColor(client.color).setDescription( `${client.i18n.get(language, "music", "play_result", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: new ConvertTime().parse(tracks[0].length as number), request: String(tracks[0].requester), })}` diff --git a/src/commands/slash/Music/Loop.ts b/src/commands/slash/Music/Loop.ts index 36f84eb1..bec80973 100644 --- a/src/commands/slash/Music/Loop.ts +++ b/src/commands/slash/Music/Loop.ts @@ -8,7 +8,7 @@ import { import { Manager } from "../../../manager.js"; import { KazagumoLoop } from "../../../@types/Lavalink.js"; import { Accessableby, SlashCommand } from "../../../@types/Command.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; export default class implements SlashCommand { diff --git a/src/commands/slash/Music/LoopQueue.ts b/src/commands/slash/Music/LoopQueue.ts index 4040bd0f..e61872e3 100644 --- a/src/commands/slash/Music/LoopQueue.ts +++ b/src/commands/slash/Music/LoopQueue.ts @@ -1,7 +1,7 @@ import { EmbedBuilder, CommandInteraction, GuildMember } from "discord.js"; import { Manager } from "../../../manager.js"; import { Accessableby, SlashCommand } from "../../../@types/Command.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { KazagumoLoop } from "../../../@types/Lavalink.js"; import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; diff --git a/src/commands/slash/Music/Play.ts b/src/commands/slash/Music/Play.ts index 45326ca0..281e8d7f 100644 --- a/src/commands/slash/Music/Play.ts +++ b/src/commands/slash/Music/Play.ts @@ -12,7 +12,10 @@ import { ConvertTime } from "../../../structures/ConvertTime.js"; import { StartQueueDuration } from "../../../structures/QueueDuration.js"; import { Manager } from "../../../manager.js"; import { Accessableby, SlashCommand } from "../../../@types/Command.js"; -import { AutocompleteInteractionChoices, GlobalInteraction } from "../../../@types/Interaction.js"; +import { + AutocompleteInteractionChoices, + GlobalInteraction, +} from "../../../@types/Interaction.js"; export default class implements SlashCommand { name = ["play"]; @@ -84,7 +87,7 @@ export default class implements SlashCommand { }); } else if ( player && - !this.checkSameVoice(interaction) + !this.checkSameVoice(interaction, client, language, msg) ) { msg.edit({ embeds: [ @@ -139,7 +142,7 @@ export default class implements SlashCommand { .setDescription( `${client.i18n.get(language, "music", "play_track", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: new ConvertTime().parse(tracks[0].length as number), request: String(tracks[0].requester), })}` @@ -166,7 +169,7 @@ export default class implements SlashCommand { .setDescription( `${client.i18n.get(language, "music", "play_result", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: new ConvertTime().parse(tracks[0].length as number), request: String(tracks[0].requester), })}` @@ -177,29 +180,46 @@ export default class implements SlashCommand { } catch (e) {} } - private checkSameVoice( + checkSameVoice( interaction: CommandInteraction, + client: Manager, + language: string, + msg: Message ) { - return (interaction.member as GuildMember)!.voice.channel !== + if ( + (interaction.member as GuildMember)!.voice.channel !== interaction.guild!.members.me!.voice.channel - ) + ) { + msg.edit({ + embeds: [ + new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "noplayer", "no_voice")}` + ) + .setColor(client.color), + ], + }); + return false; + } + + return true; } // Autocomplete function async autocomplete( client: Manager, interaction: GlobalInteraction, - language: string, + language: string ) { let choice: AutocompleteInteractionChoices[] = []; - const url = String((interaction as CommandInteraction).options.get( - "search" - )!.value); + const url = String( + (interaction as CommandInteraction).options.get("search")!.value + ); const Random = - client.config.lavalink.DEFAULT[ - Math.floor(Math.random() * client.config.lavalink.DEFAULT.length) - ]; + client.config.lavalink.DEFAULT[ + Math.floor(Math.random() * client.config.lavalink.DEFAULT.length) + ]; const match = client.REGEX.some((match) => { return match.test(url) == true; diff --git a/src/commands/slash/Music/Previous.ts b/src/commands/slash/Music/Previous.ts index 01a0bcd7..a2cbabb9 100644 --- a/src/commands/slash/Music/Previous.ts +++ b/src/commands/slash/Music/Previous.ts @@ -63,7 +63,7 @@ export default class implements SlashCommand { ], }); - await player.queue.unshift(player.queue.previous); + await player.queue.unshift(player.queue.previous[0]); await player.skip(); const embed = new EmbedBuilder() diff --git a/src/commands/slash/Music/Queue.ts b/src/commands/slash/Music/Queue.ts index b5954d66..3134237a 100644 --- a/src/commands/slash/Music/Queue.ts +++ b/src/commands/slash/Music/Queue.ts @@ -106,7 +106,7 @@ export default class implements SlashCommand { .setDescription( `${client.i18n.get(language, "music", "queue_description", { title: song!.title, - url: song!.uri, + url: String(song!.uri), request: String(song!.requester), duration: new FormatDuration().parse(song!.length), rest: str == "" ? " Nothing" : "\n" + str, diff --git a/src/commands/slash/Music/Radio.ts b/src/commands/slash/Music/Radio.ts index dc2aaa0a..ff6506fd 100644 --- a/src/commands/slash/Music/Radio.ts +++ b/src/commands/slash/Music/Radio.ts @@ -273,7 +273,7 @@ export default class implements SlashCommand { .setDescription( `${client.i18n.get(language, "music", "play_track", { title: args2[0], - url: res.tracks[0].uri, + url: String(res.tracks[0].uri), duration: new ConvertTime().parse(res.tracks[0].length as number), request: String(res.tracks[0].requester), })}` diff --git a/src/commands/slash/Music/Remove.ts b/src/commands/slash/Music/Remove.ts index 6e17a00d..edbc6abf 100644 --- a/src/commands/slash/Music/Remove.ts +++ b/src/commands/slash/Music/Remove.ts @@ -99,7 +99,7 @@ export default class implements SlashCommand { .setDescription( `${client.i18n.get(language, "music", "removetrack_desc", { name: song.title, - url: song.uri, + url: String(song.uri), duration: new ConvertTime().parse(song.length as number), request: String(song.requester), })}` diff --git a/src/commands/slash/Music/RemoveDuplicate.ts b/src/commands/slash/Music/RemoveDuplicate.ts index fee6f533..9d99c94a 100644 --- a/src/commands/slash/Music/RemoveDuplicate.ts +++ b/src/commands/slash/Music/RemoveDuplicate.ts @@ -1,6 +1,6 @@ import { EmbedBuilder, CommandInteraction, GuildMember } from "discord.js"; import { Manager } from "../../../manager.js"; -import { KazagumoTrack } from "better-kazagumo"; +import { KazagumoTrack } from "kazagumo.mod"; import { Accessableby, CommandOptionInterface, diff --git a/src/commands/slash/Music/Replay.ts b/src/commands/slash/Music/Replay.ts index 2dc778f1..46abdd37 100644 --- a/src/commands/slash/Music/Replay.ts +++ b/src/commands/slash/Music/Replay.ts @@ -57,10 +57,11 @@ export default class implements SlashCommand { ], }); - await player["send"]({ - op: "seek", + await player.send({ guildId: interaction.guild!.id, - position: 0, + playerOptions: { + position: 0, + }, }); const embed = new EmbedBuilder() diff --git a/src/commands/slash/Music/Rewind.ts b/src/commands/slash/Music/Rewind.ts index 51e12b7c..c43d7465 100644 --- a/src/commands/slash/Music/Rewind.ts +++ b/src/commands/slash/Music/Rewind.ts @@ -77,10 +77,11 @@ export default class implements SlashCommand { if (value && !isNaN(value)) { if (song_position - value * 1000 > 0) { - await player["send"]({ - op: "seek", + await player.send({ guildId: interaction.guild!.id, - position: song_position - value * 1000, + playerOptions: { + position: song_position - value * 1000, + }, }); const rewind1 = new EmbedBuilder() @@ -119,10 +120,11 @@ export default class implements SlashCommand { if (!value) { if (song_position - rewindNum * 1000 > 0) { - await player["send"]({ - op: "seek", + await player.send({ guildId: interaction.guild!.id, - position: song_position - rewindNum * 1000, + playerOptions: { + position: song_position - rewindNum * 1000, + }, }); const rewind2 = new EmbedBuilder() diff --git a/src/commands/slash/Music/Volume.ts b/src/commands/slash/Music/Volume.ts index 1c58d4ed..15595d04 100644 --- a/src/commands/slash/Music/Volume.ts +++ b/src/commands/slash/Music/Volume.ts @@ -7,7 +7,7 @@ import { } from "discord.js"; import { Manager } from "../../../manager.js"; import { Accessableby, SlashCommand } from "../../../@types/Command.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; // Main code diff --git a/src/commands/slash/Playlist/Add.ts b/src/commands/slash/Playlist/Add.ts index 652d6d41..ea4303d4 100644 --- a/src/commands/slash/Playlist/Add.ts +++ b/src/commands/slash/Playlist/Add.ts @@ -7,10 +7,13 @@ import { } from "discord.js"; import { ConvertTime } from "../../../structures/ConvertTime.js"; import { StartQueueDuration } from "../../../structures/QueueDuration.js"; -import { KazagumoTrack } from "better-kazagumo"; +import { KazagumoTrack } from "kazagumo.mod"; import { Manager } from "../../../manager.js"; import { Accessableby, SlashCommand } from "../../../@types/Command.js"; -import { AutocompleteInteractionChoices, GlobalInteraction } from "../../../@types/Interaction.js"; +import { + AutocompleteInteractionChoices, + GlobalInteraction, +} from "../../../@types/Interaction.js"; const TrackAdd: KazagumoTrack[] = []; @@ -106,7 +109,7 @@ export default class implements SlashCommand { .setDescription( `${client.i18n.get(language, "playlist", "add_track", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: Duration, user: String(interaction.user), })}` @@ -118,7 +121,7 @@ export default class implements SlashCommand { .setDescription( `${client.i18n.get(language, "playlist", "add_search", { title: tracks[0].title, - url: tracks[0].uri, + url: String(tracks[0].uri), duration: Duration, user: String(interaction.user), })}` @@ -213,17 +216,17 @@ export default class implements SlashCommand { async autocomplete( client: Manager, interaction: GlobalInteraction, - language: string, + language: string ) { let choice: AutocompleteInteractionChoices[] = []; - const url = String((interaction as CommandInteraction).options.get( - "search" - )!.value); + const url = String( + (interaction as CommandInteraction).options.get("search")!.value + ); const Random = - client.config.lavalink.DEFAULT[ - Math.floor(Math.random() * client.config.lavalink.DEFAULT.length) - ]; + client.config.lavalink.DEFAULT[ + Math.floor(Math.random() * client.config.lavalink.DEFAULT.length) + ]; const match = client.REGEX.some((match) => { return match.test(url) == true; diff --git a/src/commands/slash/Playlist/SaveQueue.ts b/src/commands/slash/Playlist/SaveQueue.ts index 50cfca0c..53ffca09 100644 --- a/src/commands/slash/Playlist/SaveQueue.ts +++ b/src/commands/slash/Playlist/SaveQueue.ts @@ -1,4 +1,4 @@ -import { KazagumoTrack } from "better-kazagumo"; +import { KazagumoTrack } from "kazagumo.mod"; import { EmbedBuilder, ApplicationCommandOptionType, @@ -112,7 +112,9 @@ export default class implements SlashCommand { const element = playlist.tracks[i].uri; TrackExist.push(element); } - Result = TrackAdd.filter((track) => !TrackExist.includes(track.uri)); + Result = TrackAdd.filter( + (track) => !TrackExist.includes(String(track.uri)) + ); } if (Result!.length == 0) { diff --git a/src/database/build/AutoReconnect.ts b/src/database/build/AutoReconnect.ts index c1e27c9b..f5340e18 100644 --- a/src/database/build/AutoReconnect.ts +++ b/src/database/build/AutoReconnect.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { Manager } from "../../manager.js"; export class AutoReconnectBuilder { diff --git a/src/database/schema/AutoReconnect.ts b/src/database/schema/AutoReconnect.ts index 451b6ac6..b9a71153 100644 --- a/src/database/schema/AutoReconnect.ts +++ b/src/database/schema/AutoReconnect.ts @@ -1,4 +1,4 @@ -import { KazagumoTrack } from "better-kazagumo"; +import { KazagumoTrack } from "kazagumo.mod"; export interface AutoReconnect { guild: string; diff --git a/src/database/setup/lavalink.ts b/src/database/setup/lavalink.ts index a596a11f..ba9e072c 100644 --- a/src/database/setup/lavalink.ts +++ b/src/database/setup/lavalink.ts @@ -3,7 +3,7 @@ import { Manager } from "../../manager.js"; import { AutoReconnect } from "../schema/AutoReconnect.js"; import chillout from "chillout"; import { KazagumoLoopMode } from "../../@types/Lavalink.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; export class AutoReconnectLavalinkService { client: Manager; diff --git a/src/events/guild/interactionCreate.ts b/src/events/guild/interactionCreate.ts index d496a22f..ed7e82c0 100644 --- a/src/events/guild/interactionCreate.ts +++ b/src/events/guild/interactionCreate.ts @@ -86,7 +86,8 @@ export default class { if ( Number(interaction.type) == - InteractionType.ApplicationCommandAutocomplete && (command as any).autocomplete !== undefined + InteractionType.ApplicationCommandAutocomplete && + (command as any).autocomplete !== undefined ) { try { (command as any).autocomplete(client, interaction, language); @@ -96,7 +97,7 @@ export default class { message: error, }); } - return + return; } const msg_cmd = [ diff --git a/src/events/node/disconnect.ts b/src/events/node/disconnect.ts index f0ebadbd..641b7190 100644 --- a/src/events/node/disconnect.ts +++ b/src/events/node/disconnect.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { Manager } from "../../manager.js"; import { autofixLavalink } from "../../lavaScrap/autofixLavalink.js"; diff --git a/src/events/player/playerCreate.ts b/src/events/player/playerCreate.ts index 2b8cec1c..13e88c5a 100644 --- a/src/events/player/playerCreate.ts +++ b/src/events/player/playerCreate.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { Manager } from "../../manager.js"; export default class { diff --git a/src/events/player/playerDestroy.ts b/src/events/player/playerDestroy.ts index 2c81c67f..5eff39c7 100644 --- a/src/events/player/playerDestroy.ts +++ b/src/events/player/playerDestroy.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { Manager } from "../../manager.js"; import { EmbedBuilder, Client, TextChannel } from "discord.js"; import { ClearMessageService } from "../../functions/clearMsg.js"; diff --git a/src/events/player/playerEmpty.ts b/src/events/player/playerEmpty.ts index deb29a63..e3de4d40 100644 --- a/src/events/player/playerEmpty.ts +++ b/src/events/player/playerEmpty.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { Manager } from "../../manager.js"; export default class { diff --git a/src/events/player/playerEnd.ts b/src/events/player/playerEnd.ts index 5ef3b2bb..fa58a76d 100644 --- a/src/events/player/playerEnd.ts +++ b/src/events/player/playerEnd.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { Manager } from "../../manager.js"; import { EmbedBuilder, Client, TextChannel } from "discord.js"; import { ClearMessageService } from "../../functions/clearMsg.js"; @@ -19,7 +19,7 @@ export default class { /////////// Update Music Setup /////////// if (client.websocket) { - const song = player.queue.previous; + const song = player.queue.previous[0]; await client.websocket.send( JSON.stringify({ diff --git a/src/events/player/playerException.ts b/src/events/player/playerException.ts index 9ca4a36a..2b2da908 100644 --- a/src/events/player/playerException.ts +++ b/src/events/player/playerException.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { Manager } from "../../manager.js"; import { TrackExceptionEvent } from "shoukaku"; import { TextChannel } from "discord.js"; diff --git a/src/events/player/playerMoved.ts b/src/events/player/playerMoved.ts index 7e436cb4..dd92e96c 100644 --- a/src/events/player/playerMoved.ts +++ b/src/events/player/playerMoved.ts @@ -2,7 +2,7 @@ import { KazagumoPlayer, PlayerMovedChannels, PlayerMovedState, -} from "better-kazagumo"; +} from "kazagumo.mod"; import { Manager } from "../../manager.js"; export default class { diff --git a/src/events/player/playerResolveError.ts b/src/events/player/playerResolveError.ts index 904b7425..03ecef8f 100644 --- a/src/events/player/playerResolveError.ts +++ b/src/events/player/playerResolveError.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer, KazagumoTrack } from "better-kazagumo"; +import { KazagumoPlayer, KazagumoTrack } from "kazagumo.mod"; import { Manager } from "../../manager.js"; import { TextChannel, EmbedBuilder } from "discord.js"; diff --git a/src/events/player/playerResumed.ts b/src/events/player/playerResumed.ts index 17956098..7f218ffc 100644 --- a/src/events/player/playerResumed.ts +++ b/src/events/player/playerResumed.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { Manager } from "../../manager.js"; export default class { diff --git a/src/events/player/playerStart.ts b/src/events/player/playerStart.ts index c9e451ed..843ad633 100644 --- a/src/events/player/playerStart.ts +++ b/src/events/player/playerStart.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer, KazagumoTrack } from "better-kazagumo"; +import { KazagumoPlayer, KazagumoTrack } from "kazagumo.mod"; import { Manager } from "../../manager.js"; import { AttachmentBuilder, @@ -443,10 +443,11 @@ export default class { if (!player) { collector.stop(); } - await player["send"]({ - op: "seek", + await player.send({ guildId: message.guild!.id, - position: 0, + playerOptions: { + position: 0, + }, }); await new ReplyInteractionService( @@ -495,7 +496,7 @@ export default class { .setDescription( `${client.i18n.get(language, "player", "queue_description", { track: song!.title, - track_url: song!.uri, + track_url: String(song!.uri), duration: new FormatDuration().parse(position), requester: `${song!.requester}`, list_song: str == "" ? " Nothing" : "\n" + str, diff --git a/src/events/player/playerStuck.ts b/src/events/player/playerStuck.ts index 87152cfd..e33c7b1b 100644 --- a/src/events/player/playerStuck.ts +++ b/src/events/player/playerStuck.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { Manager } from "../../manager.js"; import { TextChannel, EmbedBuilder } from "discord.js"; import { TrackStuckEvent } from "shoukaku"; diff --git a/src/events/player/playerUpdate.ts b/src/events/player/playerUpdate.ts index f58810fb..6f99a61e 100644 --- a/src/events/player/playerUpdate.ts +++ b/src/events/player/playerUpdate.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { Manager } from "../../manager.js"; import { PlayerUpdate } from "shoukaku"; diff --git a/src/functions/clearMsg.ts b/src/functions/clearMsg.ts index 65f98ee8..0c47d3af 100644 --- a/src/functions/clearMsg.ts +++ b/src/functions/clearMsg.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { Manager } from "../manager.js"; import { TextChannel } from "discord.js"; diff --git a/src/handlers/Player/ButtonCommands/Loop.ts b/src/handlers/Player/ButtonCommands/Loop.ts index 61ba37f8..cfc32803 100644 --- a/src/handlers/Player/ButtonCommands/Loop.ts +++ b/src/handlers/Player/ButtonCommands/Loop.ts @@ -1,6 +1,6 @@ import { ButtonInteraction, EmbedBuilder, VoiceBasedChannel } from "discord.js"; import { Manager } from "../../../manager.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; import { KazagumoLoop } from "../../../@types/Lavalink.js"; import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; diff --git a/src/handlers/Player/ButtonCommands/Pause.ts b/src/handlers/Player/ButtonCommands/Pause.ts index 428a5ada..e0c0e981 100644 --- a/src/handlers/Player/ButtonCommands/Pause.ts +++ b/src/handlers/Player/ButtonCommands/Pause.ts @@ -5,7 +5,7 @@ import { VoiceBasedChannel, } from "discord.js"; import { Manager } from "../../../manager.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; export class ButtonPause { client: Manager; diff --git a/src/handlers/Player/ButtonCommands/Previous.ts b/src/handlers/Player/ButtonCommands/Previous.ts index a518e4d9..1a3cf807 100644 --- a/src/handlers/Player/ButtonCommands/Previous.ts +++ b/src/handlers/Player/ButtonCommands/Previous.ts @@ -1,6 +1,6 @@ import { ButtonInteraction, EmbedBuilder, VoiceBasedChannel } from "discord.js"; import { Manager } from "../../../manager.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; export class ButtonPrevious { client: Manager; @@ -65,7 +65,7 @@ export class ButtonPrevious { }); return; } else { - await this.player.queue.unshift(this.player.queue.previous); + await this.player.queue.unshift(this.player.queue.previous[0]); await this.player.skip(); const embed = new EmbedBuilder() diff --git a/src/handlers/Player/ButtonCommands/Skip.ts b/src/handlers/Player/ButtonCommands/Skip.ts index a610e13b..e9fbe9ef 100644 --- a/src/handlers/Player/ButtonCommands/Skip.ts +++ b/src/handlers/Player/ButtonCommands/Skip.ts @@ -1,6 +1,6 @@ import { ButtonInteraction, EmbedBuilder, VoiceBasedChannel } from "discord.js"; import { Manager } from "../../../manager.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; export class ButtonSkip { client: Manager; diff --git a/src/handlers/Player/ButtonCommands/Stop.ts b/src/handlers/Player/ButtonCommands/Stop.ts index 6d90a30c..dbfad02d 100644 --- a/src/handlers/Player/ButtonCommands/Stop.ts +++ b/src/handlers/Player/ButtonCommands/Stop.ts @@ -1,6 +1,6 @@ import { ButtonInteraction, EmbedBuilder, VoiceBasedChannel } from "discord.js"; import { Manager } from "../../../manager.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; export class ButtonStop { client: Manager; diff --git a/src/handlers/Player/loadContent.ts b/src/handlers/Player/loadContent.ts index ffafa9d6..69547794 100644 --- a/src/handlers/Player/loadContent.ts +++ b/src/handlers/Player/loadContent.ts @@ -203,7 +203,7 @@ export class playerLoadContent { .setDescription( `${client.i18n.get(language, "music", "play_playlist", { title: result.tracks[0].title, - url: result.tracks[0].uri, + url: String(result.tracks[0].uri), duration: new ConvertTime().parse(TotalDuration), songs: `${result.tracks.length}`, request: `${result.tracks[0].requester}`, @@ -217,7 +217,7 @@ export class playerLoadContent { .setDescription( `${client.i18n.get(language, "music", "play_track", { title: result.tracks[0].title, - url: result.tracks[0].uri, + url: String(result.tracks[0].uri), duration: new ConvertTime().parse( result.tracks[0].length as number ), @@ -231,7 +231,7 @@ export class playerLoadContent { const embed = new EmbedBuilder().setColor(client.color).setDescription( `${client.i18n.get(language, "music", "play_result", { title: result.tracks[0].title, - url: result.tracks[0].uri, + url: String(result.tracks[0].uri), duration: new ConvertTime().parse(result.tracks[0].length as number), request: `${result.tracks[0].requester}`, })}` diff --git a/src/handlers/Player/loadUpdate.ts b/src/handlers/Player/loadUpdate.ts index 6bc2b979..972b15c7 100644 --- a/src/handlers/Player/loadUpdate.ts +++ b/src/handlers/Player/loadUpdate.ts @@ -2,7 +2,7 @@ import { Manager } from "../../manager.js"; import { EmbedBuilder, TextChannel } from "discord.js"; import { FormatDuration } from "../../structures/FormatDuration.js"; import { QueueDuration } from "../../structures/QueueDuration.js"; -import { KazagumoPlayer } from "better-kazagumo"; +import { KazagumoPlayer } from "kazagumo.mod"; export class playerLoadUpdate { client: Manager; @@ -77,7 +77,7 @@ export class playerLoadUpdate { .setDescription( `${client.i18n.get(language, "setup", "setup_desc", { title: cSong!.title, - url: cSong!.uri, + url: String(cSong!.uri), duration: new FormatDuration().parse(cSong!.length), request: `${cSong!.requester}`, })}` diff --git a/src/manager.ts b/src/manager.ts index 397e99aa..6cb03d82 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -14,7 +14,7 @@ import { LavalinkDataType, LavalinkUsingDataType } from "./@types/Lavalink.js"; import { ConfigDataService } from "./services/ConfigDataService.js"; import { LoggerService } from "./services/LoggerService.js"; import { ClusterClient, getInfo } from "discord-hybrid-sharding"; -import { Kazagumo, KazagumoPlayer } from "better-kazagumo"; +import { Kazagumo, KazagumoPlayer } from "kazagumo.mod"; import { join, dirname } from "path"; import { fileURLToPath } from "url"; import { WebServer } from "./webserver/index.js"; @@ -128,7 +128,7 @@ export class Manager extends Client { }); this.prefix = this.config.features.MESSAGE_CONTENT.commands.prefix || "d!"; this.shard_status = false; - this.REGEX = REGEX + this.REGEX = REGEX; // Initial autofix lavalink varibles this.lavalink_list = []; diff --git a/src/manifest.xml b/src/manifest.xml index 8800bc2d..761eed73 100644 --- a/src/manifest.xml +++ b/src/manifest.xml @@ -7,7 +7,7 @@ - 3.2.0 + 4.0.0 4.1.0 hatsuharu (AzurLane) diff --git a/src/structures/Kazagumo.ts b/src/structures/Kazagumo.ts index 72f73dd2..68a1c7f3 100644 --- a/src/structures/Kazagumo.ts +++ b/src/structures/Kazagumo.ts @@ -1,4 +1,4 @@ -import { Kazagumo, Plugins } from "better-kazagumo"; +import { Kazagumo, Plugins } from "kazagumo.mod"; import { Manager } from "../manager.js"; import { Connectors } from "shoukaku"; diff --git a/src/structures/QueueDuration.ts b/src/structures/QueueDuration.ts index 6fc2712c..902c55c5 100644 --- a/src/structures/QueueDuration.ts +++ b/src/structures/QueueDuration.ts @@ -1,4 +1,4 @@ -import { KazagumoPlayer, KazagumoTrack } from "better-kazagumo"; +import { KazagumoPlayer, KazagumoTrack } from "kazagumo.mod"; export class QueueDuration { parse(player: KazagumoPlayer) { diff --git a/src/webserver/request/Previous.ts b/src/webserver/request/Previous.ts index 35871f0c..f8b8fb37 100644 --- a/src/webserver/request/Previous.ts +++ b/src/webserver/request/Previous.ts @@ -19,7 +19,7 @@ export default class implements RequestInterface { ); } - const song = player.queue.previous; + const song = player.queue.previous[0]; if (!song) return ws.send( diff --git a/src/webserver/request/status.current.ts b/src/webserver/request/status.current.ts index b1bfd8ba..4d7bd5af 100644 --- a/src/webserver/request/status.current.ts +++ b/src/webserver/request/status.current.ts @@ -20,7 +20,7 @@ export default class implements RequestInterface { player.queue.forEach((track) => { webqueue.push({ title: track.title, - uri: track.uri, + uri: String(track.uri), length: track.length, thumbnail: track.thumbnail, author: track.author, diff --git a/src/webserver/request/status.ts b/src/webserver/request/status.ts index 65f413fc..28bc0b41 100644 --- a/src/webserver/request/status.ts +++ b/src/webserver/request/status.ts @@ -36,7 +36,7 @@ export default class implements RequestInterface { player.queue.forEach((track) => { webqueue.push({ title: track.title, - uri: track.uri, + uri: String(track.uri), length: track.length, thumbnail: track.thumbnail, author: track.author, @@ -46,7 +46,7 @@ export default class implements RequestInterface { await webqueue.unshift({ title: song!.title, - uri: song!.uri, + uri: String(song!.uri), length: song!.length, thumbnail: song!.thumbnail, author: song!.author,