fedimbed: dont include original platform name if its in the crawled platform name
This commit is contained in:
parent
ea63a96ec1
commit
27f8563c4f
1 changed files with 9 additions and 2 deletions
|
@ -50,6 +50,7 @@ const PLATFORM_COLORS = {
|
|||
pixelfed: 0x10c5f8,
|
||||
//cohost: 0x83254f,
|
||||
bluesky: 0x0085ff,
|
||||
nitter: 0xff6c60,
|
||||
twitter: 0xff6c60, // Nitter accent color
|
||||
};
|
||||
|
||||
|
@ -200,10 +201,10 @@ async function getCrawledData(url, color, platformName) {
|
|||
if (platformName == "<no nodeinfo>") {
|
||||
platformName = tag.$content;
|
||||
} else {
|
||||
platformName = `${tag.$content} (${platformName})`;
|
||||
platformName = tag.$content.includes(platformName) ? tag.$content : `${tag.$content} (${platformName})`;
|
||||
}
|
||||
} else if (!color && tag.$name == "theme-color") {
|
||||
color = parseInt(tag.$content.replace("^#", "0x"));
|
||||
color = parseInt(tag.$content.replace(/^#/, "0x"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1453,6 +1454,12 @@ async function processUrl(msg, url, spoiler = false, command = false) {
|
|||
platformName = crawled.platformName;
|
||||
}
|
||||
|
||||
if (platformName.includes("Nitter") && platformName.includes(" \u2022 ")) {
|
||||
const [ns, nn] = platformName.split(" \u2022 ");
|
||||
stats = ns;
|
||||
platformName = nn;
|
||||
}
|
||||
|
||||
const baseEmbed = {
|
||||
color,
|
||||
url,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue