tangled
alpha
login
or
join now
skywatch.blue
/
skywatch-automod
7
fork
atom
A tool for parsing traffic on the jetstream and applying a moderation workstream based on regexp based rules
7
fork
atom
overview
issues
pulls
pipelines
Added support for checking embeds to external sources
D. Scarnecchia
6 months ago
90c4855c
d33e21b9
+28
-10
1 changed file
expand all
collapse all
unified
split
src
main.ts
+28
-10
src/main.ts
···
88
88
"app.bsky.feed.post",
89
89
(event: CommitCreateEvent<"app.bsky.feed.post">) => {
90
90
const atURI = `at://${event.did}/app.bsky.feed.post/${event.commit.rkey}`;
91
91
+
const hasEmbed = event.commit.record.hasOwnProperty("embed");
91
92
const hasFacets = event.commit.record.hasOwnProperty("facets");
92
93
const hasText = event.commit.record.hasOwnProperty("text");
93
94
···
124
125
tasks.push(checkPosts(posts));
125
126
});
126
127
}
127
127
-
} else if (hasText) {
128
128
+
}
129
129
+
130
130
+
if (hasText) {
128
131
const posts: Post[] = [
129
132
{
130
133
did: event.did,
···
137
140
];
138
141
tasks.push(checkPosts(posts));
139
142
}
143
143
+
144
144
+
if (hasEmbed) {
145
145
+
const embed = event.commit.record.embed;
146
146
+
if (embed && embed.$type === "app.bsky.embed.external") {
147
147
+
const posts: Post[] = [
148
148
+
{
149
149
+
did: event.did,
150
150
+
time: event.time_us,
151
151
+
rkey: event.commit.rkey,
152
152
+
atURI: atURI,
153
153
+
text: embed.external.uri,
154
154
+
cid: event.commit.cid,
155
155
+
},
156
156
+
];
157
157
+
tasks.push(checkPosts(posts));
158
158
+
}
159
159
+
}
140
160
},
141
161
);
142
162
···
192
212
event.commit.record.displayName as string,
193
213
event.commit.record.description as string,
194
214
);
215
215
+
}
195
216
196
196
-
if (event.commit.record.joinedViaStarterPack) {
197
197
-
checkStarterPack(
198
198
-
event.did,
199
199
-
event.time_us,
200
200
-
event.commit.record.joinedViaStarterPack.uri,
201
201
-
);
202
202
-
}
203
203
-
} else {
204
204
-
return;
217
217
+
if (event.commit.record.joinedViaStarterPack) {
218
218
+
checkStarterPack(
219
219
+
event.did,
220
220
+
event.time_us,
221
221
+
event.commit.record.joinedViaStarterPack.uri,
222
222
+
);
205
223
}
206
224
} catch (error) {
207
225
logger.error(`Error checking profile: ${error}`);