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:
Vylpes 2022-09-05 18:10:04 +01:00 committed by GitHub
parent 2da5e1aa75
commit cd666d24fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 293 additions and 1 deletions

37
src/helpers/AuditTools.ts Normal file
View 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;
}
}
}