From d98937b34bbb7582f4c13e0d18bcc30febe1d174 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 15 Feb 2024 17:18:15 -0500 Subject: 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 --- Commands/leave.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Commands/leave.js') 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); -- cgit v1.2.3