Skip to content

Commit c7a1ee5

Browse files
committed
fix: embed fixer extract multiple urls but only return last one
1 parent 20dbec8 commit c7a1ee5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/features/fix/embedFixer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function applyFix(message: Message): void {
138138
for (const fix of fixer.fixes) {
139139
if (checkUrlDomain(cleanUrl, fix.originalDomain)) {
140140
const new_url = replaceDomain(cleanUrl, fix.replacementDomain);
141-
fixed_urls.push(`[Preview Embed URL](${new_url})`);
141+
fixed_urls.push(new_url);
142142
}
143143
}
144144
}
@@ -148,7 +148,9 @@ function applyFix(message: Message): void {
148148
message.suppressEmbeds(true);
149149

150150
message.reply({
151-
content: `${fixed_urls.join("\n")}`,
151+
content: fixed_urls
152+
.map((url) => `[Preview Embed URL](${url})`)
153+
.join("\n"),
152154
allowedMentions: { repliedUser: false },
153155
});
154156
}

0 commit comments

Comments
 (0)