update packages

This commit is contained in:
Jonny_Bro (Nikita) 2024-07-21 21:58:02 +05:00
parent f9f2a42d03
commit 9a8c912b3f
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8
4 changed files with 33 additions and 70 deletions

View file

@ -3,7 +3,7 @@ const { Client, Collection, SlashCommandBuilder, ContextMenuCommandBuilder, Embe
{ REST } = require("@discordjs/rest"), { REST } = require("@discordjs/rest"),
{ Player: DiscordPlayer } = require("discord-player"), { Player: DiscordPlayer } = require("discord-player"),
{ SpotifyExtractor } = require("@discord-player/extractor"), { SpotifyExtractor } = require("@discord-player/extractor"),
{ YoutubeiExtractor, createYoutubeiStream } = require("discord-player-youtubei"), { YoutubeiExtractor } = require("discord-player-youtubei"),
{ Routes } = require("discord-api-types/v10"); { Routes } = require("discord-api-types/v10");
const BaseEvent = require("./BaseEvent.js"), const BaseEvent = require("./BaseEvent.js"),
@ -43,28 +43,11 @@ class JaBaClient extends Client {
* @returns {Promise<void>} A Promise that resolves when the client is fully initialized. * @returns {Promise<void>} A Promise that resolves when the client is fully initialized.
*/ */
async init() { async init() {
this.player = new DiscordPlayer(this, { this.player = new DiscordPlayer(this);
ytdlOptions: {
requestOptions: {
headers: {
cookie: this.config.youtubeCookie,
},
},
},
});
await this.player.extractors.register(YoutubeiExtractor, { await this.player.extractors.register(YoutubeiExtractor);
// authentication: {
// access_token: process.env.YT_ACCESS_TOKEN || "",
// refresh_token: process.env.YT_REFRESH_TOKEN || "",
// scope: "https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtube-paid-content",
// token_type: "Bearer",
// expiry_date: "2024-07-10T11:37:01.093Z",
// },
});
await this.player.extractors.register(SpotifyExtractor, { await this.player.extractors.register(SpotifyExtractor, {
createStream: createYoutubeiStream,
clientId: this.config.spotify.clientId, clientId: this.config.spotify.clientId,
clientSecret: this.config.spotify.clientSecret, clientSecret: this.config.spotify.clientSecret,
}); });

View file

@ -86,7 +86,7 @@ class Play extends BaseCommand {
if (query.startsWith("http")) return interaction.respond([ { name: "Current Link", value: query } ]); if (query.startsWith("http")) return interaction.respond([ { name: "Current Link", value: query } ]);
const youtubeResults = await client.player.search(query, { searchEngine: QueryType.YOUTUBE }); const youtubeResults = await client.player.search(query, { searchEngine: QueryType.YOUTUBE });
// const spotifyResults = await client.player.search(query, { searchEngine: QueryType.SPOTIFY_SEARCH }); const spotifyResults = await client.player.search(query, { searchEngine: QueryType.SPOTIFY_SEARCH });
const tracks = []; const tracks = [];
youtubeResults.tracks youtubeResults.tracks
@ -97,13 +97,13 @@ class Play extends BaseCommand {
})) }))
.forEach(t => tracks.push({ name: t.name, value: t.value })); .forEach(t => tracks.push({ name: t.name, value: t.value }));
// spotifyResults.tracks spotifyResults.tracks
// .slice(0, 5) .slice(0, 5)
// .map(t => ({ .map(t => ({
// name: `Spotify: ${`${t.title} - ${t.author} (${t.duration})`.length > 75 ? `${`${t.title} - ${t.author}`.substring(0, 75)}... (${t.duration})` : `${t.title} - ${t.author} (${t.duration})`}`, name: `Spotify: ${`${t.title} - ${t.author} (${t.duration})`.length > 75 ? `${`${t.title} - ${t.author}`.substring(0, 75)}... (${t.duration})` : `${t.title} - ${t.author} (${t.duration})`}`,
// value: t.url, value: t.url,
// })) }))
// .forEach(t => tracks.push({ name: t.name, value: t.value })); .forEach(t => tracks.push({ name: t.name, value: t.value }));
return interaction.respond(tracks); return interaction.respond(tracks);
} }

View file

@ -8,7 +8,7 @@
}, },
"author": "@jonny_bro", "author": "@jonny_bro",
"dependencies": { "dependencies": {
"@discord-player/extractor": "^4.4.7", "@discord-player/extractor": "^4.5.0",
"@discordjs/opus": "^0.9.0", "@discordjs/opus": "^0.9.0",
"@discordjs/rest": "^2.3.0", "@discordjs/rest": "^2.3.0",
"@discordjs/voice": "^0.17.0", "@discordjs/voice": "^0.17.0",
@ -17,8 +17,8 @@
"cron": "^2.4.4", "cron": "^2.4.4",
"discord-api-types": "^0.37.92", "discord-api-types": "^0.37.92",
"discord-giveaways": "^6.0.1", "discord-giveaways": "^6.0.1",
"discord-player": "^6.6.10", "discord-player": "^6.7.0",
"discord-player-youtubei": "^1.1.10", "discord-player-youtubei": "^1.1.14",
"discord.js": "^14.15.3", "discord.js": "^14.15.3",
"gamedig": "^4.1.0", "gamedig": "^4.1.0",
"i18next": "^21.10.0", "i18next": "^21.10.0",

View file

@ -9,8 +9,8 @@ importers:
.: .:
dependencies: dependencies:
'@discord-player/extractor': '@discord-player/extractor':
specifier: ^4.4.7 specifier: ^4.5.0
version: 4.4.7 version: 4.5.0
'@discordjs/opus': '@discordjs/opus':
specifier: ^0.9.0 specifier: ^0.9.0
version: 0.9.0 version: 0.9.0
@ -36,11 +36,11 @@ importers:
specifier: ^6.0.1 specifier: ^6.0.1
version: 6.0.1(discord.js@14.15.3) version: 6.0.1(discord.js@14.15.3)
discord-player: discord-player:
specifier: ^6.6.10 specifier: ^6.7.0
version: 6.6.10(@discord-player/extractor@4.4.7)(@discordjs/opus@0.9.0) version: 6.7.0(@discord-player/extractor@4.5.0)(@discordjs/opus@0.9.0)
discord-player-youtubei: discord-player-youtubei:
specifier: ^1.1.10 specifier: ^1.1.14
version: 1.1.10 version: 1.1.14
discord.js: discord.js:
specifier: ^14.15.3 specifier: ^14.15.3
version: 14.15.3 version: 14.15.3
@ -89,8 +89,8 @@ packages:
'@discord-player/equalizer@0.2.3': '@discord-player/equalizer@0.2.3':
resolution: {integrity: sha512-71UAepYMbHTg2QQLXQAgyuXYHrgAYpJDxjg9dRWfTUNf+zfOAlyJEiRRk/WFhQyGu6m23iLR/H/JxgF4AW8Csg==} resolution: {integrity: sha512-71UAepYMbHTg2QQLXQAgyuXYHrgAYpJDxjg9dRWfTUNf+zfOAlyJEiRRk/WFhQyGu6m23iLR/H/JxgF4AW8Csg==}
'@discord-player/extractor@4.4.7': '@discord-player/extractor@4.5.0':
resolution: {integrity: sha512-XHG9Y45rQVWk3quf0IJqAj1ybTqiRgAy6vr5hnlaDZeaxXlsHRlDSzmSYl+teFVw2G9bjzR0jIvm8a4BW9hCBw==} resolution: {integrity: sha512-7yCvNNMbRIkFewli/ILcbFe9FX8DaTFTajn6ouJ/+76NzjoPsPNGRNmDT6eP69t/DJJrZFhsghyGGmxDKNBo6A==}
'@discord-player/ffmpeg@0.1.0': '@discord-player/ffmpeg@0.1.0':
resolution: {integrity: sha512-0kW6q4gMQN2B4Z4EzmUgXrKQSXXmyhjdZBBZ/6jSHZ9fh814oOu+JXP01VvtWHwTylI7qJHIctEWtSyjEubCJg==} resolution: {integrity: sha512-0kW6q4gMQN2B4Z4EzmUgXrKQSXXmyhjdZBBZ/6jSHZ9fh814oOu+JXP01VvtWHwTylI7qJHIctEWtSyjEubCJg==}
@ -474,14 +474,14 @@ packages:
peerDependencies: peerDependencies:
discord.js: '>=14.0.0' discord.js: '>=14.0.0'
discord-player-youtubei@1.1.10: discord-player-youtubei@1.1.14:
resolution: {integrity: sha512-6ueEViUB4GQ1djQG/IZnWdGwdViJeMFmJteD8QVa+XiztoEkAPlmqpcxia4PDbkFGIrjGmYYFVnVFl+PJSZoAg==} resolution: {integrity: sha512-W+eaemsDABUEWiYu0O1WFs8QgBy7b/ZO7+PVX0NZdo8vpIIxodalv6ZA7w9WfSz2YlQnvlSVXGabYodEz4vrkA==}
hasBin: true hasBin: true
discord-player@6.6.10: discord-player@6.7.0:
resolution: {integrity: sha512-AOZnJYXOoe2hF2OENwKUIaKJ2H5U8VfxcoMKDXE++9Rnbzd7qD8MQr9Am01T1UiiPf2BWjyHin97EUm1nrTJKA==} resolution: {integrity: sha512-ioSDZo3IreTi9B5ZRKca0Vh2FPbHjM25D4RoXTwhf6ULaGJEMMpi+GAyDPtzFGHbvIO0Fs/pnNcKtehICsODzg==}
peerDependencies: peerDependencies:
'@discord-player/extractor': ^4.4.7 '@discord-player/extractor': ^4.5.0
discord-voip@0.1.3: discord-voip@0.1.3:
resolution: {integrity: sha512-9DWY5/BLPXeldVwPr8/ggGjggTYOTw77aGQc3+4n5K54bRbbiJ9DUJc+mJzDiSLoHN3f286eRGACJYtrUu27xA==} resolution: {integrity: sha512-9DWY5/BLPXeldVwPr8/ggGjggTYOTw77aGQc3+4n5K54bRbbiJ9DUJc+mJzDiSLoHN3f286eRGACJYtrUu27xA==}
@ -1210,10 +1210,6 @@ packages:
resolution: {integrity: sha512-Q2rtqmZWrbP8nePMq7mOJIN98M0fYvSgV89vwl/BQRT4mDOeY2GXZngfGpcBBhtky3woM7G24wZV3Q304Bv6cw==} resolution: {integrity: sha512-Q2rtqmZWrbP8nePMq7mOJIN98M0fYvSgV89vwl/BQRT4mDOeY2GXZngfGpcBBhtky3woM7G24wZV3Q304Bv6cw==}
engines: {node: '>=18.0'} engines: {node: '>=18.0'}
undici@6.15.0:
resolution: {integrity: sha512-VviMt2tlMg1BvQ0FKXxrz1eJuyrcISrL2sPfBf7ZskX/FCEc/7LeThQaoygsMJpNqrATWQIsRVx+1Dpe4jaYuQ==}
engines: {node: '>=18.17'}
undici@6.19.2: undici@6.19.2:
resolution: {integrity: sha512-JfjKqIauur3Q6biAtHJ564e3bWa8VvT+7cSiOJHFbX4Erv6CLGDpg8z+Fmg/1OI/47RA+GI2QZaF48SSaLvyBA==} resolution: {integrity: sha512-JfjKqIauur3Q6biAtHJ564e3bWa8VvT+7cSiOJHFbX4Erv6CLGDpg8z+Fmg/1OI/47RA+GI2QZaF48SSaLvyBA==}
engines: {node: '>=18.17'} engines: {node: '>=18.17'}
@ -1259,18 +1255,6 @@ packages:
wrappy@1.0.2: wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
ws@8.14.2:
resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: '>=5.0.2'
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
ws@8.17.1: ws@8.17.1:
resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==}
engines: {node: '>=10.0.0'} engines: {node: '>=10.0.0'}
@ -1318,7 +1302,7 @@ snapshots:
'@discord-player/equalizer@0.2.3': {} '@discord-player/equalizer@0.2.3': {}
'@discord-player/extractor@4.4.7': '@discord-player/extractor@4.5.0':
dependencies: dependencies:
file-type: 16.5.4 file-type: 16.5.4
genius-lyrics: 4.4.7 genius-lyrics: 4.4.7
@ -1723,15 +1707,15 @@ snapshots:
discord.js: 14.15.3 discord.js: 14.15.3
serialize-javascript: 6.0.1 serialize-javascript: 6.0.1
discord-player-youtubei@1.1.10: discord-player-youtubei@1.1.14:
dependencies: dependencies:
undici: 6.19.2 undici: 6.19.2
youtubei.js: 10.1.0 youtubei.js: 10.1.0
discord-player@6.6.10(@discord-player/extractor@4.4.7)(@discordjs/opus@0.9.0): discord-player@6.7.0(@discord-player/extractor@4.5.0)(@discordjs/opus@0.9.0):
dependencies: dependencies:
'@discord-player/equalizer': 0.2.3 '@discord-player/equalizer': 0.2.3
'@discord-player/extractor': 4.4.7 '@discord-player/extractor': 4.5.0
'@discord-player/ffmpeg': 0.1.0 '@discord-player/ffmpeg': 0.1.0
'@discord-player/utils': 0.2.2 '@discord-player/utils': 0.2.2
'@web-scrobbler/metadata-filter': 3.1.0 '@web-scrobbler/metadata-filter': 3.1.0
@ -1754,7 +1738,7 @@ snapshots:
discord-api-types: 0.37.92 discord-api-types: 0.37.92
prism-media: 1.3.5(@discordjs/opus@0.9.0) prism-media: 1.3.5(@discordjs/opus@0.9.0)
tslib: 2.6.2 tslib: 2.6.2
ws: 8.14.2 ws: 8.17.1
transitivePeerDependencies: transitivePeerDependencies:
- '@discordjs/opus' - '@discordjs/opus'
- bufferutil - bufferutil
@ -1964,7 +1948,7 @@ snapshots:
genius-lyrics@4.4.7: genius-lyrics@4.4.7:
dependencies: dependencies:
node-html-parser: 6.1.13 node-html-parser: 6.1.13
undici: 6.15.0 undici: 6.19.2
get-stream@6.0.1: {} get-stream@6.0.1: {}
@ -2513,8 +2497,6 @@ snapshots:
undici@6.13.0: {} undici@6.13.0: {}
undici@6.15.0: {}
undici@6.19.2: {} undici@6.19.2: {}
unfetch@5.0.0: {} unfetch@5.0.0: {}
@ -2553,8 +2535,6 @@ snapshots:
wrappy@1.0.2: {} wrappy@1.0.2: {}
ws@8.14.2: {}
ws@8.17.1: {} ws@8.17.1: {}
xmlbuilder@8.2.2: {} xmlbuilder@8.2.2: {}