Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiscordAPI Empty message error fixed #1183

Open
wants to merge 4 commits into
base: feature/empty_api
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/services/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@

if (!ffmpegInput) {
// Not yet cached, must download
const info = await ytdl.getInfo(song.url, {playerClients: ['WEB_CREATOR', 'IOS']});

Check failure on line 518 in src/services/player.ts

View workflow job for this annotation

GitHub Actions / Type Check

Type '"WEB_CREATOR"' is not assignable to type '"WEB_EMBEDDED" | "TV" | "IOS" | "ANDROID" | "WEB"'.

const formats = info.formats as YTDLVideoFormat[];

Expand Down Expand Up @@ -658,9 +658,15 @@
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',
});
}
}
}
}
Expand Down
Loading