use audioonly
This commit is contained in:
parent
b9ddfc5c22
commit
ddd277907c
6 changed files with 22 additions and 14 deletions
|
@ -95,6 +95,8 @@ export default {
|
||||||
|
|
||||||
queue.play(track);
|
queue.play(track);
|
||||||
|
|
||||||
return await interaction.followUp({ content: `⏱️ | Chargement de \`${track.title}\`...` });
|
return await interaction.followUp({
|
||||||
|
content: `⏱️ | \`${track.title}\` ajouté à la file d'attente`,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,15 +30,15 @@ export default async (client: Client) => {
|
||||||
|
|
||||||
if (event_category == "player") {
|
if (event_category == "player") {
|
||||||
if (once) {
|
if (once) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line
|
||||||
return client.player.once(event_type as keyof PlayerEvents, (...args: any) =>
|
return client.player.once(event_type as keyof PlayerEvents, (...args: any[]) => {
|
||||||
execute(...args, client)
|
execute(...args, client);
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line
|
||||||
return client.player.on(event_type as keyof PlayerEvents, (...args: any) =>
|
return client.player.on(event_type as keyof PlayerEvents, (...args: any[]) => {
|
||||||
execute(...args, client)
|
execute(...args, client);
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (once) {
|
if (once) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { Queue } from "discord-player";
|
import { Queue } from "discord-player";
|
||||||
|
import { Metadata } from "../../modules/metadata";
|
||||||
|
|
||||||
/** https://discord-player.js.org/docs/main/master/typedef/PlayerEvents */
|
/** 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);
|
console.error(error);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { Queue } from "discord-player";
|
import { Queue } from "discord-player";
|
||||||
|
import { Metadata } from "../../modules/metadata";
|
||||||
|
|
||||||
/** https://discord-player.js.org/docs/main/master/typedef/PlayerEvents */
|
/** 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);
|
console.error(error);
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,6 +2,6 @@ import { Queue, Track } from "discord-player";
|
||||||
import { Metadata } from "../../modules/metadata";
|
import { Metadata } from "../../modules/metadata";
|
||||||
|
|
||||||
/** https://discord-player.js.org/docs/main/master/typedef/PlayerEvents */
|
/** https://discord-player.js.org/docs/main/master/typedef/PlayerEvents */
|
||||||
export default async (queue: Queue, track: Track) => {
|
export default (queue: Queue<Metadata>, track: Track) => {
|
||||||
(queue.metadata as Metadata).channel?.send(`🎶 | Joue \`${track.title}\`.`);
|
queue.metadata?.channel?.send(`🎶 | Joue \`${track.title}\` demandé par ${track.requestedBy}.`);
|
||||||
};
|
};
|
||||||
|
|
|
@ -37,7 +37,11 @@ export default async () => {
|
||||||
list: new Collection(),
|
list: new Collection(),
|
||||||
};
|
};
|
||||||
|
|
||||||
client.player = new Player(client);
|
client.player = new Player(client, {
|
||||||
|
ytdlOptions: {
|
||||||
|
filter: "audioonly",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
console.log("Translations progression :");
|
console.log("Translations progression :");
|
||||||
client.locales = await loadLocales(client.config.default_lang);
|
client.locales = await loadLocales(client.config.default_lang);
|
||||||
|
|
Loading…
Reference in a new issue