Pronouns labels on Bluesky

rename to more generic name

Changed files
+8 -9
src
+3 -4
src/constants.ts
···
import "dotenv/config";
-
export const PRONOUNS: Record<string, string> = {
+
export const DID = process.env.DID ?? "";
+
export const SIGNING_KEY = process.env.SIGNING_KEY ?? "";
+
export const POSTS: Record<string, string> = {
"3kwsqucto3j2a": "delete",
"3kwss4ldkwd2j": "they",
"3kwss4fmiow2n": "it",
···
"3l2zv7xcpq62u": "shark-sharks",
"3l32xb7nvgh2x": "proper-nouns",
};
-
-
export const DID = process.env.DID ?? "";
-
export const SIGNING_KEY = process.env.SIGNING_KEY ?? "";
+5 -5
src/label.ts
···
import { AppBskyActorDefs, ComAtprotoLabelDefs } from "@atproto/api";
-
import { DID, PRONOUNS, SIGNING_KEY } from "./constants.js";
+
import { DID, POSTS, SIGNING_KEY } from "./constants.js";
import { LabelerServer } from "@skyware/labeler";
const server = new LabelerServer({ did: DID, signingKey: SIGNING_KEY });
···
return set;
}, new Set<string>());
-
if (PRONOUNS[uri].includes("delete")) {
+
if (POSTS[uri].includes("delete")) {
await server
.createLabels({ uri: did }, { negate: [...labels] })
.catch((err) => {
console.log(err);
})
.then(() => console.log(`Deleted labels for ${did}`));
-
} else if (labels.size < 4 && PRONOUNS[uri]) {
+
} else if (labels.size < 4 && POSTS[uri]) {
await server
.createLabel({
src: server.did,
uri: did,
-
val: PRONOUNS[uri],
+
val: POSTS[uri],
cts: new Date().toISOString(),
})
.catch((err) => {
console.log(err);
})
-
.then(() => console.log(`Labeled ${did} with ${PRONOUNS[uri]}`));
+
.then(() => console.log(`Labeled ${did} with ${POSTS[uri]}`));
}
};