mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 22:15:37 +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, playerOptions } = 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');
|
||||
|
||||
@@ -19,6 +19,11 @@ module.exports = {
|
||||
}
|
||||
|
||||
const queue = useQueue(interaction.guild.id);
|
||||
|
||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const pageIndex = (interaction.options.getNumber('page') || 1) - 1;
|
||||
let queueString = '';
|
||||
|
||||
|
||||
Reference in new issue
Block a user