Skip to content

Commit

Permalink
DiscordAPI Empty message error fixed ref:museofficial#1051
Browse files Browse the repository at this point in the history
  • Loading branch information
pokewizardSAM committed Dec 15, 2024
1 parent 6ec6bb8 commit f903c0f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/services/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ export default class {
private async onAudioPlayerIdle(_oldState: AudioPlayerState, newState: AudioPlayerState): Promise<void> {
// Automatically advance queued song at end
if (this.loopCurrentSong && newState.status === AudioPlayerStatus.Idle && this.status === STATUS.PLAYING) {
await this.seek(0);
await this.seek(0);
return;
}

Expand All @@ -654,10 +654,16 @@ export default class {
const settings = await getGuildSettings(this.guildId);
const {autoAnnounceNextSong} = settings;
if (autoAnnounceNextSong && this.currentChannel) {
await this.currentChannel.send({
embeds: this.getCurrent() ? [buildPlayingMessageEmbed(this)] : [],
});
}
if (this.getCurrent()) {
await this.currentChannel.send({
embeds: [buildPlayingMessageEmbed(this)]
});
} else {
await this.currentChannel.send({
content: "Queue is now empty, will leave in "
});
}
}
}
}

Expand Down

0 comments on commit f903c0f

Please sign in to comment.