Lambo
Lambo
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Lambo on 4/19/2024 in #djs-voice
Bot Works Locally, In Production Player States Goes To Idle Straight Away?
Hi, I'm having an issue with my bot in production. It works fine locally (macOS), but in production (Docker node:20 image), the player state changes from playing to idle straight away:
2024-04-19T21:18:59.218838568Z Player state changed from idle to buffering 2024-04-19T21:18:59.219003344Z Player state changed from idle to buffering 2024-04-19T21:18:59.219081585Z Player state changed from idle to buffering 2024-04-19T21:18:59.219159240Z Player state changed from idle to buffering 2024-04-19T21:18:59.424853162Z Player state changed from buffering to playing 2024-04-19T21:18:59.424882300Z Player state changed from buffering to playing 2024-04-19T21:18:59.424931457Z Player state changed from buffering to playing 2024-04-19T21:18:59.425016947Z Player state changed from buffering to playing 2024-04-19T21:18:59.559298570Z Player state changed from playing to idle 2024-04-19T21:18:59.559400012Z Player state changed from playing to idle 2024-04-19T21:18:59.559409250Z Player state changed from playing to idle 2024-04-19T21:18:59.559414376Z Player state changed from playing to idle
2024-04-19T21:18:59.218838568Z Player state changed from idle to buffering 2024-04-19T21:18:59.219003344Z Player state changed from idle to buffering 2024-04-19T21:18:59.219081585Z Player state changed from idle to buffering 2024-04-19T21:18:59.219159240Z Player state changed from idle to buffering 2024-04-19T21:18:59.424853162Z Player state changed from buffering to playing 2024-04-19T21:18:59.424882300Z Player state changed from buffering to playing 2024-04-19T21:18:59.424931457Z Player state changed from buffering to playing 2024-04-19T21:18:59.425016947Z Player state changed from buffering to playing 2024-04-19T21:18:59.559298570Z Player state changed from playing to idle 2024-04-19T21:18:59.559400012Z Player state changed from playing to idle 2024-04-19T21:18:59.559409250Z Player state changed from playing to idle 2024-04-19T21:18:59.559414376Z Player state changed from playing to idle
This is from:
player.on('stateChange', (oldState, newState) => {
console.log(`Player state changed from ${oldState.status} to ${newState.status}`)
})
player.on('stateChange', (oldState, newState) => {
console.log(`Player state changed from ${oldState.status} to ${newState.status}`)
})
Does anyone have some pointers as to thing I should check, as to why this may occur? Thanks
12 replies
DIAdiscord.js - Imagine an app
Created by Lambo on 3/11/2024 in #djs-questions
Discord.js 14.14.1 Type Errors
Hi, I'm trying to upgrade from 14.7.1 to 14.14.1. However, when I now go to transpile my code I get 97 errors from the Discord.js typings folder. I have skipLibCheck enabled in my TSConfig, so I'm not sure what's going on here. Any ideas? (node 20.11.1)
3 replies
DIAdiscord.js - Imagine an app
Created by Lambo on 3/10/2023 in #djs-voice
No Audio Is Played
Hello! I'm new to using @discordjs/voice so I'm hoping I'm just missing something simple. I'm trying to get my bot to play a local audio file within voice. The bot joins the channel, but doesn't make a noise. This is the relevant code:
const player = createAudioPlayer({
debug: true,
});

const resource = createAudioResource(`/Volumes/Files/audio/music.ogg`);
const connection = joinVoiceChannel({
adapterCreator: channel.guild.voiceAdapterCreator,
guildId: channel.guild.id,
channelId: channel.id,
});

connection.subscribe(player);
connection.on("stateChange", (oldState, newState) => {
if (
oldState.status === VoiceConnectionStatus.Ready &&
newState.status === VoiceConnectionStatus.Connecting
) {
connection.configureNetworking();
}
});

player.play(resource);
player.unpause();
const player = createAudioPlayer({
debug: true,
});

const resource = createAudioResource(`/Volumes/Files/audio/music.ogg`);
const connection = joinVoiceChannel({
adapterCreator: channel.guild.voiceAdapterCreator,
guildId: channel.guild.id,
channelId: channel.id,
});

connection.subscribe(player);
connection.on("stateChange", (oldState, newState) => {
if (
oldState.status === VoiceConnectionStatus.Ready &&
newState.status === VoiceConnectionStatus.Connecting
) {
connection.configureNetworking();
}
});

player.play(resource);
player.unpause();
I was wondering if anyone could point me in the direction of the cause? The bot is auto-pausing so I believe it is do with the resource. Thank you! discord.js@14.7.1 @discordjs/voice@0.14.0 node v18.13.0
50 replies