Feature/vba 77 (#178)
* Add say command (#174) Co-authored-by: Ethan Lane <ethan@vylpes.com> Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/174 * Add repo and funding link to about message (#176) Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/176 * Add other subreddits to bunny command (#177) Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/177 * Add database table * Save moderation actions to database * Add audit command to see a user's audits * Add audit view subcommand * Add audit clear subcommand * Create add audit subcommand * Fix bot crashing when viewing an audit with no reason * Fix changes requested
This commit is contained in:
parent
2da5e1aa75
commit
cd666d24fd
12 changed files with 293 additions and 1 deletions
37
src/helpers/AuditTools.ts
Normal file
37
src/helpers/AuditTools.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
import { AuditType } from "../constants/AuditType";
|
||||
|
||||
export default class AuditTools {
|
||||
public static TypeToFriendlyText(auditType: AuditType): string {
|
||||
switch (auditType) {
|
||||
case AuditType.General:
|
||||
return "General";
|
||||
case AuditType.Warn:
|
||||
return "Warn";
|
||||
case AuditType.Mute:
|
||||
return "Mute";
|
||||
case AuditType.Kick:
|
||||
return "Kick";
|
||||
case AuditType.Ban:
|
||||
return "Ban";
|
||||
default:
|
||||
return "Other";
|
||||
}
|
||||
}
|
||||
|
||||
public static StringToType(str: string): AuditType {
|
||||
switch (str.toLowerCase()) {
|
||||
case "general":
|
||||
return AuditType.General;
|
||||
case "warn":
|
||||
return AuditType.Warn;
|
||||
case "mute":
|
||||
return AuditType.Mute;
|
||||
case "kick":
|
||||
return AuditType.Kick;
|
||||
case "ban":
|
||||
return AuditType.Ban;
|
||||
default:
|
||||
return AuditType.General;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue