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

Bot does not play any music, with no error message at all

it just shows application did not respond on discord, but no error message in terminal `` export async function execute(interaction) { const query = interaction.options.getString("query"); const songPath = audio/${query}`; ...

Audio from websites other than a file

I'm new to the discord.js voice section, and I was wondering how to make the bot play music from other websites for example Youtube or Youtube Music, I got it playing music files that are saved on my pc, but currently I'm trying to make it play music from websites, for example I do !play url and it plays the url which is the music video link.

Detect Move

How to detect if a member moved from a voice to another i tried using:
if(oldState.channelId !== null && newState.channelId !== null) {}
if(oldState.channelId !== null && newState.channelId !== null) {}
but if someone selfmute or selfdeaf them selfs it will count as a move...

not playing

```js const voiceChannel = interaction.member?.voice.channel; const connection = joinVoiceChannel({ channelId: voiceChannel.id,...

Getting poll results.

Hi there, I am trying to make a bot that makes a poll and then responds with the winning answer to the poll, How do i do this? Thanks...

vulnerable dependencies versions

When can we expect the dependencies to be updated?
No description

can we edit the voice channel status ??

How can we set the voice channel status to song title

Player state changes to "playing" when resource ends

Whenever I play a resource, I need to be able to detect when said resource stops playing in the player I play it with. However, whenever the resource ends, the player rattles off "playing" status....

encryption does not work

I am using the latest discord.js/voice 0.18.0 and sodium-native@3.4.1 but unfortunately when the bot joins the voice channel the connection is degraded from encrypted end to end to secure only.

Bot don't join VC (err: TypeError: Cannot read properties of undefined (reading 'set') )

When i try to do this ```js const connection = joinVoiceChannel({ channelId: channel.id, guildId: channel.guild.id, adapterCreator: channel.guild.voiceAdapterCreator,...

Typescript complains about adapterCreator after upgrading to v0.17.0

i updated @discordjs/voice from 0.16.1 to 0.17.0 and discord.js from 14.14.1 to 14.16.3, and now this snippet makes typescript complains about ``` Type 'InternalDiscordGatewayAdapterCreator' is not assignable to type 'DiscordGatewayAdapterCreator'. Types of parameters 'methods' and 'methods' are incompatible. ......

The bot says it's playing the audio but I can't hear anything on discord.

```ts import { createAudioPlayer, createAudioResource,...

@discordjs/opus: make: g++: Command not found

@discordjs/opus doesnt install via NPM, Gives error: make: g++: Command not found Im using a oracle linux cloud VM, I have GCC installed with version 8.5 Full error log is given in file...

bot leave voice channel after a while

My bot leaves voice channel after a while so i let him join the vc every 30m but it works only on one server it doesn't work on all servers im going to send my ready.js file because it has the joining vc code ```javascript const color = require('chalk')...

Play audio problem

Hello, I have a problem with the "@discordjs/voice" package, and the problem is in playing the sound. Well, to understand the problem, let's assume that there are two servers, the first is called Server 1 and the second is called Server 2. When I play songs on Server 1, the same song will play on Server 2. What is the solution to this problem?

FAQ: Cannot play audio as no valid encryption package is installed (After installing sodium-native)

Can someone help me on this issue? The sodium-native is already installed, but the @discordjs/voice still didn't recognize it :convit: ```ts -------------------------------------------------- Core Dependencies...

ffmpeg potential memory leak

Hello, so I'm here because I m searching what's causing these ffmpeg execution to be kept 2 hours in memory. So as I know my bot's having memory leaks and in my search to find out why I'm here to ask you about this line :
node_modules/ffmpeg-static/ffmpeg -i - -analyzeduration 0 -loglevel 0 -acodec libopus -f opus -ar 48000 -ac 2 pipe:1
node_modules/ffmpeg-static/ffmpeg -i - -analyzeduration 0 -loglevel 0 -acodec libopus -f opus -ar 48000 -ac 2 pipe:1
So I know it's ffmpeg and it's used to convert the songs into a proper way so that discord api can send it in vocal. But I'm searching how to clear them properly....

How do you get a voice channel's user list?

Hi, I'm building a bot that: can join a voice channel on slash command and: start recording the list of users that are in this channel, repeat every one second afterwhich, output the list of users to a database in the following way: for(each user){...

AudioPlayer goes from buffering -> playing -> idle and warns that resource is not playable

Hi, I have troubles for the last months with playback of resources. The source is available at https://github.com/manuel-rw/jellyfin-discord-music-bot Even though the stream URL seems correct to me, the bot goes into idle after a few milliseconds and it stays silent in Discord....