mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 22:16:13 +00:00
feat: Renamed validator files and added permission validator
This commit is contained in:
1 parent
f04937eee0
commit
b68b7dac95
18 files changed
+51
-22
No files matched your search
@@ -0,0 +1,24 @@
|
||||
const logger = require('../../services/logger');
|
||||
const { embedOptions } = require('../../config');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
exports.cannotJoinVoiceOrTalk = async (interaction) => {
|
||||
const channel = interaction.member.voice.channel;
|
||||
|
||||
if (!channel.joinable || !channel.speakable) {
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
.setDescription(
|
||||
`**${embedOptions.icons.warning} Oops!**\nI do not have permission to play audio in the voice channel you are in.\n\nPlease make sure I have the **Connect** and **Speak** permissions in this voice channel.`
|
||||
)
|
||||
.setColor(embedOptions.colors.warning)
|
||||
]
|
||||
});
|
||||
|
||||
logger.debug(`User tried to use command ${interaction.commandName} but was not in a voice channel.`);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user