const { getVoiceConnection } = require('@discordjs/voice'); module.exports = { name: "disconnect", description: "Disconnects Omex from voice channel", value: "stop", usage: "**/disconnect**", async execute(client, interaction, Discord) { const VoiceChannel = interaction.member.voice.channel; // some stuff not pertaining to the issue try { const connection = getVoiceConnection(interaction.guild.id) connection.destroy(); return interaction.reply({ embeds: [ new Discord.MessageEmbed() .setDescription("🛑 Disconnected") .setColor("BLACK"), ], }); } catch (e) { const errorEmbed = new Discord.MessageEmbed() .setColor("BLACK") .setDescription(`❌ An error occured: ${e}`); return interaction.reply({ embeds: [errorEmbed], ephemeral: true }); } }, };