music: fix status check

This commit is contained in:
Cynthia Foxwell 2022-12-10 15:37:42 -07:00
parent 606eaf0185
commit 00d6bef759

View file

@ -278,7 +278,7 @@ async function enqueue({
media = await playdl.stream(url); media = await playdl.stream(url);
} }
if (connection.status != AudioPlayerStatus.Idle) { if (connection.status && connection.status != AudioPlayerStatus.Idle) {
const queueItem = { const queueItem = {
url, url,
type, type,
@ -339,6 +339,7 @@ async function enqueue({
return; return;
} }
console.log(media);
const resource = createAudioResource(media.stream, {inputType: media.type}); const resource = createAudioResource(media.stream, {inputType: media.type});
console.log(resource); console.log(resource);
connection.player.play(resource); connection.player.play(resource);
@ -431,9 +432,6 @@ command.callback = async function (
const subcommand = args.shift(); const subcommand = args.shift();
let argStr = args.join(" "); let argStr = args.join(" ");
console.log(arguments);
console.log(subcommand, argStr);
switch (subcommand) { switch (subcommand) {
case "play": case "play":
case "p": case "p":