aboutsummaryrefslogtreecommitdiff
path: root/Commands/pause.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/pause.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/pause.js')
-rw-r--r--Commands/pause.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/Commands/pause.js b/Commands/pause.js
index bc649a6..1d04404 100644
--- a/Commands/pause.js
+++ b/Commands/pause.js
@@ -20,7 +20,7 @@
***************************************************************************/
import { SlashCommandBuilder } from 'discord.js';
-import { toggleAudioState, isAudioStatePaused } from '../AudioBackend/AudioControl.js';
+import { toggleAudioState, isAudioStatePaused, playerStatus } from '../AudioBackend/AudioControl.js';
import { PermissionFlagsBits } from 'discord-api-types/v10';
import { readFileSync } from 'node:fs';
import i18next from '../Utilities/i18n.js';
@@ -34,11 +34,15 @@ export default {
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 (!isAudioStatePaused) {
- toggleAudioState();
- return await interaction.reply({ content: t('pausingMusic'), ephemeral: true });
+ if (playerStatus === 2) {
+ return await interaction.reply({ content: t('alreadyLeave'), ephemeral: true });
} else {
- return await interaction.reply({ content: t('pausedAlready'), ephemeral: true });
+ if (!isAudioStatePaused) {
+ toggleAudioState();
+ return await interaction.reply({ content: t('pausingMusic'), ephemeral: true });
+ } else {
+ return await interaction.reply({ content: t('pausedAlready'), ephemeral: true });
+ }
}
}
};