mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
fix: Also validate is user is in same voice channel as bot for commands
This commit is contained in:
1 parent
f59055807f
commit
311e141992
14 files changed
+94
-17
No files matched your search
@@ -1,6 +1,6 @@
|
||||
const logger = require('../../services/logger');
|
||||
const { embedOptions } = require('../../config');
|
||||
const { notInVoiceChannel } = require('../../utils/validation/voiceChannelValidator');
|
||||
const { notInVoiceChannel, notInSameVoiceChannel } = require('../../utils/validation/voiceChannelValidator');
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
|
||||
const { useQueue } = require('discord-player');
|
||||
|
||||
@@ -34,6 +34,10 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!queue.deleted) {
|
||||
queue.delete();
|
||||
logger.debug(
|
||||
|
||||
Reference in new issue
Block a user