Skip to content

Commit 4dc862e

Browse files
committed
Fix .audio identify erroring when no platforms are found
1 parent 46f015e commit 4dc862e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/api/types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,11 @@ export namespace RestResponses {
488488
export namespace RestResponsesRaw {
489489
export interface AudioToolsIdentifySong {
490490
album: {name: string},
491-
artists: Array<{name: string}>,
491+
artists: Array<{
492+
langs?: Array<{name: string, code: string}>,
493+
name: string,
494+
roles?: Array<string>,
495+
}>,
492496
duration: number,
493497
exids: string | null,
494498
genres: Array<string>,

src/utils/formatter/commands/audio.identify.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ export async function createMessage(
101101
if (song.platforms.youtube && song.platforms.youtube.url) {
102102
urls.push(Markup.url('YouTube', song.platforms.youtube.url));
103103
}
104-
embed.addField('Platform Links', urls.join(', '));
104+
if (urls.length) {
105+
embed.addField('Platform Links', urls.join(', '));
106+
}
105107
}
106108

107109
{

0 commit comments

Comments
 (0)