aboutsummaryrefslogtreecommitdiff
path: root/Commands/leave.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2024-02-15 17:18:15 -0500
committerAndrew Lee <alee14498@protonmail.com>2024-02-15 17:20:59 -0500
commitd98937b34bbb7582f4c13e0d18bcc30febe1d174 (patch)
tree04133cf911474c50674084b58a65361bf8990a35 /Commands/leave.js
parent16b7fb29fb5bd01f346749020dc43fa24a16993f (diff)
downloadDLAP-d98937b34bbb7582f4c13e0d18bcc30febe1d174.tar.gz
DLAP-d98937b34bbb7582f4c13e0d18bcc30febe1d174.tar.bz2
DLAP-d98937b34bbb7582f4c13e0d18bcc30febe1d174.zip
Finally fixed some issues
- Voting should work properly? - Now the bot tells the user if they are already in vc - Thumbnails will be null when switching tracks
Diffstat (limited to 'Commands/leave.js')
-rw-r--r--Commands/leave.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/Commands/leave.js b/Commands/leave.js
index e6559ca..c78cfe0 100644
--- a/Commands/leave.js
+++ b/Commands/leave.js
@@ -24,6 +24,7 @@ import { destroyAudio } from '../AudioBackend/Shutdown.js';
import { PermissionFlagsBits } from 'discord-api-types/v10';
import { readFileSync } from 'node:fs';
import i18next from '../Utilities/i18n.js';
+import { playerStatus } from '../AudioBackend/AudioControl.js';
const { djRole, ownerID } = JSON.parse(readFileSync('./config.json', 'utf-8'));
const t = i18next.t;
export default {
@@ -33,6 +34,7 @@ export default {
async execute(interaction, bot) {
if (!interaction.member.voice.channel) return await interaction.reply({ content: t('voicePermission'), ephemeral: true });
if (!interaction.member.roles.cache.has(djRole) && interaction.user.id !== ownerID && !interaction.memberPermissions.has(PermissionFlagsBits.ManageGuild)) return interaction.reply({ content: t('rolePermission'), ephemeral: true });
+ if (playerStatus === 2) return await interaction.reply({ content: t('alreadyLeave'), ephemeral: true });
console.log(t('leaveVoice'));
await destroyAudio(interaction);