mirror of
https://github.com/arthur-pbty/selfbot-discord.git
synced 2026-06-08 07:10:48 +02:00
add autovoc
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user