add nowplaying

This commit is contained in:
Mylloon 2023-02-10 17:31:23 +01:00
parent 3a2efd1c82
commit 43dfdba4b3
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 27 additions and 3 deletions

View file

@ -63,8 +63,28 @@ export default {
});
}
const query =
interaction.options.getString(loc_default?.get(`c_${filename}_opt1_name`) as string) ?? "";
const query = interaction.options.getString(
loc_default?.get(`c_${filename}_opt1_name`) as string
);
if (!query) {
// Now playing
const queue = client.player.queues.get(interaction.guildId ?? "");
if (queue) {
const track = queue.current;
if (track) {
// TODO: Pretty embed
return await interaction.reply(
`${loc.get("c_play_7")} \`${track.title}\` - *${track.author}*`
);
}
}
// TODO: Pretty embed
return await interaction.reply(loc.get("c_play_6"));
}
const queue = client.player.createQueue(interaction.guild as GuildResolvable, {
metadata: {
@ -91,6 +111,7 @@ export default {
.then((x) => x);
if (!result.tracks[0]) {
// TODO: Pretty embed
return await interaction.followUp({ content: `❌ | \`${query}\` ${loc.get("c_play4")}.` });
}
@ -110,6 +131,7 @@ export default {
queue.play();
}
// TODO: Pretty embed
return await interaction.followUp({
content: `⏱️ | \`${title}\` ${loc.get("c_play5")}.`,
});

View file

@ -79,7 +79,7 @@
"c_reminder18": "Pas de message",
"c_play_name": "play",
"c_play_desc": "Joue une chanson/playlist",
"c_play_desc": "Joue une chanson/playlist, pas de requête affiche la chanson en cours actuellement",
"c_play_opt1_name": "requête",
"c_play_opt1_desc": "Ce que vous voulez écouter",
"c_play1": "Tu n'es dans aucun salon vocal.",
@ -87,6 +87,8 @@
"c_play3": "Impossible de rejoindre le salon vocal.",
"c_play4": "introuvable",
"c_play5": "ajouté à la file d'attente",
"c_play_6": "Le bot ne joue rien en ce moment.",
"c_play_7": "Joue actuellement",
"c_stop_name": "stop",
"c_stop_desc": "Stop la musique",
"c_stop1": "Le bot ne joue pas de musique.",