UNPKG

@getsolara/solara.voice

Version:

Optional voice functionality for @getsolara/solara.js using @discordjs/voice

21 lines 987 B
const { AudioPlayerStatus } = require('@discordjs/voice'); module.exports = { name: "$voicePause", description: "Pauses the current audio playback.", takesBrackets: false, execute: async (context, args) => { if (context.client.voiceInitialized === false) { return "[Error: $voicePause requires voice features to be enabled. Ensure @getsolara/solara.voice is installed and configured correctly.]"; } if (!context.guild) return "[Error: $voicePause can only be used in a server.]"; const player = context.client.solaraAudioPlayers?.get(context.guild.id); if (player && player.state.status === AudioPlayerStatus.Playing) { if (player.pause()) { return ""; } else { return "[Error: Failed to pause the player for $voicePause.]"; } } return "[Error: Player not found or not currently playing for $voicePause.]"; } };