From 1e294d91c3eab7e65936010c8f0c81c4c4f73b96 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 5 Jul 2022 23:08:59 -0400 Subject: Removed help; Updated all the new commands; Finally removed final control panel code --- commands/pause.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'commands/pause.js') diff --git a/commands/pause.js b/commands/pause.js index c0edeeb..7615573 100644 --- a/commands/pause.js +++ b/commands/pause.js @@ -21,15 +21,19 @@ import { SlashCommandBuilder } from '@discordjs/builders' import config from '../config.json' assert {type: 'json'} - -export let integer; +import {audioState, isAudioStatePaused, player} from "../AudioBackend.js"; export default { data: new SlashCommandBuilder() .setName('pause') .setDescription('Pauses the player'), - async execute(interaction, bot) { - if (![config.botOwner].includes(interaction.user.id)) return await interaction.reply({ content: "You do not have permissions to execute this command.", ephemeral: true }); - + async execute(interaction) { + if (isAudioStatePaused === false) { + audioState(); + player.pause(); + return await interaction.reply({content:'Pausing music', ephemeral:true}); + } else { + return await interaction.reply({content:"Music is already paused", ephemeral:true}) + } }, }; \ No newline at end of file -- cgit v1.2.3