const { joinVoiceChannel } = require("@discordjs/voice"); import { Client } from 'discord.js'; async function joinVC(client: Client, Channel: string) { const voiceChannel: any = client.channels.cache.get(Channel); if (!voiceChannel) return; const guild = client.guilds.cache.get(voiceChannel.guildId); if (!guild) return; const connection = joinVoiceChannel({ channelId: voiceChannel.id, guildId: guild.id, adapterCreator: guild.voiceAdapterCreator, selfDeaf: false, selfMute: true }); } module.exports = joinVC;