add autovoc

This commit is contained in:
Tutur33
2024-03-04 21:36:39 +01:00
parent d05019d1d5
commit 84be04b215
9 changed files with 219 additions and 9 deletions
+19
View File
@@ -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;