Adelto
Adelto
DIAdiscord.js - Imagine an app
Created by Adelto on 10/3/2023 in #djs-voice
Controlling volume
shit i forgor
15 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 10/3/2023 in #djs-voice
Controlling volume
oh wait
15 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 10/3/2023 in #djs-voice
Controlling volume
my code:
if (message.content.startsWith('.vsaucemeup ?c ')) {
const { joinVoiceChannel, createAudioPlayer, createAudioResource } = require('@discordjs/voice');
const channel = message.content.split(' ?c ')[1]
const connection = joinVoiceChannel({
channelId: channel,
guildId: message.channel.guild.id,
adapterCreator: message.channel.guild.voiceAdapterCreator,
});
if (channel === "leave") {
connection.destroy()
const embed = new Discord.EmbedBuilder()
.setTitle('Now not playing The Vsauce music')
} else {
const embed = new Discord.EmbedBuilder()
.setTitle('Now playing The Vsauce music')
message.channel.send({ embeds: [embed] })
const player = createAudioPlayer();
const resource = createAudioResource('songs/vsauce.mp3');
player.play(resource);
connection.subscribe(player);
resource.volume.setVolume(10);
message.channel.send({ embeds: [embed] })
player.on(AudioPlayerStatus.Idle, () => {
player.play(createAudioResource('songs/vsauce.mp3'));
});
}
}
if (message.content.startsWith('.vsaucemeup ?c ')) {
const { joinVoiceChannel, createAudioPlayer, createAudioResource } = require('@discordjs/voice');
const channel = message.content.split(' ?c ')[1]
const connection = joinVoiceChannel({
channelId: channel,
guildId: message.channel.guild.id,
adapterCreator: message.channel.guild.voiceAdapterCreator,
});
if (channel === "leave") {
connection.destroy()
const embed = new Discord.EmbedBuilder()
.setTitle('Now not playing The Vsauce music')
} else {
const embed = new Discord.EmbedBuilder()
.setTitle('Now playing The Vsauce music')
message.channel.send({ embeds: [embed] })
const player = createAudioPlayer();
const resource = createAudioResource('songs/vsauce.mp3');
player.play(resource);
connection.subscribe(player);
resource.volume.setVolume(10);
message.channel.send({ embeds: [embed] })
player.on(AudioPlayerStatus.Idle, () => {
player.play(createAudioResource('songs/vsauce.mp3'));
});
}
}
15 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 10/3/2023 in #djs-voice
Controlling volume
I got this error:
node:events:491
throw er; // Unhandled 'error' event
^

TypeError: Cannot read properties of undefined (reading 'setVolume')
at Client.<anonymous> (/home/runner/the-slave/index.js:263:23)
at Client.emit (node:events:525:35)
at Client.emit (node:domain:489:12)
at MessageCreateAction.handle (/home/runner/the-slave/node_modules/discord.js/src/client/actions/MessageCreate.js:28:14)
at module.exports [as MESSAGE_CREATE] (/home/runner/the-slave/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/runner/the-slave/node_modules/discord.js/src/client/websocket/WebSocketManager.js:354:31)
at WebSocketManager.<anonymous> (/home/runner/the-slave/node_modules/discord.js/src/client/websocket/WebSocketManager.js:238:12)
at WebSocketManager.emit (/home/runner/the-slave/node_modules/@vladfrangu/async_event_emitter/dist/index.js:282:31)
at WebSocketShard.<anonymous> (/home/runner/the-slave/node_modules/@discordjs/ws/dist/index.js:1103:51)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10)

Node.js v18.12.1
node:events:491
throw er; // Unhandled 'error' event
^

TypeError: Cannot read properties of undefined (reading 'setVolume')
at Client.<anonymous> (/home/runner/the-slave/index.js:263:23)
at Client.emit (node:events:525:35)
at Client.emit (node:domain:489:12)
at MessageCreateAction.handle (/home/runner/the-slave/node_modules/discord.js/src/client/actions/MessageCreate.js:28:14)
at module.exports [as MESSAGE_CREATE] (/home/runner/the-slave/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/runner/the-slave/node_modules/discord.js/src/client/websocket/WebSocketManager.js:354:31)
at WebSocketManager.<anonymous> (/home/runner/the-slave/node_modules/discord.js/src/client/websocket/WebSocketManager.js:238:12)
at WebSocketManager.emit (/home/runner/the-slave/node_modules/@vladfrangu/async_event_emitter/dist/index.js:282:31)
at WebSocketShard.<anonymous> (/home/runner/the-slave/node_modules/@discordjs/ws/dist/index.js:1103:51)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10)

Node.js v18.12.1
15 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 10/3/2023 in #djs-voice
Controlling volume
like createAudioResource('songs/skibidi.mp3', {inlineVolume: true});?
15 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 10/3/2023 in #djs-voice
Controlling volume
how do i make it inlinevolume???
15 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 10/3/2023 in #djs-voice
Controlling volume
so
resource.volume.setVolume(10)
resource.volume.setVolume(10)
?
15 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 10/3/2023 in #djs-voice
Controlling volume
{
inputType: StreamType.Arbitrary,
}
{
inputType: StreamType.Arbitrary,
}
ryt?
15 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 10/3/2023 in #djs-voice
Controlling volume
so
15 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 10/3/2023 in #djs-voice
Controlling volume
node v 18.12.1
15 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 10/3/2023 in #djs-voice
Controlling volume
discord.js voice latest, same with discord.js
15 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 9/27/2023 in #djs-voice
bot not joining
i think it doesnt have perms
10 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 9/27/2023 in #djs-voice
bot not joining
brb
10 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 9/27/2023 in #djs-voice
bot not joining
didnt join
10 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 9/27/2023 in #djs-voice
bot not joining
added GuildVoiceStates intent, lets see
10 replies
DIAdiscord.js - Imagine an app
Created by Adelto on 9/27/2023 in #djs-voice
bot not joining
1. No, i didnt know u had to have that, ill try that 2. yea 3. yea, its in the guild 4. yes 5. i think so yes
10 replies