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 {
|
} else {
|
||||||
const embed = {
|
const embed = {
|
||||||
title: `${PRESENCE_TYPES[activity.type]} **${activity.name}**`,
|
title: `${PRESENCE_TYPES[activity.type]} **${activity.name}**`,
|
||||||
|
fields: [],
|
||||||
};
|
};
|
||||||
const descLines = [];
|
const descLines = [];
|
||||||
if (activity.type == 2) {
|
if (activity.type == 2) {
|
||||||
|
@ -788,15 +789,18 @@ presence.callback = async function (msg, line) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activity.buttons && activity.metadata?.button_urls) {
|
if (activity.assets?.large_text && activity.type != 2) {
|
||||||
const buttons = [];
|
embed.fields.push({
|
||||||
for (let i = 0; i < activity.buttons.length; i++) {
|
name: "Large Text",
|
||||||
buttons.push(
|
value: activity.assets.large_text,
|
||||||
`[${activity.buttons[i]}](${activity.metadata.button_urls[i]})`
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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");
|
embed.description = descLines.join("\n");
|
||||||
|
|
Loading…
Reference in a new issue