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

Listen to user vocal input using connection

hey, i couldn't find any reliable form of making the client listen to vocal input when its connected. can i have some guidance about it?...

im getting the classic AudioPlayerError: aborted.

Error: ```javascript AudioPlayerError: aborted at connResetException (node:internal/errors:691:14)...

another bot not joining the voice channel

Hi there, im learning my way through the docs and making my first bot, i was following line by line the basic example repo from discord/voice (https://github.com/discordjs/voice-examples/blob/main/basic/src/main.ts) but its not working, its basically the same code minus the formatting and the difference in current Status comparison since it seems the deesctructuring of Constants for Events, Status is not longer used... the code logs is ready to play but when i type -join on the chat it doesnt respond at all, is it because of the intents? ```ts const client = new Client({ intents: [...

Weirdest bug i've encountered, probably need a discordjs/voice contributor help here.

Hello, i made a discord player for playing music and tts messages. the youtube way: get stream from ytdl with filter audioonly, and inserting to queue the AudioResource using createAudioResource(stream). then to play (in short) i basically do connection.connect(player), and player.play(resource)....

Destroy player when session is finished.

Hello, i wanted to know if there's a way for the player to stop playing completely once i've finished with my session manually (like removing the bot from the conversation). i cleared the queue and added player.stop() alongside with prehamptive connection.destroy() but it seems its still 'playing'. any helpers? 🙂

Bot disconnects from vc after a few days on external host

My bot disconnects from a voice channel after a few days (no specific number). At the same time, the bot's presence gets removed. I'm not sure whether it had something to do with Discord.js or with the hosting service, so I'm asking the question here first.

AbortError: The operation was aborted

I have a bot, which is playing music. It connects to the channel and also plays the music but sometimes there is the following error and the music stops playing but the bot is still in the channel ``` AbortError: The operation was aborted at AbortSignal.abortListener (node:events:958:14)...

[SOLVED] 🤦Bot doesnt join the voice channel

So I have the following code, when its being executed, the bot doesnt join the voice channel. ```js const { joinVoiceChannel, createAudioPlayer, createAudioResource, StreamType } = require("@discordjs/voice") const { join } = require("node:path")...

How do I make an event listener for when someone speaks?

I want to make an event listener similar to how the make events in the discord.js guide const { Events } = require('discord.js'); module.exports = { name: Events.ClientReady,...

subscribe a connection and convert pcm buffer response to mp3

Hi ! I want to convert this result : ```js const receiver = connection.receiver.subscribe(userId, { mode: 'pcm'...

Incorrect client joins channel when using joinVoiceChannel()

[email protected] npm v18.16.0 I have multiple clients logged in and I am trying to connect specific ones to different voice channels. The first time I do this it works fine; the correct bot (Loudspeaker 4) joins the correct channel....

[SOLVED] Playback ends after ~1 minute without any errors emitted

Title. It sometimes becomes Autopaused, sometimes not. It eventually becomes Idle after a few minutes. No errors are emitted from the player nor the connection. Any ideas on how I can get more information on what's going wrong or any solutions to problems I have overlooked? Thanks. The bot's connection and player are being initialized like this:...

Audio Player state changes to playing when resource ends

I am creating an audio resource from a ytdl download, and when I play this resource on the player with player.play(resource)the players state is set to "buffering", once the resource stops playing in the voice channel the players state changes to "playing". I am listening for when the player goes idle to queue the next song, however it never goes idle. My code is below: ```ts const audio = ytdl(song, { filter: 'audioonly' }); const connection = joinVoiceChannel({...

Won't play if source takes long to send more data

When trying to play a big stream, which the speed is 30kbps, I was getting an issue where djs voice would send a trackEnd even though the stream is 2h long, and I saw that in hosts with a better connection (my internet is 200mbps, can't be slow wifi) it would work properly The workaround I found was to use a setTimeout to 500ms, but I wonder if adding an option to add a length to the createAudioResource which it will only stop sending data when it finishes that length, and till it doesn't, it will wait next data. But I'd like to see how can I really fix this, since setTimeout isn't a good fix since will slowdown it whenever the source is fast or not...

Won't play please help

```js const { joinVoiceChannel } = require('@discordjs/voice'); let channel = '1107089389345067008'; joinVoiceChannel({...

Error Spawn E2BIG

no idea what this indicates

How do I even begin to do this

I want to do this but it's all to hard to understand I don't really want to use ffmpeg if anyone wants to give me a more simple tutorial please do

Say smthing in vocal to text.

Hi I want to keep the text that i said in vocale with this code : ```js joinVoiceChannel({ channelId: message.member.voice.channel.id,...

I have a question. Why doesn't my bot turn on music if there are no errors and it is connected?

```js const player = createAudioPlayer(); const resource = createAudioResource('/root/Alesha_test/src/music/Розовый фламинго.mp3', { inlineVolume: true }); resource.volume.setVolume(0.5); player.play(resource);...

Voice memory leaks

so i am trying to find an optimized way to handle multiple users speaking, since constanty using .subscribe on speaking.on("start") kinda causes memory leaks, my idea is to just once initialize .subscribe and constantly listen to a user (saves to array of buffers) (with their permission ofc, have command for that), and to then use speaking.on("start") and speaking.on("stop") to cut recording in exact piece (start - clear array, stop - turn into mp3, clear array)