Skip to content

Commit

Permalink
🔧 Changed to not reassign when player exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Nich87 committed Dec 3, 2023
1 parent f97a488 commit f3565f0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/commands/play.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ export async function playCommand(message: Message) {
queueManager.setQueue(message.guild?.id as string, new Queue());
}
const queue = queueManager.getQueue(message.guild?.id as string) as Queue;

player = new YTPlayer(
message.guild?.id as string,
message.member?.voice.channel as VoiceBasedChannel,
message.channel.id
);
if (typeof player === 'undefined') {
player = new YTPlayer(
message.guild?.id as string,
message.member?.voice.channel as VoiceBasedChannel,
message.channel.id
);
}
url = message.content.split(' ')[1];
const channel = message.member?.voice.channel;
if (!url)
Expand Down

0 comments on commit f3565f0

Please sign in to comment.