Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
fix: handle no queue dispatcher error when /queue and bot not in vc
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusbegby committed Aug 21, 2023
1 parent 94ef202 commit bd249e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/validation/voiceChannelValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ exports.notInVoiceChannel = async (interaction) => {
};

exports.notInSameVoiceChannel = async (interaction, queue) => {
if (!queue.dispatcher) {
return true;
if (!queue || !queue.dispatcher) {
// If there is no queue or bot is not in voice channel, then there is no need to check if user is in same voice channel.
return false;
}

if (interaction.member.voice.channel.id !== queue.dispatcher.channel.id) {
Expand Down

0 comments on commit bd249e6

Please sign in to comment.