Disuqi
Disuqi
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Disuqi on 9/3/2023 in #djs-questions
Multiple options but only one can be used
Is it possible to have multiple options but only one can selected/used, kind of like subcommands, but the subcommand takes in a string (like an option would).
3 replies
DIAdiscord.js - Imagine an app
Created by Disuqi on 8/31/2023 in #djs-voice
AudioPlayer not working, not sure what's wrong
this._audioPlayer = createAudioPlayer();
const connection = joinVoiceChannel({
channelId: voiceState.channelId,
guildId: voiceState.guild.id,
adapterCreator: voiceState.guild.voiceAdapterCreator
});
connection.subscribe(this._audioPlayer);
this._audioPlayer.play(url);
try {
await entersState(this._audioPlayer, AudioPlayerStatus.Playing, 5_000);
// The player has entered the Playing state within 5 seconds
console.log('Playback has started!');
} catch (error) {
// The player has not entered the Playing state and either:
// 1) The 'error' event has been emitted and should be handled
// 2) 5 seconds have passed
console.error(error);
}
this._audioPlayer.on('stateChange', (oldState, newState) => {
console.log(`Audio player transitioned from ${oldState.status} to ${newState.status}`);
})
this._audioPlayer = createAudioPlayer();
const connection = joinVoiceChannel({
channelId: voiceState.channelId,
guildId: voiceState.guild.id,
adapterCreator: voiceState.guild.voiceAdapterCreator
});
connection.subscribe(this._audioPlayer);
this._audioPlayer.play(url);
try {
await entersState(this._audioPlayer, AudioPlayerStatus.Playing, 5_000);
// The player has entered the Playing state within 5 seconds
console.log('Playback has started!');
} catch (error) {
// The player has not entered the Playing state and either:
// 1) The 'error' event has been emitted and should be handled
// 2) 5 seconds have passed
console.error(error);
}
this._audioPlayer.on('stateChange', (oldState, newState) => {
console.log(`Audio player transitioned from ${oldState.status} to ${newState.status}`);
})
The bot autopauses for no reason. Here are the logs:
Audio player transitioned from idle to buffering
Audio player transitioned from buffering to playing
Playback has started!
Audio player transitioned from playing to autopaused
Audio player transitioned from idle to buffering
Audio player transitioned from buffering to playing
Playback has started!
Audio player transitioned from playing to autopaused
├── @discordjs/[email protected]
├── @sapphire/[email protected]
├── @sapphire/[email protected]
├── @sapphire/[email protected]


v18.17.1
├── @discordjs/[email protected]
├── @sapphire/[email protected]
├── @sapphire/[email protected]
├── @sapphire/[email protected]


v18.17.1
13 replies