discord.js - Imagine an app

DIA

discord.js - Imagine an app

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

Join

djs-questions

djs-voice

Voice player sometimes doesn't start playing music

Hi, like the title says, the voice player randomly doesn't start playing music The code responsible for it is the boilerplate from https://discordjs.guide/voice/audio-player.html#playing-audio modified only by a 20sec timeout which just disconnects the bot: ```js...

Bot joins but does nothing

code: ```js const player = createAudioPlayer({ behaviors: { noSubscriber: NoSubscriberBehavior.Pause,...

i don't know, never happened before

Error: Cannot find module 'D:\test\vv\node_modules@discordjs\voice\dist\index.js'

Can't install on Node JS 20

When installing I get this error (Check Attached File) It also seams that there are no prebuilt binaries for Node JS 20 Node JS Version: v20.9.0...

Voice keeps crashing

I saw the faq post and i already have and tried 0.16.1 of discord js voice but it still keeps disconnecting and crashing with a error, its completly random at times it can play entirely or only work for a few secs before it crashes and yes i checked the file and it indead says its on version 0.16.1 and i am using discordjs 14.13.0 Here is the error code: `AudioPlayerError: aborted...

TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buff

```js const con = joinVoiceChannel({ channelId: interaction.member.voice.channel.id, guildId: interaction.guild.id, adapterCreator: interaction.guild.voiceAdapterCreator,...

How to make the bot leave a voice chat?

I have tried several options: ```js let connection = getVoiceConnection(interaction.guild.id); if (connection === undefined) { await interaction.reply("I am not in a vc!");...

ETIMEDOUT Exception Error (voice server connection issue)

Hi there, I have this problem that occurs randomly and caused my entire bot to crash. I'm looking for ways to either prevent this issue or handle it so it doesn't cause a complete bot crash. Just to be clear, I don't have any issues with my bot connection to voice channels or anything like that, this error just occurs randomly. Any help is greatly appreciated. The blurred part is an IPV6 IP (most likely the voice server IP)....
No description

Play Sound from URL

Hi, ive created a command to have the bot on a voice channel, it works but i want to play a sound from an url but i dont realy know how to do this, i found some infos on the web about playing an audio from a file but not from a link

Music bot autopause

Info: I am running this locally using node index.js. I have given the bot admin permission. I have added the GuildVoiceStates to the GatewayIntentBits. I have checked all 3 of the Privileged Gateway Intents found in the discord portal....

cannot hear my bot

Hi. I found my old "play-mp3" command. However, when I tried it out it didn't play any audio. The code doesn't throw any errors. Now I have no idea whether it's me or the bot. ```js const { SlashCommandBuilder } = require('@discordjs/builders'); const { joinVoiceChannel, createAudioPlayer, createAudioResource } = require('@discordjs/voice'); const { ChannelType, EmbedBuilder } = require('discord.js');...

STT

I would like to make a bot that listen to voice orders. Any idea how to ?...

Relay audio from a channel to another

Hi, i'm creating a bot with discord.js v14 that has to relay the voice of an user in a channel to another channel in another server, i can't figure out how to play the stream from connection.receiver.subscribe(userID).

Help with discord js voice

```js arsb!ceval let mod = require("@discordjs/voice") let player = mod.createAudioPlayer(); console.log(player) mod.joinVoiceChannel({channelId: "1079420517523669133", guildId: message.guild.id, adapterCreator: message.guild.voiceAdapterCreator}).subscribe(player)...

how to fix error "Cannot performIP discovery socket closed"

Hello, I am getting the error below when connecting to a voice channel for a while. I don't know if there is any way to fix it? ```js Unhandled promise rejection: Error: Cannot perform IP discovery socket closed...

Player Auto-Pause

I have this music bot and I want it to pause the playback if it's alone in the voice channel. I've succeeded in doing that, but rn it pauses instantly after detecting that it's alone and I want it to wait for 3 seconds before doing that, so that if anybody joins during that time interval the bot doesn't need to pause. here's the code currently: ```js client.on('voiceStateUpdate', (oldState, newState) => {...

TTS

i want to create a simple discord bot, that will read user messages in specific channel and bot will use TTS in voice channel to read user message. so basically if user joins - bot joins also and should play TTS with the message. but it doesnt work for me - bot joins after sending a message but its not playing TTS. any ideas? Code:...

Automatically join voice channel

when user click the text(see the attached image), should automatically join the voice channel Thank a lot...
No description

@discordjs/opus is not installing

I tried sudo, reinstalling node and readding discord.js to my package.json, nothing works, I am using the latest node js, npm, and latest discordjs version