mirror of
https://github.com/arthur-pbty/selfbot-discord.git
synced 2026-06-03 15:07:35 +02:00
19 lines
552 B
TypeScript
19 lines
552 B
TypeScript
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; |