the bot can fart

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Cadey Ratio 2023-04-24 17:02:12 -04:00
parent c295115f1a
commit 473b33ff59
4 changed files with 32 additions and 11 deletions

12
package-lock.json generated
View File

@ -7,7 +7,7 @@
"": {
"name": "@cadey/yasomi",
"version": "0.0.1",
"license": "SEE LICENSE IN LICENSE",
"license": "MIT",
"dependencies": {
"@atproto/api": "^0.2.8",
"commander": "^10.0.0",
@ -21,7 +21,7 @@
"lint-staged": "^13.2.1",
"mocha": "^10.2.0",
"prettier": "2.8.7",
"typescript": "^5.0.4"
"typescript": "^4.9.5"
}
},
"node_modules/@atproto/api": {
@ -2093,16 +2093,16 @@
}
},
"node_modules/typescript": {
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz",
"integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==",
"version": "4.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=12.20"
"node": ">=4.2.0"
}
},
"node_modules/uint8arrays": {

View File

@ -26,7 +26,7 @@
"lint-staged": "^13.2.1",
"mocha": "^10.2.0",
"prettier": "2.8.7",
"typescript": "^5.0.4"
"typescript": "^4.9.5"
},
"dependencies": {
"@atproto/api": "^0.2.8",

View File

@ -1,4 +1,24 @@
import { } from "@atproto/api";
import * as dotenv from "dotenv";
import bsky from "@atproto/api";
const { BskyAgent, RichText } = bsky;
dotenv.config();
const agent = new BskyAgent({
service: process.env.BLUESKY_ENDPOINT as string,
});
await agent.login({
identifier: process.env.BLUESKY_EMAIL as string,
password: process.env.BLUESKY_PASSWORD as string,
});
const rt = new RichText({ text: "Hello Bluesky!" });
await rt.detectFacets(agent);
const postRecord = {
$type: "app.bsky.feed.post",
text: rt.text,
facets: rt.facets,
createdAt: new Date().toISOString(),
};
await agent.post(postRecord);

View File

@ -3,13 +3,14 @@
"compilerOptions": {
"esModuleInterop": true,
"lib": ["es2020", "es2022", "dom"],
"module": "es2022",
"module": "esnext",
"preserveConstEnums": true,
"moduleResolution": "node",
"moduleResolution": "node16",
"strict": true,
"sourceMap": true,
"target": "es2022",
"target": "esnext",
"types": ["node"],
"skipLibCheck": true,
"outDir": "dist"
},
"include": ["src/**/*", "tests/**/*", "types/**/*"],