better document consequence.ts

This commit is contained in:
jesopo 2022-03-09 15:54:14 +00:00
parent 2b60f6addd
commit 5aaf05265b

View File

@ -1,18 +1,23 @@
/*
* Distinct individual actions that can be caused as a result of detected abuse
*/
export enum ConsequenceType {
// effectively a no-op. just tell the management room
alert,
// redact the event that triggered this consequence
redact,
// ban the user that sent the event that triggered this consequence
ban
}
export class Consequence {
/*
* A description of an action to take when a protection detects abuse
* Action to take upon detection of abuse and an optional explanation of the detection
*
* @param type Action to take
* @param reason Brief explanation of why we're taking an action, printed to management room.
* this wil be HTML escaped before printing, just in case it has user-provided data
* this will be HTML escaped before printing, just in case it has user-provided data
*/
constructor(public readonly type: ConsequenceType, public readonly reason?: string) {}
}