From c5825aed4dc36db8faec0d6ae50b22448d1287d6 Mon Sep 17 00:00:00 2001 From: Cynthia Date: Thu, 12 Jan 2023 23:44:53 -0700 Subject: [PATCH] utility.presence: add image texts --- src/modules/utility.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/modules/utility.js b/src/modules/utility.js index 351eaf7..b1eaa2d 100644 --- a/src/modules/utility.js +++ b/src/modules/utility.js @@ -742,6 +742,7 @@ presence.callback = async function (msg, line) { } else { const embed = { title: `${PRESENCE_TYPES[activity.type]} **${activity.name}**`, + fields: [], }; const descLines = []; if (activity.type == 2) { @@ -788,15 +789,18 @@ presence.callback = async function (msg, line) { } } - if (activity.buttons && activity.metadata?.button_urls) { - const buttons = []; - for (let i = 0; i < activity.buttons.length; i++) { - buttons.push( - `[${activity.buttons[i]}](${activity.metadata.button_urls[i]})` - ); - } + if (activity.assets?.large_text && activity.type != 2) { + embed.fields.push({ + name: "Large Text", + value: activity.assets.large_text, + }); + } - descLines.push(buttons.join(" | ")); + if (activity.assets?.small_text) { + embed.fields.push({ + name: "Small Text", + value: activity.assets.small_text, + }); } embed.description = descLines.join("\n");