Don't copy URL previews for GitHub

This commit is contained in:
Cadence Ember
2026-10-06 15:27:17 +02:00
committed by N0VA
parent d9e93a8554
commit 9994db94e6
+4
View File
@@ -1076,6 +1076,10 @@ async function messageToEvent(message, guild, options = {}, di) {
continue // If discord creates an embed preview for a discord channel link, don't copy that embed continue // If discord creates an embed preview for a discord channel link, don't copy that embed
} }
if (embed.provider?.name === "GitHub") {
continue // GitHub url previews are very large and fairly useless
}
if (embed.url && spoilers.some(sp => sp.match(/\bhttps?:\/\/[a-z]/))) { if (embed.url && spoilers.some(sp => sp.match(/\bhttps?:\/\/[a-z]/))) {
// If the original message had spoilered URLs, don't generate any embeds for links. // If the original message had spoilered URLs, don't generate any embeds for links.
// This logic is the same as the Discord desktop client. It doesn't match specific embeds to specific spoilered text, it's all or nothing. // This logic is the same as the Discord desktop client. It doesn't match specific embeds to specific spoilered text, it's all or nothing.