Skip to content

Commit

Permalink
Automod: create reports using emitModerationAction (#2025)
Browse files Browse the repository at this point in the history
* create reports using emitModerationAction

* fix input

* dont build
  • Loading branch information
dholms authored Jan 8, 2024
1 parent de2dbc2 commit e41a25f
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions packages/bsky/src/auto-moderator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,17 @@ export class AutoModerator {
uri: subject.uri.toString(),
cid: subject.cid.toString(),
}
await this.pushAgent.api.com.atproto.moderation.createReport({
reasonType: REASONOTHER,
reason: `Automatically flagged for possible slurs: ${matches.join(', ')}`,

await this.pushAgent.api.com.atproto.admin.emitModerationEvent({
event: {
$type: 'com.atproto.admin.defs#modEventReport',
comment: `Automatically flagged for possible slurs: ${matches.join(
', ',
)}`,
reportType: REASONOTHER,
},
subject: formattedSubject,
reportedBy: this.ctx.cfg.serverDid,
createdBy: this.ctx.cfg.serverDid,
})
}

Expand Down Expand Up @@ -198,15 +204,18 @@ export class AutoModerator {
'hard takedown of record (and blobs) based on auto-matching',
)

await this.pushAgent.com.atproto.moderation.createReport({
reportedBy: this.ctx.cfg.serverDid,
reasonType: REASONVIOLATION,
await this.pushAgent.api.com.atproto.admin.emitModerationEvent({
event: {
$type: 'com.atproto.admin.defs#modEventReport',
comment: reportReason,
reportType: REASONVIOLATION,
},
subject: {
$type: 'com.atproto.repo.strongRef',
uri: uri.toString(),
cid: recordCid.toString(),
},
reason: reportReason,
createdBy: this.ctx.cfg.serverDid,
})

await this.pushAgent.com.atproto.admin.emitModerationEvent({
Expand Down

0 comments on commit e41a25f

Please sign in to comment.