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

Spotify music bot not playing audio

Hey everyone, So after realizing both the youtube aspect and soundcloud aspect of a music bot is against TOS, i'v removed both parts of my code. But i've still not resolved the issue of it not playing audio at all. Everything seems to be working, but the bot it doesn't start playing audio when coming into the voice channel. I get no errors or anything....

Cannot play .mp3 user attachments

Hi there, this command is supposed to allow the user to upload a .mp3 file for the bot to play, but I cannot get it to work. Here's how I wanted to work. 1. User requests /playmp3 and has the option to upload an attachment (.mp3) to play (see photo for example). 2. The bot then plays that given .mp3 file in the voice channel. ...

Player emit idle event without playing

```js let connection = joinVoiceChannel({ channelId: voiceChannel.id, guildId: voiceChannel.guild.id, adapterCreator: voiceChannel.guild.voiceAdapterCreator,...

audio file that does not play from the beginning, skips and stops after a few seconds.

Hello, I have a problem using discord.js and discordjs/voice I want to play audio files from my server (locally where the discord bot is) The bot connects well in voice, the reading of the file is done well too. But playback does not start from the beginning of the audio file. The music skips and after a few seconds of listening, the music stops. I can't fix this....

Getting user's speaking data that are connected to the same voice channel as the bot.

Hi! I am trying to make a speech to text bot but i have difficulties to get speaking data... i have almost everything i want but cannot get something working like voiceConnection.on("speaking", ...) or anything like this. If a bot is in a voice channel how can i add the functionality of getting each speaking user's voice data/packets? Is it even possible? I am trying to figure it out but cannot find a way... "dependencies": { "@discordjs/voice": "^0.16.0", "discord.js": "^14.11.0",...

Error

Error: Cannot find module '/root/7bLogsBot/node_modules/@discordjs/opus/prebuild/node-v108-napi-v3-linux-x64-glibc-2.31/opus.node' Require stack: - /root/7bLogsBot/node_modules/@discordjs/opus/lib/index.js - /root/7bLogsBot/index.js at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)...

Event not triggered in server

All events are not firing in the server, but working fine locally

djs/voice sending end if too slow to get data

I've gotten a persistent issue that, whenever I try to play (URL/online only!) something and it takes a bit longer to retrieve from the website, it already sends a end event. this could be fixed by maybe providing the ability to control whenever start/stopping sending packets (and will allow more things to be done without many issues) As long as it works.. it's fine...

error

pls help
No description

@discord.js/opus vulnerability in dependencies

npm audit report semver <7.5.2 Severity: moderate semver vulnerable to Regular Expression Denial of Service - https://github.com/advisories/GHSA-c2qf-rxjj-qqgw...

Not hearing audio

Any idea why? ``js // Load up the discord.js library const glob = require("glob") // This is your client. Some people call it bot, some people call it self`, ...

Error: Cannot probe a readable stream in object mode

I'm getting this error when trying to create the audio resource for a track, my current code is: ```js // YouTubeMusicPlatform.openStream openStream(track: Track): Promise<Readable> { return new Promise((resolve, reject) => { ...
No description

Custom TTS bot cutting off early

I made a TTS bot earlier today and I’ve been trying to use it and it works and it creates the audio files and play them, however, it cuts off early like 95% of the time, but the audio file is fine, so it’s the bot who keeps cutting off, I’m using discordjs/voice and ffmpeg-static, idk what to do https://pastebin.com/giHPa0bW...

Not receiving events

so im trying to listen to voice events but i dont receive anything. I don't receive speaking events nor the received bytes... what could it cause? the bot is in my voice call and its not deafened AscShrug the code snippet: ```ts const connection = joinVoiceChannel({...

Opus not working on mac

When trying to use opus, I keep getting these errors when it attempts to install. When googling the issue, I found this github issue saying its something related to m1 macs and a certain PR fixed it. but its still there.
No description

Trying to make a tts join command, getting invalid string format error

I'm currently trying to use a SlashCommandBuilder to make a command that will make the bot join the vc and begin reading messages, however I keep getting invalid string format when I try deploying the command ```js const { SlashCommandBuilder, ChannelType} = require('discord.js'); const { joinVoiceChannel, VoiceConnectionStatus, AudioPlayerStatus, VoiceConnection, getVoiceConnection, createAudioResource, createAudioPlayer, NoSubscriberBehavior} = require('@discordjs/voice') ...

interaction.guild.members.me.voice.channel gives null response?

Tried grabbing the voice channel ID from where the bot was at, and I keep getting null or it won't change when the bot joins a new vc. ```js const { SlashCommandBuilder } = require('discord.js'); const { getVoiceConnection } = require('@discordjs/voice') ...

bot

how to make the bot 24 hours in voice channel

Creating a leave voice channel command for a bot

I have a working join command for discordjs v14, so now I'm trying to make a working disconnect command. code is here: ```js const { SlashCommandBuilder, ChannelType} = require('discord.js'); const { joinVoiceChannel, VoiceConnectionStatus, AudioPlayerStatus, VoiceConnection, getVoiceConnection, createAudioResource, createAudioPlayer} = require('@discordjs/voice') ...

Stop streaming audo after a short time

Hello I have a bot who stream audio in a channel but it work but in a coupe minute it will stop playing for no reason. There no visible erreur on the terminal... ```js this.on = true ;...