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

How do i close a receiver subscription (opus stream)

setTimeout(() => this.connection.destroy(), after); this.emit('stop-listining-stream'); console.log(this.opusStream); return this; ...

the receiver subscription (opus stream) haves the end method = 0

createListeningStream(usersIds, writeStream) { const receiver = this.connection.receiver; this.opusStream = []; // console.log(usersIds);...

Bot stops playing when rejoining another channel

My bot plays in channel1. He uses connection.disconnect() to leave a voice channel, but the connection still exists. After using connection.rejoin({ channelId: channel2.id }) in order to join another voice channel, the bot doesn't play the sound of its subscribed player anymore. But the player is playing the music. What's the solution?

Voice receiver doesn't pick up soundboard sounds

I have a pretty fancy discord bot that uses a voice receiver to pick up audio from users. const audioStream = getVoiceConnection(guildId).receiver.subscribe(userId, { end: { behavior: EndBehaviorType.AfterInactivity, duration: 100 } }); Is the very very very simplified version of it I suppose....

addition

part of index.js ```client.on('interactionCreate', (interaction) => { if (interaction.commandName === 'add') { const num1 = interaction.options.get('first-number').value;...

Retrieve voice channel reference from voice connection

I'm trying to deal with the client being dragged to a different channel. I'm using code very similar to the example in the docs with dealing with re-joins and that works, but I also store a reference to the original voice channel. I would like to update that reference, but I'm not sure how to retrieve it. I only have the voice connection state and voice connection itself...

Audio Resources immediately goes from "playing" to "idle" despite having NoSubscriberBehavior.Play

```Core Dependencies - @discordjs/voice: [VI]{{inject}}[/VI] - prism-media: 1.3.5 Opus Libraries...

Check if user is banned

I've checked online etc but can't find it I'm trying to make an unban command but when the user isn't banned and it's ran, it crashes the bot, so I'm trying to make it so it checks if the user is banned, however, I can't find out where to do that. i tried this:...

Cannot perform IP discovery

Is there a way to solve this issue without changing firewall of something? Error: Cannot perform IP discovery - socket closed By the way: for some reason, after a few trials the bot just starts....

cannot seem to download @discord.js/opus

Node v12+, Python 3+, and Microsoft Build Tools 2017+ i have already installed it. err https://sourceb.in/l5S3aPNIEn

Problem saving audioBuffer to file - whisper api

Hi, how can i convert the audioBuffer into a e.g. wav file? I want to use whisper for spech regognition....

Bot joining voice channel but not playing audio

Hi everyone. I am making a soundboard and while the bot is successfully joining the voice channel the audio file is not playing. Here are my versions +-- @discordjs/[email protected] +-- @discordjs/[email protected] +-- @discordjs/[email protected]...

Error connecting to mongodb, others

Unhandled promise rejection: Error [ShardingReadyDied]: Shard 0's process exited before its Client became ready. at Shard.onDeath (D:\Discord-Bot\node_modules\discord.js\src\sharding\Shard.js:178:16) at Object.onceWrapper (node:events:633:26) at Shard.emit (node:events:530:35) at Shard._handleExit (D:\Discord-Bot\node_modules\discord.js\src\sharding\Shard.js:439:10)...

The Voice Help

Hello, I have a question regarding the sound. My question is that I've done everything, every command, even made sure that the bot is available. However, when I type !join, the bot doesn't react at all. But when I type !play, it gives me an error message and then the bot shuts down. What could be the problem?

multiple event listeners

so this is the code i have ```js async create({ channel, member,...

Error

root@VPS-10384:~/7bLogsBot# node index node:internal/modules/cjs/loader:1137 throw err; ^ ...

Maintaining connection after restarting node

I have a bot that would connect to a channel and play sounds. I have a slash command that would play one of the few sound files I have, it works fine but when I restart node it would stay in the channel but if I try doing anything it would say that the bot isn't in a voice channel and I would have to reconnect the bot to the voice channel. I get the connection using
const connection = getVoiceConnection(interaction.guild.id);
const connection = getVoiceConnection(interaction.guild.id);
though it would still return undefined even if the bot is in the channel (This is if I restarted node when the bot was already in a voice channel) Is there a way to keep the connection even if you restart node, because I sometimes have problems when the bot is on multiple servers and I restart node. Here's the full code of the command execute function```js async execute(interaction) { try { const SoundPath = interaction.options.getString("sound-effect");...