Skip to content

Commit

Permalink
await redact in nsfw protection
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Sep 19, 2024
1 parent 5f4178f commit 4f73da3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/protections/NsfwProtection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ export class NsfwProtection extends Protection {
if (prediction["probability"] > mjolnir.config.nsfwSensitivity) {
await mjolnir.managementRoomOutput.logMessage(LogLevel.INFO, "NSFWProtection", `Redacting ${event["event_id"]} for inappropriate content.`);
try {
mjolnir.client.redactEvent(roomId, event["event_id"])
await mjolnir.client.redactEvent(roomId, event["event_id"]);
} catch (err) {
await mjolnir.managementRoomOutput.logMessage(LogLevel.ERROR, "NSFWProtection", `There was an error redacting ${event["event_id"]}: ${err}`);

}
}
}
Expand Down

0 comments on commit 4f73da3

Please sign in to comment.