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

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 [email protected] - 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 [email protected] ```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");...

Script plays local files well but can't play url streams, why?

```js const Discord = require('discord.js'); const { Client, GatewayIntentBits } = require('discord.js'); const client = new Client({ intents: [ ...

Error [ERR_STREAM_WRITE_AFTER_END]: write after end

write after end Error [ERR_STREAM_WRITE_AFTER_END]: write after end at new NodeError (node:internal/errors:372:5) at _write (node:internal/streams/writable:320:11) at Socket.Writable.write (node:internal/streams/writable:335:10)...

15 second pause when initializing Decoder

i am trying to use @discordjs/voice's prism-media package to convert the data into pcm and i noticed that the first time the decoder is constructed it takes around 15.5 seconds and then works just fine. Am i missing something or is it meant to be that slow?

The system does not work when the bot is on have voice channel and when someone enters the sound

When i put the bot in the voice channel with the command, the command does not work when someone comes or when someone enters the voice normally, the bot enters the voice and plays the mp3, if they exit and enter, the bot stops talking

My bot doesn't play any sound, he has permission to speak and the intents

My bot doesn't play any sound, he has permission to speak and the intents ```const { joinVoiceChannel, createAudioResource, createAudioPlayer } = require('@discordjs/voice'); const voice = require("@discordjs/voice");...