Pronouns labels on Bluesky

add constant for delete post substring

Changed files
+10 -2
src
+1
src/constants.ts
···
export const SIGNING_KEY = process.env.SIGNING_KEY ?? "";
export const PORT = 4001;
export const LABEL_LIMIT = 4;
+
export const DELETE_POST = "delete";
export const POSTS: Record<string, string> = {
"3kwsqucto3j2a": "delete",
"3kwss4ldkwd2j": "they",
+9 -2
src/label.ts
···
import { AppBskyActorDefs, ComAtprotoLabelDefs } from "@atproto/api";
-
import { DID, PORT, LABEL_LIMIT, POSTS, SIGNING_KEY } from "./constants.js";
+
import {
+
DID,
+
PORT,
+
LABEL_LIMIT,
+
POSTS,
+
SIGNING_KEY,
+
DELETE_POST,
+
} from "./constants.js";
import { LabelerServer } from "@skyware/labeler";
const server = new LabelerServer({ did: DID, signingKey: SIGNING_KEY });
···
return set;
}, new Set<string>());
-
if (POSTS[uri]?.includes("delete")) {
+
if (POSTS[uri]?.includes(DELETE_POST)) {
await server
.createLabels({ uri: did }, { negate: [...labels] })
.catch((err) => {