Pronouns labels on Bluesky

add new constants

Changed files
+5 -3
src
+2
src/constants.ts
···
export const DID = process.env.DID ?? "";
export const SIGNING_KEY = process.env.SIGNING_KEY ?? "";
export const POSTS: Record<string, string> = {
"3kwsqucto3j2a": "delete",
"3kwss4ldkwd2j": "they",
···
export const DID = process.env.DID ?? "";
export const SIGNING_KEY = process.env.SIGNING_KEY ?? "";
+
export const PORT = 4001;
+
export const LABEL_LIMIT = 4;
export const POSTS: Record<string, string> = {
"3kwsqucto3j2a": "delete",
"3kwss4ldkwd2j": "they",
+3 -3
src/label.ts
···
import { AppBskyActorDefs, ComAtprotoLabelDefs } from "@atproto/api";
-
import { DID, POSTS, SIGNING_KEY } from "./constants.js";
import { LabelerServer } from "@skyware/labeler";
const server = new LabelerServer({ did: DID, signingKey: SIGNING_KEY });
-
server.start(4001, (error, address) => {
if (error) {
console.error(error);
} else {
···
console.log(err);
})
.then(() => console.log(`Deleted labels for ${did}`));
-
} else if (labels.size < 4 && POSTS[uri]) {
await server
.createLabel({ uri: did, val: POSTS[uri] })
.catch((err) => {
···
import { AppBskyActorDefs, ComAtprotoLabelDefs } from "@atproto/api";
+
import { DID, PORT, LABEL_LIMIT, POSTS, SIGNING_KEY } from "./constants.js";
import { LabelerServer } from "@skyware/labeler";
const server = new LabelerServer({ did: DID, signingKey: SIGNING_KEY });
+
server.start(PORT, (error, address) => {
if (error) {
console.error(error);
} else {
···
console.log(err);
})
.then(() => console.log(`Deleted labels for ${did}`));
+
} else if (labels.size < LABEL_LIMIT && POSTS[uri]) {
await server
.createLabel({ uri: did, val: POSTS[uri] })
.catch((err) => {