From 6d93f3dcad6d55144fc695c3a4a8a8c0a42970b3 Mon Sep 17 00:00:00 2001 From: Chris Ham <431647+greenham@users.noreply.github.com> Date: Sat, 16 Aug 2025 22:32:37 -0700 Subject: [PATCH] /soundboard -> /sfxboard --- src/commands/slash/soundboard.js | 2 +- src/services/voiceService.js | 35 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/commands/slash/soundboard.js b/src/commands/slash/soundboard.js index b6de637..d9d158f 100644 --- a/src/commands/slash/soundboard.js +++ b/src/commands/slash/soundboard.js @@ -57,7 +57,7 @@ function getSfxCategories() { module.exports = { data: new SlashCommandBuilder() - .setName("soundboard") + .setName("sfxboard") .setDescription("Interactive soundboard with categorized buttons"), async execute(interaction, guildConfig) { diff --git a/src/services/voiceService.js b/src/services/voiceService.js index f53ec43..4cf32d9 100644 --- a/src/services/voiceService.js +++ b/src/services/voiceService.js @@ -6,13 +6,12 @@ const { AudioPlayerStatus, entersState, getVoiceConnection, - generateDependencyReport -} = require('@discordjs/voice'); -const { ChannelType } = require('discord.js'); +} = require("@discordjs/voice"); +const { ChannelType } = require("discord.js"); // Try to use ffmpeg-static as fallback if system ffmpeg is not available try { - const ffmpegPath = require('ffmpeg-static'); + const ffmpegPath = require("ffmpeg-static"); if (ffmpegPath && !process.env.FFMPEG_PATH) { process.env.FFMPEG_PATH = ffmpegPath; } @@ -28,17 +27,17 @@ class VoiceService { /** * Join a voice channel - * @param {VoiceChannel} channel + * @param {VoiceChannel} channel * @returns {VoiceConnection} */ async join(channel) { if (!channel || channel.type !== ChannelType.GuildVoice) { - throw new Error('Invalid voice channel'); + throw new Error("Invalid voice channel"); } // Check if already connected let connection = getVoiceConnection(channel.guild.id); - + if (!connection) { connection = joinVoiceChannel({ channelId: channel.id, @@ -79,7 +78,7 @@ class VoiceService { /** * Leave a voice channel - * @param {string} guildId + * @param {string} guildId */ leave(guildId) { const connection = this.connections.get(guildId); @@ -92,15 +91,15 @@ class VoiceService { /** * Play an audio file - * @param {string} guildId - * @param {string} filePath - * @param {Object} options + * @param {string} guildId + * @param {string} filePath + * @param {Object} options * @returns {AudioPlayer} */ async play(guildId, filePath, options = {}) { const connection = this.connections.get(guildId); if (!connection) { - throw new Error('Not connected to voice channel'); + throw new Error("Not connected to voice channel"); } // Create or get player for this guild @@ -131,8 +130,8 @@ class VoiceService { resolve(); }); - player.once('error', (error) => { - console.error('Player error:', error); + player.once("error", (error) => { + console.error("Player error:", error); reject(error); }); }); @@ -140,7 +139,7 @@ class VoiceService { /** * Stop playing audio - * @param {string} guildId + * @param {string} guildId */ stop(guildId) { const player = this.players.get(guildId); @@ -151,7 +150,7 @@ class VoiceService { /** * Check if connected to a voice channel - * @param {string} guildId + * @param {string} guildId * @returns {boolean} */ isConnected(guildId) { @@ -160,7 +159,7 @@ class VoiceService { /** * Get the current voice connection - * @param {string} guildId + * @param {string} guildId * @returns {VoiceConnection|undefined} */ getConnection(guildId) { @@ -168,4 +167,4 @@ class VoiceService { } } -module.exports = new VoiceService(); \ No newline at end of file +module.exports = new VoiceService();