utility.presence: use author field for custom emotes
This commit is contained in:
parent
c5825aed4d
commit
bbc7a505e4
1 changed files with 14 additions and 8 deletions
|
@ -725,20 +725,26 @@ presence.callback = async function (msg, line) {
|
||||||
for (const index in target.presence.activities) {
|
for (const index in target.presence.activities) {
|
||||||
const activity = target.presence.activities[index];
|
const activity = target.presence.activities[index];
|
||||||
if (activity.type == 4) {
|
if (activity.type == 4) {
|
||||||
let emote = "";
|
const embed = {};
|
||||||
|
|
||||||
if (activity.emoji) {
|
if (activity.emoji) {
|
||||||
if (activity.emoji.id) {
|
if (activity.emoji.id) {
|
||||||
emote = `<${activity.emoji.animated ? "a" : ""}:${
|
const url = `https://cdn.dicordapp.com/emojis/${
|
||||||
activity.emoji.name
|
activity.emoji.id
|
||||||
}:${activity.emoji.id}>`;
|
}.${activity.emoji.animated ? "gif" : "png"}`;
|
||||||
|
embed.author = {
|
||||||
|
url,
|
||||||
|
icon_url: url,
|
||||||
|
name: activity.state ?? "",
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
emote = activity.emoji.name;
|
embed.title = `${activity.emoji.name} ${activity.state ?? ""}`;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
embed.title = activity.state ?? "";
|
||||||
}
|
}
|
||||||
|
|
||||||
embeds.push({
|
embeds.push(embed);
|
||||||
title: `${emote} ${activity.state ?? ""}`,
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
const embed = {
|
const embed = {
|
||||||
title: `${PRESENCE_TYPES[activity.type]} **${activity.name}**`,
|
title: `${PRESENCE_TYPES[activity.type]} **${activity.name}**`,
|
||||||
|
|
Loading…
Reference in a new issue