Functional joining and leaving
- Needs to be tested on multiple servers - Needs to be tested with multiple nodes #1 #9
This commit is contained in:
@@ -97,6 +97,10 @@ export async function checkIfConnectedToVC(guildId) {
|
||||
return connection
|
||||
}
|
||||
|
||||
export const getVoiceConnectionFromGuild = async (guildId) => {
|
||||
return getVoiceConnection(guildId);
|
||||
}
|
||||
|
||||
export async function initDiscordBotClient(token, systemName, readyCallback) {
|
||||
const client = new Client({
|
||||
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.MessageContent],
|
||||
@@ -104,10 +108,16 @@ export async function initDiscordBotClient(token, systemName, readyCallback) {
|
||||
|
||||
client.on(Events.ClientReady, () => {
|
||||
console.log('discord.js client is ready!');
|
||||
|
||||
// Attach the recorder to the VC connection
|
||||
attachRecorder();
|
||||
|
||||
// Set the activity of the bot user
|
||||
client.user.setPresence({
|
||||
activities: [{ name: `${systemName}`, type: ActivityType.Listening }],
|
||||
});
|
||||
|
||||
//
|
||||
readyCallback(client);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user