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

Audio duplication issue

I am working on a bot that will do, among other things, voice call recording. Something really strange is happening where I'm getting multiple copies of the same audio in different individual output files (I know this because I transcribe and store the individual files as text in a DB using OpenAI). When mixed together, it creates a weird echo effect. My question is, when subscribing to the "start" event, should I be checking the SpeakingMap to see if something is already registered for a user? Or is there something else I'm doing wrong here? Code is at the link below: https://github.com/brad95411/breadbot-public/blob/934fa4d37f62af83ee6e988c05156e8fdb7350b3/breadbot.js#L126...

Audio file does not play

Hello, I'm trying to play a sound, but nothing happens when it enters the scope where i call the play, any idea ? Here is the code : https://pastebin.com/tQGhRGTS connection is made at line 47 sound is played at line 113...

Send audio from one channel to another one in another guild

Hi, I'm currently making a discord bot about game events utilities, and I had an idea. Basically I want to create a command to make the bot join a voice channel, and mirror the audio to another voice channel. Is this possible? And if yes, is there some basic documentation about this sort of thing?...

discord.js and deno

Is the voice library supported with Deno? I am getting a weird error 'sig is not defined' when trying to run the example code from the docs with Deno. Thanks for the help!...

forcefully stopping player

hey i just wanted to know if theres a way to forcefully stop playing a resource for example
player.play(createAudioResource(audioPath));
player.play(createAudioResource(audioPath));
...

Problem with play cmd

```if (msg.content.toLowerCase().startsWith(';play')) { const voiceChannel = msg.member.voice.channel; if (!voiceChannel) { return msg.reply('be in vc');...

Voice connection dropping after 3-5 min with ECONNRESET error

Error: node:events:495 throw er; // Unhandled 'error' event ^ ...

Trying to delete messages that don't contain images and it's not deleting them

Why doesn't this work? There are no errors in the console

question about voice receiver

hey im trying to make a voice recorder bot and i just wanted to know the stream of audio which i get from connection.receiver.speaking.on(start) event, it only emits when someone is speaking and is "silent" or doesnt emit when no one is speaking, and it only lasts for the duration of someone is speaking right?

How to get access to player from different file

So I'm making a music bot and I wanted to have a slash command that makes the bot skip to the next song, but I'm having problems with getting access to the player object created in another file, what can I do? My two slash commands where one is the function that searches for a song and then plays it and the other one is to skip are in the same directory and I tried foing this: ```javascript //main command (search.js) const player = createAudioPlayer();...

How to remove event listener from player

code: ```javascript async function reproduceSong(interaction, connection, player, channel) { if (sp > 0) { try {...

Cannot stream an audio stream on ubuntu 22.04 but on windows.

Hey everyone I got following issue: I want to stream an audio stream via URL to a voice channel. Everything works perfectly fine on Windows, but once I run the code on an ubuntu 22.04 server the audiostream has a readableLength of 0. If I only play mp3 file that are saved locally it works. The only issue are audio streams via URL....

Tried to make voice listener in a VC and it didn't log anything

```js const { AudioReceiveStream, joinVoiceChannel, EndBehaviorType, VoiceReceiver } = require('@discordjs/voice'); const { EmbedBuilder } = require('discord.js'); const axios = require("axios").default; const fs = require("fs");...

mp3

hello i have a mp3 file how to make the bot play that file ?

help

can anyone help me ?
No description

piping from udp stream into an audio resource

hello! i've been trying to write a bot to pipe desktop audio to a discord bot over udp (i use linux so this is my jank workaround to not having screen share audio), and i've settled on using dgram to open a udp socket and running ffmpeg locally to push to it (the full command is ffmpeg -f pulse -i default -f opus "udp://127.0.0.1:3756", and the local ip is fine for now since both the stream and bot are running on the same machine).