adam
adam
DIAdiscord.js - Imagine an app
Created by adam on 8/3/2024 in #djs-voice
Crashing on connection.destroy();
async function handleLeaveCommand(interaction) {
const connection = getVoiceConnection(interaction.guild.id);
if (!connection) {
const cannotJoinEmbed = new EmbedBuilder()
.setColor("FF4C4C")
.setDescription("I'm not in a voice channel! 😅");

await interaction.reply({ embeds: [cannotJoinEmbed] });
} else {
connection.destroy();
const leftEmbed = new EmbedBuilder()
.setColor("81C784")
.setDescription("Successfully left the voice chat.");

await interaction.reply({ embeds: [leftEmbed] });
}
}
async function handleLeaveCommand(interaction) {
const connection = getVoiceConnection(interaction.guild.id);
if (!connection) {
const cannotJoinEmbed = new EmbedBuilder()
.setColor("FF4C4C")
.setDescription("I'm not in a voice channel! 😅");

await interaction.reply({ embeds: [cannotJoinEmbed] });
} else {
connection.destroy();
const leftEmbed = new EmbedBuilder()
.setColor("81C784")
.setDescription("Successfully left the voice chat.");

await interaction.reply({ embeds: [leftEmbed] });
}
}
At connection.destroy(); the following error is presented:
node:internal/fs/rimraf:60
callback(err);
^

TypeError: callback is not a function
at CB (node:internal/fs/rimraf:60:5)
at FSReqCallback.oncomplete (node:fs:194:23)

Node.js v20.12.2
node:internal/fs/rimraf:60
callback(err);
^

TypeError: callback is not a function
at CB (node:internal/fs/rimraf:60:5)
at FSReqCallback.oncomplete (node:fs:194:23)

Node.js v20.12.2
I am not sure what or why this issue is occuring, and any help would be greatly appreciated. Thanks!
2 replies
DIAdiscord.js - Imagine an app
Created by adam on 6/15/2024 in #djs-voice
Recording a user
Has anyone made something similar to a Discord bot that you can talk to in VC? 1. You say a message 2. The bot converts to text 3. Bot sends to API (e.g. GPT) 4. Bot converts to voice 5. Bot sends to voice channel I'm unsure how to proceed between steps 1 & 2 - is there a way for the bot to automatically detect when the user has finished speaking before processing? I do not want a button press or anything of the sort - just automatic.
15 replies