Creates a new slash command middleware
The predicate for the middleware
Optional
failCallback: SlashCommandCallback// This means that the slash command will only be ran if the user is in a voice channel
const IsInVoiceChannel = new SlashCommandMiddleware(
(client, interaction) => interaction.member.voice.channel !== null,
(client, interaction) => interaction.reply('You must be in a voice channel to use this command.')
);
module.exports.default = new SlashCommand({
// ...
middlewares: [IsInVoiceChannel]
}, (...) => { ... });
Optional
failThe predicate for the middleware
Generated using TypeDoc
Represents a slash command middleware