discord.js - Imagine a 👻

DIA

discord.js - Imagine a 👻

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

Join

djs-questions

djs-voice

The bot is stuck at the "connecting" state and not going to the "ready" state

I am really sorry for reopening. I tried adding the debug console but wasn't able to identify the error, I was convinced that it was fixed when I saw my bot enter the "ready state" on the debug console. But the thing is, the bot only enters the ready state when it leaves the vc, but it stays in connecting state when its in the vc

The bot is stuck at the "connecting" state and not going to the "ready" state

Hello, I am not really sure why the bot is staying in the connecting state and not moving to the "ready state" How do I solve this? If there is any additional info I need to provide, please let me know...
No description

Issues with getting an guild ID

Hello! I'm trying to receive an guild ID using the @discordjs/voice package, but everytime I try to request it it returns with undefined, so ofcourse it doesn't work. How can I make it work?

Get if audio is played in connection in other file.

Hello, i have music bot with commands in separate files i want to see if audio from mp3 is played in other commands is thia possible?

Local Audio Streams

I've been trying for the last 4 hours to try and get local audio files or audio streams to work with djs and im still quite lost. I've tried everything and read the docs, im just not understanding how to do this. All I want for now is to play a local audio file in a voice channel, so that I can move forward I've gotten some weird errors, but I feel like Im going about this all wrong. Help very much needed...

Question regarding djs/voice

My Boss asked me if its possible to set User Agents in djs/voice but im not sure it this is a thing.

Error: Cannot find module 'C:\Users\rocko\Desktop\.ospreyMusic\node_modules\@discordjs\voice\dist\in

I have installed it but idk why its doing this with just const { joinVoiceChannel } = require('@discordjs/voice');

Controlling volume

suppose this is my code:
const resource = createAudioResource('songs/skibidi.mp3');
const resource = createAudioResource('songs/skibidi.mp3');
how do i make this audio inline and how to control its volume? Also, what does inline audio do?...

Issue w/ Opus -> Ogg recording voice with prism-media@v2.0.0-alpha.0 - ERR_REQUIRE_ESM

I was trying to follow this example recording voice demo (https://github.com/discordjs/voice-examples/blob/main/recorder/src/createListeningStream.ts#L19C1-L27C5), but I'm running into the following error: ``` 👂 Listening to dimsey8_0 Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/user/Desktop/unicorn/Voice/node_modules/node-crc/lib/lib.js from /Users/user/Desktop/unicorn/Voice/node_modules/prism-media/dist/ogg/OggLogicalBitstream.js not supported. Instead change the require of lib.js in /Users/user/Desktop/unicorn/Voice/node_modules/prism-media/dist/ogg/OggLogicalBitstream.js to a dynamic import() which is available in all CommonJS modules....

Bot don't play audiostream (shoutcast)

Hi, I'm trying to play an audio stream from a shoutcast server in my bot but Idk how to do it, this is the code Node V: v20.2.0 discord.js@14.13.0 ```js const { Client, GatewayIntentBits, ActivityType} = require('discord.js');...

Bot joining but not playing

```js const Discord = require('discord.js'); const { joinVoiceChannel, createAudioPlayer, createAudioResource } = require('@discordjs/voice'); ...

bot not joining

djs v14, voice 0.16 & node v18.12.1 i did try to console.log - here's my code: ```js if (message.content.startsWith('.vsaucemeup')) { const { joinVoiceChannel, createAudioPlayer, createAudioResource } = require('@discordjs/voice');...

Find music but don't play

```js import { EmbedBuilder } from 'discord.js'; import { joinVoiceChannel } from '@discordjs/voice'; import { Default } from '../../../../botconfig.json'; const { formatDuration } = require('discord-player-plus')...

Yet another "no voice" thread

Hi, I'm trying to write my first Discord bot. I'm struggling with playing a sound in voice channel. I've read many posts here about the bot not playing any audio, but haven't found any solution. One strange thing I've found while debugging is, the bot switches to Idle state immediately after switching to Playing state, but I can;t figure out what's wrong. Here's my code (I've simplified it in order to create a minimal failing example) Dependency report: ``` Core Dependencies...

Audio not playing

The bot joins the vc correctly, but the audio is not playing. What am I missing? node v: v18.16.1 ; discordjs: 14.13.0...
No description

Fetch palyer from voiceConnection

Is there any way to get or fetch the player which a voiceConnection has subscribed?

Having an issue during installation

https://hastebin.com/share/vivaluruqo.ruby Tried to look for other people who may have asked the same question and tried to parse the error message myself yet cannot seem to figure out why it's not working or more specifically how to resolve the issue....

Bot Joins Voice Channel but Doesn't Play Audio File (ogg)

I managed to get the bot to join the vc but it just sits there. Here's the code: ``` const resource = createAudioResource('./sounds', theNumber + '.ogg'); currentPlayer = (currentPlayer+1) % NUM_PlAYERS; const channel = message.member.voice.channel;...

Create a "radio"

I'm trying to create a radio, or soundboard of sorts. A place where I can select the songs or sounds I want, and have it be played by the bot. I'm probably overthinking this or structuring it wrong. But my idea would be to have a constant stream the bot is playing, so I can append audio buffers to it (from a folder). I'd probably be better off with creating a new player every time, but I want to merge tracks together, have it played on top of one another. I already have a Readable stream the bot can play, but when I append a single track to it, it thinks the Readable is finished playing and the bot goes idle (I can't play the resource again). Essentially it should behave like a radio. I even tried appending silence to it so it's not "empty". I don't know how to approach this...

Trying to play a local wav file in a vc but it doesn't play more than a min.

Trying to play a local wav audio file in a vc but it doesn't play for more than a min even though the actual file is of 3 mins. Code: ```js if (GuildVoice.has(message.guild.id)) return message.reply("Sorry! already in another voice channel");...