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

bot keep disconnecting randomly from the voice channel

I have a bot that records the users within a channel and every 5mins a new recording is saved. What I noticed is that after (usually) 10mins the bot get disconnected without leaving any errors. Is this some sort of discord limitation and should the bot send data regularly to the voice channel to prevent this?

Slash commands

I'm new on discord.js server and i want to knoe hot to create slash commands using that library?

streaming from url

does anyone have code for a bot that streams sounds from given url (/live)

Discord voice doesn't play remote audio on linux

I have a weird behavior where playing audio from an URL works on my windows PC, but doesn't on my linux server. Basically I'm trying to play audio from this url: https://cdn.communitydragon.org/15.4.1/champion/gnar/champ-select/sounds/choose ...

How to use setTransportOptions to set voice bitrate, and 2 channel stereo

There has been a recent update to discord in which updateVideoQuality has stopped working as a way to hook, and setTransportOptions for audio channels and bitrate. I tried to look for what new function replaced it so I can write a new plugin to replace the one I use to play live music over voice chat on discord.... However, I can't find setTransportOptions in any webpack module or find out how to call it..... It is referenced in the index.js that can be found within the discord_voice module folder. Can someone please help me find what replaced this functionality????...

Decoding Opus packets from `AudioReceiveStream` using @discordjs/opus

I have a problem with decoding Opus packets received from AudioReceiveStream using OpusEncoder from @discordjs/opus. When I try to save decoded samples and play them, every player says they are corrupted. I know provided example is using prism-media for that, but this would be an overkill for me....

Audio player suddenly ends.

Audio.ts code: https://pastebin.com/WJ3TvyVc Files: picture Error: ``` 2025-02-13T16:55:53.365Z | TypeError: Cannot read properties of undefined (reading 'ended')...
No description

Player plays fine using string but not via createReadStream

No error is thrown either. Report: ``` Core Dependencies - @discordjs/voice: 0.18.0...

Errors compiling discordjs/opus for ARM64 with gcc14

Is anyone else able to compile the opus bindings for ARM64 with gcc14? Getting the following gyp error: ```js npm error ../deps/opus/celt/arm/celt_neon_intr.c: In function 'celt_pitch_xcorr_float_neon': npm error ../deps/opus/celt/arm/celt_neon_intr.c:208:18: error: implicit declaration of function 'celt_inner_prod_neon'; did you mean 'celt_inner_prod_c'? [-Wimplicit-function-declaration]...

Player State = idle

Why does the track ends automatically after some time of starting. It's a live stream url. It plays fine for few secs/mins then track ends usually like idle....

No audio on Windows 11 when playing mp3 file

(following the official guide in https://discordjs.guide/voice/audio-resources.html) I was setting a simple command for playing an .mp3 file (readed that FFmpeg can handle it), but no sound is heard in the voice channel. The bot can join the channel without any errors and load the file, but it 'pauses' the music the instant it joins. I also tried with other file types like Ogg or the recommended Opus versions. Nothing worked. I made all the code in the command file (i thought it was okay and didnt require to made changes to the main.js file). The bot has admin permissions just in case....

RangeError: offset is out of bounds [@discordjs/opus]

Gathering a RangeError when attempting to play a shoutcast live stream [AUDIO ONLY], the bot has been playing stations like a charm for the past 7 months with no issue and recently arised, not sure what happened and even checked via ffmpeg stats and attempted to see the connection but it looks the same, 48000hz. Looks like its for buffering although not sure what the functionality behind it does at all in order to attempt to manually fix it. ```js [ UNCAUGHT EXCEPTION ] → RangeError: offset is out of bounds at Uint16Array.set (<anonymous>)...
No description

Inline Volume not working after starting to play the resource

Hey, I have a problem. The inline volume seems to not work after playing the resource. It was working before but now it doesn't work anymore. Here's the code : ...

Am I missing something completely?

Bot will join voice channel but wont play music. ```js const { SlashCommandBuilder,...

No audio on Ubuntu 24.04

Hey everyone. I Have installed the newest versions avaliable basically and ubuntu does not like npm install @discordjs/opus no idea what i missing.

No music playback on arch linux.

Hey I'm on a arch linux pc, and when I try to do playback of an url the bot just joins the voice channel, goes into Playing Status, and after like 100ms it goes back to idle. The thing is the exact same code works perfectly fine on my debian server. I tried searching in the web and also asked GPT, but after 3 hours of no result I'm asking here....

Trying to make my bot play .mp3 for directory

Hi ! My bot is successfuly doing everything exept playing any sound : If anyone have an idea .. 🙂...

Error with createAudioResource()

hey, i would like some help for my discord bot, i have been trying to code music command to play music in voice channels, but i am encountering an issue, and its been 11 hours since i have been trying to fix it

Query

How to update volume of a running audio track also to seek it? I checked out the docs, didn't help me....

Audio Issues

```js if(!args.join(' ')) return message.reply("Please type song name.");
let api = require(process.cwd()+'/structures/api')...
Next