const DJSVoice = require('@discordjs/voice') module.exports = { data: { name: 'play', description: 'Play a sound file' }, async execute(interaction) { // await interaction.reply({ content: 'Coming soon!', ephemeral: true }) const voiceChannel = await interaction.member.voice.channel if (!voiceChannel) return await interaction.reply({ content: 'You are not connected to a voice channel.', ephemeral: true }) await interaction.reply(`Joining **${voiceChannel.name}**...`) const connection = DJSVoice.joinVoiceChannel({ channelId: voiceChannel.id, guildId: voiceChannel.guild.id, adapterCreator: voiceChannel.guild.adapterCreator }) await interaction.editReply(`Joined **${voiceChannel.name}**!`) } }