mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
fix: update voice channel validator logging
This commit is contained in:
1 parent
9d9087d4c3
commit
22109823e1
16 files changed
+95
-70
No files matched your search
@@ -22,8 +22,8 @@ module.exports = {
|
|||||||
.setDescription('Toggle various audio filters during playback.')
|
.setDescription('Toggle various audio filters during playback.')
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setNSFW(false),
|
.setNSFW(false),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ module.exports = {
|
|||||||
components: [filterActionRow, disableFiltersActionRow]
|
components: [filterActionRow, disableFiltersActionRow]
|
||||||
});
|
});
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`Sent embed for command ${interaction.commandName}, awaiting interaction response.`
|
`[Shard ${interaction.guild.shardId}] Sent embed for command ${interaction.commandName}, awaiting interaction response.`
|
||||||
);
|
);
|
||||||
|
|
||||||
const collectorFilter = (i) => i.user.id === interaction.user.id;
|
const collectorFilter = (i) => i.user.id === interaction.user.id;
|
||||||
@@ -99,7 +99,7 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`Received interaction response for command ${interaction.commandName}.`
|
`[Shard ${interaction.guild.shardId}] Received interaction response for command ${interaction.commandName}.`
|
||||||
);
|
);
|
||||||
|
|
||||||
confirmation.deferUpdate();
|
confirmation.deferUpdate();
|
||||||
@@ -150,7 +150,7 @@ module.exports = {
|
|||||||
queue.filters.ffmpeg.toggle(confirmation.values);
|
queue.filters.ffmpeg.toggle(confirmation.values);
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`Enabled filters ${confirmation.values.join(', ')} for command ${
|
`[Shard ${interaction.guild.shardId}] Enabled filters ${confirmation.values.join(', ')} for command ${
|
||||||
interaction.commandName
|
interaction.commandName
|
||||||
}.`
|
}.`
|
||||||
);
|
);
|
||||||
@@ -182,14 +182,14 @@ module.exports = {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.code === 'InteractionCollectorError') {
|
if (error.code === 'InteractionCollectorError') {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`Interaction response timed out for command ${interaction.commandName}.`
|
`[Shard ${interaction.guild.shardId}] Interaction response timed out for command ${interaction.commandName}.`
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
error,
|
error,
|
||||||
`Unhandled error while awaiting interaction response for command ${interaction.commandName}, throwing error.`
|
`[Shard ${interaction.guild.shardId}] Unhandled error while awaiting interaction response for command ${interaction.commandName}, throwing error.`
|
||||||
);
|
);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ module.exports = {
|
|||||||
.setDescription('Clear the track queue and remove the bot from voice channel.')
|
.setDescription('Clear the track queue and remove the bot from voice channel.')
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setNSFW(false),
|
.setNSFW(false),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ module.exports = {
|
|||||||
{ name: 'Disabled', value: '0' }
|
{ name: 'Disabled', value: '0' }
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,13 +86,13 @@ module.exports = {
|
|||||||
);
|
);
|
||||||
return interaction.respond(response);
|
return interaction.respond(response);
|
||||||
},
|
},
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
const query = interaction.options.getString('query');
|
const query = interaction.options.getString('query');
|
||||||
const queue = useQueue(interaction.guild.id);
|
const queue = useQueue(interaction.guild.id);
|
||||||
let geniusSearchQuery = '';
|
let geniusSearchQuery = '';
|
||||||
|
|
||||||
if (!query) {
|
if (!query) {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ module.exports = {
|
|||||||
.setDescription('Show information about the track currently playing.')
|
.setDescription('Show information about the track currently playing.')
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setNSFW(false),
|
.setNSFW(false),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ module.exports = {
|
|||||||
.setDescription('Pause or resume the current track.')
|
.setDescription('Pause or resume the current track.')
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setNSFW(false),
|
.setNSFW(false),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ module.exports = {
|
|||||||
|
|
||||||
return interaction.respond(response);
|
return interaction.respond(response);
|
||||||
},
|
},
|
||||||
execute: async ({ interaction, client, executionId }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
const logger = require('../../services/logger').child({
|
const logger = require('../../services/logger').child({
|
||||||
source: 'play.js',
|
source: 'play.js',
|
||||||
module: 'slashCommand',
|
module: 'slashCommand',
|
||||||
@@ -91,7 +91,7 @@ module.exports = {
|
|||||||
executionId: executionId
|
executionId: executionId
|
||||||
});
|
});
|
||||||
|
|
||||||
if (await notInVoiceChannel(interaction, client)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let queue = useQueue(interaction.guild.id);
|
let queue = useQueue(interaction.guild.id);
|
||||||
if (queue && (await notInSameVoiceChannel(interaction, queue))) {
|
if (queue && (await notInSameVoiceChannel({ interaction, queue, executionId }))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ module.exports = {
|
|||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setNSFW(false)
|
.setNSFW(false)
|
||||||
.addNumberOption((option) => option.setName('page').setDescription('Page number of the queue').setMinValue(1)),
|
.addNumberOption((option) => option.setName('page').setDescription('Page number of the queue').setMinValue(1)),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const queue = useQueue(interaction.guild.id);
|
const queue = useQueue(interaction.guild.id);
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ module.exports = {
|
|||||||
.setMinValue(1)
|
.setMinValue(1)
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
),
|
),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ module.exports = {
|
|||||||
.setDescription('Duration in format 00:00:00 (HH:mm:ss) to seek to.')
|
.setDescription('Duration in format 00:00:00 (HH:mm:ss) to seek to.')
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
),
|
),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ module.exports = {
|
|||||||
.setDescription('Shuffle tracks in the queue randomly.')
|
.setDescription('Shuffle tracks in the queue randomly.')
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setNSFW(false),
|
.setNSFW(false),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ module.exports = {
|
|||||||
.addNumberOption((option) =>
|
.addNumberOption((option) =>
|
||||||
option.setName('tracknumber').setDescription('Track number to skip to in the queue.').setMinValue(1)
|
option.setName('tracknumber').setDescription('Track number to skip to in the queue.').setMinValue(1)
|
||||||
),
|
),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ module.exports = {
|
|||||||
.setDescription('Stop playing audio and clear the track queue.')
|
.setDescription('Stop playing audio and clear the track queue.')
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setNSFW(false),
|
.setNSFW(false),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ module.exports = {
|
|||||||
.setMinValue(0)
|
.setMinValue(0)
|
||||||
.setMaxValue(100)
|
.setMaxValue(100)
|
||||||
),
|
),
|
||||||
execute: async ({ interaction }) => {
|
execute: async ({ interaction, executionId }) => {
|
||||||
if (await notInVoiceChannel(interaction)) {
|
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await notInSameVoiceChannel(interaction, queue)) {
|
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
const logger = require('../services/logger');
|
|
||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
const { REST, Routes } = require('discord.js');
|
const { REST, Routes } = require('discord.js');
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
|
const { v4: uuidv4 } = require('uuid');
|
||||||
const systemOptions = config.get('systemOptions');
|
const systemOptions = config.get('systemOptions');
|
||||||
|
|
||||||
|
const executionId = uuidv4();
|
||||||
|
|
||||||
|
const logger = require('../services/logger').child({
|
||||||
|
source: 'deploySlashCommands.js',
|
||||||
|
module: 'deploy',
|
||||||
|
name: 'deploySlashCommands',
|
||||||
|
executionId: executionId
|
||||||
|
});
|
||||||
|
|
||||||
const slashCommands = [];
|
const slashCommands = [];
|
||||||
const systemCommands = [];
|
const systemCommands = [];
|
||||||
const commandFolders = fs.readdirSync(path.resolve('./src/commands'));
|
const commandFolders = fs.readdirSync(path.resolve('./src/commands'));
|
||||||
@@ -26,46 +35,45 @@ const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_BOT_TOKEN)
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
if (!process.env.DISCORD_APPLICATION_ID || !process.env.DISCORD_BOT_TOKEN) {
|
if (!process.env.DISCORD_APPLICATION_ID || !process.env.DISCORD_BOT_TOKEN) {
|
||||||
logger.error('Missing required environment variables for deployment.');
|
logger.error(
|
||||||
logger.error('Provide valid DISCORD_APPLICATION_ID and DISCORD_BOT_TOKEN in .env file.');
|
'Missing required environment variables for deployment.\nPlease provide valid DISCORD_APPLICATION_ID and DISCORD_BOT_TOKEN in .env file.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.info('DEPLOYING BOT SLASH COMMANDS');
|
logger.debug(`Bot user slash commands found: ${slashCommands.map((command) => `/${command.name}`).join(', ')}`);
|
||||||
logger.info(
|
|
||||||
slashCommands.map((command) => command.name),
|
|
||||||
'Bot commands found:'
|
|
||||||
);
|
|
||||||
|
|
||||||
logger.info('Started refreshing application (/) bot commands.');
|
logger.info('Started refreshing user slash commands.');
|
||||||
await refreshCommands(Routes.applicationCommands(process.env.DISCORD_APPLICATION_ID), slashCommands);
|
await refreshCommands(Routes.applicationCommands(process.env.DISCORD_APPLICATION_ID), slashCommands);
|
||||||
logger.info('Successfully refreshed application (/) bot commands.');
|
logger.info('Successfully refreshed user slash commands.');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(error, 'Failed to refresh application (/) bot commands.');
|
logger.error(error, 'Failed to refresh user slash commands.');
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.info('DEPLOYING SYSTEM SLASH COMMANDS');
|
logger.debug(
|
||||||
logger.info(
|
`Bot system slash commands found: ${systemCommands
|
||||||
systemCommands.map((systemCommand) => systemCommand.name),
|
.map((systemCommand) => `/${systemCommand.name}`)
|
||||||
'System commands found:'
|
.join(', ')}`
|
||||||
);
|
);
|
||||||
|
|
||||||
logger.info('Started refreshing application (/) system commands.');
|
logger.info('Started refreshing system slash commands.');
|
||||||
const systemGuildIds = systemOptions.systemGuildIds;
|
const systemGuildIds = systemOptions.systemGuildIds;
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
systemGuildIds.map((systemGuildId) => {
|
systemGuildIds.map((systemGuildId) => {
|
||||||
logger.info(`Refreshing system commands for guild id: ${systemGuildId}.`);
|
logger.debug(`Refreshing system slash command for guild id '${systemGuildId}'.`);
|
||||||
refreshCommands(
|
refreshCommands(
|
||||||
Routes.applicationGuildCommands(process.env.DISCORD_APPLICATION_ID, systemGuildId),
|
Routes.applicationGuildCommands(process.env.DISCORD_APPLICATION_ID, systemGuildId),
|
||||||
systemCommands
|
systemCommands
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
logger.info('Successfully refreshed application (/) system commands.');
|
logger.info('Successfully refreshed system slash commands.');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(error, 'Failed to refresh application (/) system commands.');
|
logger.error(
|
||||||
logger.error('Make sure the bot is in the system guilds provided.');
|
error,
|
||||||
|
'Failed to refresh system slash commands. Make sure the bot is in the system guilds specified in \'systemOptions\'.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
const logger = require('../../services/logger');
|
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const embedOptions = config.get('embedOptions');
|
const embedOptions = config.get('embedOptions');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
|
|
||||||
exports.notInVoiceChannel = async (interaction) => {
|
exports.notInVoiceChannel = async ({ interaction, executionId }) => {
|
||||||
|
const logger = require('../../services/logger').child({
|
||||||
|
source: 'voiceChannelValidator.js',
|
||||||
|
module: 'validator',
|
||||||
|
name: 'notInVoiceChannel',
|
||||||
|
executionId: executionId,
|
||||||
|
shardId: interaction.guild.shardId,
|
||||||
|
guildId: interaction.guild.id
|
||||||
|
});
|
||||||
|
|
||||||
if (!interaction.member.voice.channel) {
|
if (!interaction.member.voice.channel) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
@@ -22,7 +30,16 @@ exports.notInVoiceChannel = async (interaction) => {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.notInSameVoiceChannel = async (interaction, queue) => {
|
exports.notInSameVoiceChannel = async ({ interaction, queue, executionId }) => {
|
||||||
|
const logger = require('../../services/logger').child({
|
||||||
|
source: 'voiceChannelValidator.js',
|
||||||
|
module: 'validator',
|
||||||
|
name: 'notInSameVoiceChannel',
|
||||||
|
executionId: executionId,
|
||||||
|
shardId: interaction.guild.shardId,
|
||||||
|
guildId: interaction.guild.id
|
||||||
|
});
|
||||||
|
|
||||||
if (!queue || !queue.dispatcher) {
|
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.
|
// 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;
|
return false;
|
||||||
|
|||||||
Reference in new issue
Block a user