Updates to join (server/client)
- Check if the available nodes are connected to a vc in the given guild
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
AudioPlayerStatus,
|
||||
VoiceConnectionStatus,
|
||||
joinVoiceChannel,
|
||||
getVoiceConnection,
|
||||
} from '@discordjs/voice';
|
||||
|
||||
import { GatewayIntentBits } from 'discord-api-types/v10';
|
||||
@@ -90,6 +91,12 @@ export async function getVoiceChannelFromID(client, channelID) {
|
||||
return client.channels.cache.get(channelID)
|
||||
}
|
||||
|
||||
export async function checkIfConnectedToVC(guildId) {
|
||||
const connection = getVoiceConnection(guildId)
|
||||
console.log("Connection!", connection);
|
||||
return connection
|
||||
}
|
||||
|
||||
export async function initDiscordBotClient(token, readyCallback){
|
||||
const client = new Client({
|
||||
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.MessageContent],
|
||||
|
||||
Reference in New Issue
Block a user