utility.presence: add image texts
This commit is contained in:
parent
7cecf20a9d
commit
c5825aed4d
1 changed files with 12 additions and 8 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue