diff --git "a/audio/\360\237\230\256Aahh.mp3" "b/audio/\360\237\230\256Aahh.mp3" new file mode 100644 index 0000000..a49222a Binary files /dev/null and "b/audio/\360\237\230\256Aahh.mp3" differ diff --git a/bot.js b/bot.js index c85bd67..7cd89e3 100644 --- a/bot.js +++ b/bot.js @@ -91,7 +91,7 @@ client.on('messageCreate', async (message) => { rows.push(new ActionRowBuilder().addComponents(buttons.slice(i, i + 5))); } - //Stop Button + //Stop Button at the end rows.push( new ActionRowBuilder().addComponents( new ButtonBuilder() @@ -113,8 +113,6 @@ client.on('messageCreate', async (message) => { client.on(Events.InteractionCreate, async (interaction) => { if (!interaction.isButton()) return; - // if (interaction.customId === 'Stop') return; - // Extract the audio file index from the button ID const fileIndex = parseInt(interaction.customId.split('_')[1]); @@ -126,8 +124,12 @@ client.on(Events.InteractionCreate, async (interaction) => { // Get the selected audio file const selectedFile = audioFiles[fileIndex]; - if (!selectedFile) return; - + if (!selectedFile) { + interaction.reply({ + content: 'No audio file found!', + }); + return; + } // Get the member's voice channel const voiceChannel = interaction.member.voice.channel;