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

No one else can hear my music bot lagging.

Im the only one who can hear my musicbot lagging no one else does, its hosted on the same network im using discord on if that affects anything.

not playing anything

```js const { Client, SlashCommandBuilder } = require('discord.js') const { createAudioPlayer, createAudioResource, generateDependencyReport, joinVoiceChannel } = require('@discordjs/voice'); console.log(generateDependencyReport());...

Error FFmpegavconv not found!

This is my first time using this and I'm not sure if I've even done it right, I'm getting the error Error: FFmpeg/avconv not found! from: ```js...

when his bot is inside a voice channel, moving others takes about 5 seconds, whilst when it’s not in

there is a very strange bug when my bot is in vocal and that it has to move a member the action but about 5 seconds, whereas when it is not in vocal that but about 30ms SCohno

Creating-deleting vc on join-leave error

Im getting this error and it doesnt say where in the code comes from. Any idea where to look at and how to fix it? ```js /node_modules/discord.js/src/rest/RequestHandler.js:350 throw new DiscordAPIError(data, res.status, request);...

The package returns the wrong State.

When I use connection.on("stateChange"), it reports signalling and connecting before it joins, but it doesnt signal out ready when it joins the voice channel. It only reports ready when you make the bot leave the voice channel. I'm using the latest version published on NPM currently.

Bot don't plays audio

pls help me Code:```js let connection = DiscordVoice.joinVoiceChannel({ channelId: interaction.member.voice.channelId, guildId: interaction.guild.id,...

join members voice channel

how do i get the currently joined voice channel of sender and make it join and play audio there?

All element play can be inlineVolume ?

my bot can play music with a link (NOT YOUTUBE), with a file or even a stream link from a radio. Do all these elements accept the volume management (inlineVolume) directly with "createAudioResource"?

Won't play any audio

```js const connection = joinVoiceChannel({ channelId: channel.id, guildId: channel.guild.id, adapterCreator: channel.guild.voiceAdapterCreator,...

Spotify to play music

What npm package is recommended to play spotify songs?

Where can I find how long an AudioPlayer has been playing an AudioResource?

Using latest version of @discordjs/voice the closest thing that I found was AudioResource.playbackDuration but that gives the whole length of the resource, not how much has been played and how much is left to play...

Play audio from URL (mp3 stream)

Hey, I'm currently using djs v14 and djs voice to create an Audio Player playing audio from a mp3 stream. Works fine in general. However, after several minutes of playing the audio the Audio Player switches to Idle/disconnects without any error. When I try reconnecting to the stream when it switches to the Idle state it works for another few minutes. Any ideas?...

Bitrate selection

Is there an option for setting an Audio bitrate like there was in v12?

Converting opus to *.wav or *.mp3

Hello! I'm trying to receive audio and save as a *.wav or *.mp3 file. There is no documentation for this but I read some messages on discord. I tried a lot but still couldn't make it. After this code, I'm using ffmpeg to convert file. Like this: ``` ffmpeg -f s16le -y -ar 16000 -ac 1 -i test.pcm -ar 16000 -ac 1 test.wav ffmpeg -f s16le -ar 48000 -ac 2 -i test.pcm test.mp3 ffmpeg -f s16le -ar 44.1k -ac 2 -i test.pcm test.wav...

Checking if a connection is already established.

Hey there, I was just wondering if I should be checking if the bot already has an established connection before running the below code: ```js joinVoiceChannel({ channelId: channelId, guildId: interaction.guild.id,...

Does PlayerSubscription automatically destroy if I call VoiceConnection.destroy()

Or do I need to subscription.unsubscribe() to prevent memory leaks, etc

List of events emitted by AudioPlayer?

https://discord.js.org/#/docs/voice/stable/typedef/AudioPlayerEvents doesn't have any information Where is this list of all events that AudioPlayer can emit?...

voice

How do i make the bot play audio from yt?

Headers Timeout Error

```js TypeError: Cannot read properties of undefined (reading 'loadType') at Object.run (C:\Users\rudei\lavamusic-2\src\slashCommands\Music\play.js:55:17) at async Object.run (C:\Users\rudei\lavamusic-2\src\events\Client\interactionCreate.js:88:17) ee [HeadersTimeoutError]: Headers Timeout Error...