use audioonly

This commit is contained in:
Mylloon 2023-02-05 00:46:09 +01:00
parent b9ddfc5c22
commit ddd277907c
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
6 changed files with 22 additions and 14 deletions

View file

@ -95,6 +95,8 @@ export default {
queue.play(track);
return await interaction.followUp({ content: `⏱️ | Chargement de \`${track.title}\`...` });
return await interaction.followUp({
content: `⏱️ | \`${track.title}\` ajouté à la file d'attente`,
});
},
};

View file

@ -30,15 +30,15 @@ export default async (client: Client) => {
if (event_category == "player") {
if (once) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return client.player.once(event_type as keyof PlayerEvents, (...args: any) =>
execute(...args, client)
);
// eslint-disable-next-line
return client.player.once(event_type as keyof PlayerEvents, (...args: any[]) => {
execute(...args, client);
});
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return client.player.on(event_type as keyof PlayerEvents, (...args: any) =>
execute(...args, client)
);
// eslint-disable-next-line
return client.player.on(event_type as keyof PlayerEvents, (...args: any[]) => {
execute(...args, client);
});
}
if (once) {

View file

@ -1,6 +1,7 @@
import { Queue } from "discord-player";
import { Metadata } from "../../modules/metadata";
/** https://discord-player.js.org/docs/main/master/typedef/PlayerEvents */
export default async (_: Queue, error: Error) => {
export default (_: Queue<Metadata>, error: Error) => {
console.error(error);
};

View file

@ -1,6 +1,7 @@
import { Queue } from "discord-player";
import { Metadata } from "../../modules/metadata";
/** https://discord-player.js.org/docs/main/master/typedef/PlayerEvents */
export default async (_: Queue, error: Error) => {
export default (_: Queue<Metadata>, error: Error) => {
console.error(error);
};

View file

@ -2,6 +2,6 @@ import { Queue, Track } from "discord-player";
import { Metadata } from "../../modules/metadata";
/** https://discord-player.js.org/docs/main/master/typedef/PlayerEvents */
export default async (queue: Queue, track: Track) => {
(queue.metadata as Metadata).channel?.send(`🎶 | Joue \`${track.title}\`.`);
export default (queue: Queue<Metadata>, track: Track) => {
queue.metadata?.channel?.send(`🎶 | Joue \`${track.title}\` demandé par ${track.requestedBy}.`);
};

View file

@ -37,7 +37,11 @@ export default async () => {
list: new Collection(),
};
client.player = new Player(client);
client.player = new Player(client, {
ytdlOptions: {
filter: "audioonly",
},
});
console.log("Translations progression :");
client.locales = await loadLocales(client.config.default_lang);