utility.presence: link spotify tracks

This commit is contained in:
Cynthia Foxwell 2023-09-28 22:31:21 -06:00
parent 964dc27308
commit 179d4599e5

View file

@ -1073,7 +1073,13 @@ presence.callback = async function (msg, line) {
}; };
const descLines = []; const descLines = [];
if (activity.type == 2) { if (activity.type == 2) {
if (activity.details) descLines.push(`**${activity.details}**`); if (activity.details) {
let details = activity.details;
if (activity.name == "Spotify" && activity.sync_id) {
details = `[${details}](https://open.spotify.com/track/${activity.sync_id})`;
}
descLines.push(`**${details}**`);
}
if (activity.state) descLines.push(activity.state); if (activity.state) descLines.push(activity.state);
if (activity.assets?.large_text) if (activity.assets?.large_text)
descLines.push(activity.assets.large_text); descLines.push(activity.assets.large_text);