Merge branch 'master' into feature/slash-commands

This commit is contained in:
Max Isom 2022-01-29 22:03:58 -05:00
commit d1228eb641
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880
4 changed files with 35 additions and 22 deletions

View file

@ -57,13 +57,11 @@ export default class {
}
async connect(channel: VoiceChannel): Promise<void> {
const conn = joinVoiceChannel({
this.voiceConnection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
this.voiceConnection = conn;
}
disconnect(): void {
@ -98,7 +96,12 @@ export default class {
}
const stream = await this.getStream(currentSong.url, {seek: positionSeconds});
this.audioPlayer = createAudioPlayer();
this.audioPlayer = createAudioPlayer({
behaviors: {
// Needs to be somewhat high for livestreams
maxMissedFrames: 50,
},
});
this.voiceConnection.subscribe(this.audioPlayer);
this.audioPlayer.play(createAudioResource(stream, {
inputType: StreamType.WebmOpus,
@ -145,7 +148,12 @@ export default class {
try {
const stream = await this.getStream(currentSong.url);
this.audioPlayer = createAudioPlayer();
this.audioPlayer = createAudioPlayer({
behaviors: {
// Needs to be somewhat high for livestreams
maxMissedFrames: 50,
},
});
this.voiceConnection.subscribe(this.audioPlayer);
const resource = createAudioResource(stream, {
inputType: StreamType.WebmOpus,