Option to add a music now
All checks were successful
Lint and Format Check / lint-and-format (pull_request) Successful in 25s

This commit is contained in:
Mylloon 2024-09-23 12:12:49 +02:00
parent 7e65220467
commit 788e83cd3d
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 53 additions and 9 deletions

View file

@ -27,14 +27,42 @@ export default {
.setNameLocalizations(getLocalizations(client, `c_${filename}_name`, true))
.setDescriptionLocalizations(getLocalizations(client, `c_${filename}_desc`))
// Command option
.addStringOption((option) =>
option
.setName(loc_default.get(`c_${filename}_opt1_name`)!.toLowerCase())
.setDescription(loc_default.get(`c_${filename}_opt1_desc`)!)
.setNameLocalizations(getLocalizations(client, `c_${filename}_opt1_name`, true))
.setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`))
.setAutocomplete(true),
// Normal
.addSubcommand((subcommand) =>
subcommand
.setName(loc_default.get(`c_${filename}_sub1_name`)!.toLowerCase())
.setDescription(loc_default.get(`c_${filename}_sub1_desc`)!)
.setNameLocalizations(getLocalizations(client, `c_${filename}_sub1_name`, true))
.setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub1_desc`))
// Command option
.addStringOption((option) =>
option
.setName(loc_default.get(`c_${filename}_opt1_name`)!.toLowerCase())
.setDescription(loc_default.get(`c_${filename}_opt1_desc`)!)
.setNameLocalizations(getLocalizations(client, `c_${filename}_opt1_name`, true))
.setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`))
.setAutocomplete(true),
),
)
// Play now
.addSubcommand((subcommand) =>
subcommand
.setName(loc_default.get(`c_${filename}_sub2_name`)!.toLowerCase())
.setDescription(loc_default.get(`c_${filename}_sub2_desc`)!)
.setNameLocalizations(getLocalizations(client, `c_${filename}_sub2_name`, true))
.setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub2_desc`))
// Command option
.addStringOption((option) =>
option
.setName(loc_default.get(`c_${filename}_opt1_name`)!.toLowerCase())
.setDescription(loc_default.get(`c_${filename}_opt1_desc`)!)
.setNameLocalizations(getLocalizations(client, `c_${filename}_opt1_name`, true))
.setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`))
.setAutocomplete(true),
),
)
);
},
@ -133,7 +161,15 @@ export default {
} else {
const track = result.tracks[0];
queue.addTrack(track);
if (
interaction.options.getSubcommand() ===
loc_default?.get(`c_${filename}_sub2_name`)?.toLowerCase()
) {
queue.insertTrack(track, 0);
} else {
queue.addTrack(track);
}
title = track.title;
}

View file

@ -81,6 +81,10 @@
"c_play_name": "play",
"c_play_desc": "Plays a song/playlist, no query displays the now playing song",
"c_play_sub1_name": "add",
"c_play_sub1_desc": "Adds song/playlist to the queue",
"c_play_sub2_name": "now",
"c_play_sub2_desc": "Adds the song/playlist to the beginning of the queue",
"c_play_opt1_name": "query",
"c_play_opt1_desc": "What you want to listen to",
"c_play1": "You're not on any vocal channels.",

View file

@ -81,6 +81,10 @@
"c_play_name": "play",
"c_play_desc": "Joue une chanson/playlist, pas de requête affiche la chanson en cours actuellement",
"c_play_sub1_name": "ajouter",
"c_play_sub1_desc": "Ajoute la chanson/playlist à la file d'attente",
"c_play_sub2_name": "maintenant",
"c_play_sub2_desc": "Ajoute la chanson/playlist au début de la file",
"c_play_opt1_name": "requête",
"c_play_opt1_desc": "Ce que vous voulez écouter",
"c_play1": "Tu n'es dans aucun salon vocal.",