SpotifyShareCommands: correctly handle local tracks (#3592)
This commit is contained in:
parent
c7e799e935
commit
7e028267f1
1 changed files with 8 additions and 1 deletions
|
|
@ -46,7 +46,7 @@ interface Artist {
|
|||
}
|
||||
|
||||
interface Track {
|
||||
id: string;
|
||||
id: string | null;
|
||||
album: Album;
|
||||
artists: Artist[];
|
||||
duration: number;
|
||||
|
|
@ -71,6 +71,13 @@ function makeCommand(name: string, formatUrl: (track: Track) => string): Command
|
|||
});
|
||||
}
|
||||
|
||||
// local tracks have an id of null
|
||||
if (track.id == null) {
|
||||
return sendBotMessage(channel.id, {
|
||||
content: "Failed to find the track on spotify."
|
||||
});
|
||||
}
|
||||
|
||||
const data = formatUrl(track);
|
||||
const message = findOption(options, "message");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue