···24 return;
25 }
2627- // Group facets by their byte position (byteStart:byteEnd)
028 const positionMap = new Map<string, number>();
2930 for (const facet of facets) {
31- const key = `${facet.index.byteStart}:${facet.index.byteEnd}`;
32- positionMap.set(key, (positionMap.get(key) || 0) + 1);
000000033 }
3435 // Check if any position has more than the threshold
···24 return;
25 }
2627+ // Group mention facets by their byte position (byteStart:byteEnd)
28+ // Only check mentions as duplicate tags/links are often bot bugs, not malicious
29 const positionMap = new Map<string, number>();
3031 for (const facet of facets) {
32+ // Only count mentions for spam detection
33+ const hasMention = facet.features.some(
34+ (feature) => feature.$type === "app.bsky.richtext.facet#mention"
35+ );
36+37+ if (hasMention) {
38+ const key = `${facet.index.byteStart}:${facet.index.byteEnd}`;
39+ positionMap.set(key, (positionMap.get(key) || 0) + 1);
40+ }
41 }
4243 // Check if any position has more than the threshold