-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplay.ts
30 lines (25 loc) · 788 Bytes
/
play.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
import { Actor, Follow, lookupObject, Person } from "jsr:@fedify/fedify"
import { federation } from "./federation.ts"
import { Create, Note, PUBLIC_COLLECTION } from "jsr:@fedify/fedify"
const ctx = federation.createContext({
url: "https://rafael-air-m1.tail472f72.ts.net/users/me/outbox?cursor=",
} as Request)
const recipient = (await lookupObject(
"https://activitypub.academy/@dobessia_rakdus"
)) as Actor
const me = "@me@rafael-air-m1.tail472f72.ts.net"
const actorUri = ctx.getActorUri(me)
await ctx.sendActivity(
{ handle: me },
recipient,
new Create({
actor: ctx.getActorUri(me),
to: PUBLIC_COLLECTION,
object: new Note({
attribution: ctx.getActorUri(me),
to: PUBLIC_COLLECTION,
}),
}),
{ immediate: true, preferSharedInbox: true }
)
console.log("sent")