discord.js - Imagine an app

DIA

discord.js - Imagine an app

Support server for discord.js, a Node.js module to interact with Discords apps API.

Join

djs-questions

djs-voice

Getting this error when booting up the bot.

package.json: ```js { "name": "someshit", "version": "1.0.0",...
No description

How to include silence in vc recording

I’m trying to record a vc, I’m using this and the module mediaplex for the opus encoder: ```js const listenStream = connection.receiver.subscribe(member.id, { end: {...

running multiple bots with one script

I tried running about 14 bots with one script and make them join voice channels and tried using worker threads to run each bot on a separate thread and distribute the bots and balance them on multiple cpu cores but but after a while of launching the script some of those bots go offline idk if the cpu can't handle running all of those bots simultaneously or it's just an internet problem can anyone help me understand the problem? Or at least suggest some methods to debug the problem

Voice Typescript error.

I have a command that i did in js back in the day. I dont even know how djs voice works exactly but ik it worked withouth problem. So here is my code: ```ts player.on(AudioPlayerStatus.Idle, () => { subscription?.unsubscribe()...

connecting bots to vc

Can i keep more than one bot connected to different VC's using one script ?

Seek option removed

In discord.js v12 there was an option to seek the audio stream while playing it like this:
connection.play(stream, {seek: start})
connection.play(stream, {seek: start})
But it seems to be removed, and now there isn't a way to play a stream from a different position....

Trying to record VC but the out file is static

everything works as expect in the console but the out .pmc when converted is only a short clip of static.

How can I record voice from a VC using discord.js?

I want to record voice from a specific voice channel, I already tried to do it many times but didn't find the solution, I either get a slowed down .pcm audio, an unaudible audio, an audio that progressively slowes down or a 1 second long static sound audio. I'm on Node.js v20.12.2, also I'm coding in TypeScript...

Bot wont talk & no error, how do i debug?

(selected opus tag bc i had to, to post idk what it is) how do i debug this? since it says nothing in logs and doesnt even light up green code (voiceConnectionAudioPlayer.player.play(...) is actually ran): ```js...

Proper disposal of a PlayerSubscription, and AudioPlayer

Really stupid question here however, I need to know what the safe and proper way to do this is. Does calling .destroy() on a VoiceConnection dispose of the subscription and player properly? Is that something I should even worry about? I ask because I'm considering keeping track of subscriptions within a map since it has a reference to both the player and connection (useful for several things, especially the audio player reference) and primarily would like to know if that would cause problems.

How to properly play audio/webm;codecs=opus buffers to a voice channel sent via WebSocket?

Trying to broadcast a stream of audio buffers being recorded as audio/webm;codecs=opus using MediaRecorder to a voice channel via a WebSocket, I know that the recording works because i can save the recording to a file and it plays in the browser. Here's my code:...

Is this the correct way for the bot to clear cache

```if (connection) { connection.destroy();
const cachedConnection = client.voice.adapters.get(interaction.guild.id); if (cachedConnection) {...

Getting started with Typescript and discord.js/voice

Hi, I presume that discord.js/voice is typescript only. Are there any recommended getting started tutorials for discord.js/voice? I tried this one but after a few hours, I couldn't reconcile the commonjs/es module mess (I dare say it's worse than python) 😺 https://dev.to/fellipeutaka/creating-your-first-discord-bot-using-typescript-1eh6 ...

Voice Stream for personal radio

Hello, I want to create a radio, I would like it to be managed and animated from discord. how can i get what all the users in the room are saying and send it to my audio stream server? don't hesitate to let me know if you have an idea and if it's possible to do it....

Checking the is bot already joined the voice channel

Hello is has any way to achieve this without using GuildVoiceStates intent? And also i want to know does the JoinVoiceChannel function creates a new connection even if bot has already joined to specific voice channel?...

My bot does not run the audio

hey my bot works totally fine in my device but when the bot in a server the audio does not play everything is latest version...

Crashing on connection.destroy();

```js async function handleLeaveCommand(interaction) { const connection = getVoiceConnection(interaction.guild.id); if (!connection) { const cannotJoinEmbed = new EmbedBuilder()...

Listening to Player Events + Removing References + player.stop() & Memory Leaks

Should I be concerned about memory leaks if I open a new listener to listen to the player 'playing', 'idle' and 'error' events every time my user runs a command? Or should I not worry about it if I just don't do anything with that player ever again after the user runs the command? Furthermore, should I be closing players somehow? Or is that just automatic when the player goes to idle after a given period of time? 🤔...

Bot is not playing

Code: ```ts const player = createAudioPlayer({ behaviors: { noSubscriber: NoSubscriberBehavior.Stop, },...

Mp3 audio not playing

Hello i followed various guides and threads in this server to create a command !play that enables the bot to stream an mp3 file located in his folder. The bot joins the channel but the audio don't start, no errors in the terminal. [email protected] Node v16.20.2 @discordjs/[email protected]...