-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.ts
38 lines (35 loc) · 1011 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import bsky from '@atproto/api';
const { BskyAgent } = bsky;
import * as dotenv from 'dotenv';
import process from 'node:process';
dotenv.config();
const agent = new BskyAgent({
service: 'https://bsky.social',
});
await agent.login({
identifier: process.env.BSKY_USERNAME!,
password: process.env.BSKY_PASSWORD!,
});
const bleet = 'You can find the code for this bleet >>>here<<<, with a link card, a title and a description!';
await agent.post({
text: bleet,
facets: [
{
index: { byteStart: bleet.indexOf('>>>') + 3, byteEnd: bleet.indexOf('<<<') },
features: [
{
$type: 'app.bsky.richtext.facet#link',
uri: 'https://github.com/aliceisjustplaying/atproto-starter-kit',
}
]
}
],
embed: {
$type: 'app.bsky.embed.external',
external: {
uri: 'https://github.com/aliceisjustplaying/atproto-starter-kit',
title: "alice's atproto starter kit",
description: "i'm just playing around with the api",
},
},
});