discord.js - Imagine an app

DIA

discord.js - Imagine an app

Support server for discord.js, a Node.js module to interact with Discord's apps API.

Join

djs-questions

djs-voice

Voice reqs

I tried to test a tts code and looks like djs vooice requires ffmpeg, i cant download anything rn so im curious if theres any package that i could use as ffmpeg or sum like that

Receiving this error when I'm trying to join the voice call.

Hi, I'm trying to use the example as used in https://github.com/discordjs/voice-examples/blob/main/recorder/src/, however it's not working as in it's joining the vc, it's not saying that it's ready, it times out then says ready. Then, it gives me this error, which I don't really know how to fix....
No description

How can I have a "real time conversation" as a bot?

Hi, I'm trying to pretty much have a real-time conversation with a bot (powered by AI), and I'm trying to figure out how I can really do this. Maybe I can do it by voice activity (like the green bar) or by sensitivity? Please let me know for ideas! Would be amazing....

Cant play the same audio resource again

Hello i'm trying to make a bot that plays audio when someone enters the same voice with the bot here is the code https://pastebin.com/M45Ukbu7 it plays it onve when i enter but does not when i leave and rejoin instead i get this error
Error: Cannot play a resource that has already ended.
Error: Cannot play a resource that has already ended.
...

How to make a slash command allowed to be used in user dms and external servers

Title says it all, I have no clue on how to pull something like that off. Can someone point me in the right direction? Thanks in advance!

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?...