/soundboard -> /sfxboard
This commit is contained in:
@@ -57,7 +57,7 @@ function getSfxCategories() {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("soundboard")
|
.setName("sfxboard")
|
||||||
.setDescription("Interactive soundboard with categorized buttons"),
|
.setDescription("Interactive soundboard with categorized buttons"),
|
||||||
|
|
||||||
async execute(interaction, guildConfig) {
|
async execute(interaction, guildConfig) {
|
||||||
|
|||||||
@@ -6,13 +6,12 @@ const {
|
|||||||
AudioPlayerStatus,
|
AudioPlayerStatus,
|
||||||
entersState,
|
entersState,
|
||||||
getVoiceConnection,
|
getVoiceConnection,
|
||||||
generateDependencyReport
|
} = require("@discordjs/voice");
|
||||||
} = require('@discordjs/voice');
|
const { ChannelType } = require("discord.js");
|
||||||
const { ChannelType } = require('discord.js');
|
|
||||||
|
|
||||||
// Try to use ffmpeg-static as fallback if system ffmpeg is not available
|
// Try to use ffmpeg-static as fallback if system ffmpeg is not available
|
||||||
try {
|
try {
|
||||||
const ffmpegPath = require('ffmpeg-static');
|
const ffmpegPath = require("ffmpeg-static");
|
||||||
if (ffmpegPath && !process.env.FFMPEG_PATH) {
|
if (ffmpegPath && !process.env.FFMPEG_PATH) {
|
||||||
process.env.FFMPEG_PATH = ffmpegPath;
|
process.env.FFMPEG_PATH = ffmpegPath;
|
||||||
}
|
}
|
||||||
@@ -33,7 +32,7 @@ class VoiceService {
|
|||||||
*/
|
*/
|
||||||
async join(channel) {
|
async join(channel) {
|
||||||
if (!channel || channel.type !== ChannelType.GuildVoice) {
|
if (!channel || channel.type !== ChannelType.GuildVoice) {
|
||||||
throw new Error('Invalid voice channel');
|
throw new Error("Invalid voice channel");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if already connected
|
// Check if already connected
|
||||||
@@ -100,7 +99,7 @@ class VoiceService {
|
|||||||
async play(guildId, filePath, options = {}) {
|
async play(guildId, filePath, options = {}) {
|
||||||
const connection = this.connections.get(guildId);
|
const connection = this.connections.get(guildId);
|
||||||
if (!connection) {
|
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
|
// Create or get player for this guild
|
||||||
@@ -131,8 +130,8 @@ class VoiceService {
|
|||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
player.once('error', (error) => {
|
player.once("error", (error) => {
|
||||||
console.error('Player error:', error);
|
console.error("Player error:", error);
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user