Add list un/subscribe

This commit is contained in:
Paul Frazee
2023-05-07 21:33:42 -05:00
parent 1dc633b07c
commit bb5026b2e9
5 changed files with 68 additions and 5 deletions
+26
View File
@@ -337,6 +337,32 @@ class Mocker {
])
.execute()
}
async createMuteList(user: string, name: string): Promise<string> {
const res = await this.users[user]?.agent.app.bsky.graph.list.create(
{repo: this.users[user]?.did},
{
purpose: 'app.bsky.graph.defs#modlist',
name,
createdAt: new Date().toISOString(),
},
)
await this.users[user]?.agent.app.bsky.graph.subscribeMuteList({
list: res.uri,
})
return res.uri
}
async addToMuteList(owner: string, list: string, subject: string) {
await this.users[owner]?.agent.app.bsky.graph.listitem.create(
{repo: this.users[owner]?.did},
{
list,
subject,
createdAt: new Date().toISOString(),
},
)
}
}
const checkAvailablePort = (port: number) =>