aboutsummaryrefslogtreecommitdiff
path: root/src/lib/models/ActivePunishment.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-31 13:46:27 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-31 13:46:27 -0400
commitedcc0dd0a9228192ff6c4f6d6797dd6238e98f92 (patch)
tree70c3f5436342d7f6b0e81222467d2773a3bb0b33 /src/lib/models/ActivePunishment.ts
parentb63a6b0cb61f0abf8a946a7f0f04a2a19a31e690 (diff)
downloadtanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.tar.gz
tanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.tar.bz2
tanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.zip
upgraded to typescript 4.3.5
The reason I had to use getters and setters for the db models is because in the newer version of typescript the properties would be defined at runtime and override the getter and setters that sequalize uses later, causing all the values to be undefined and not being able to save any information.
Diffstat (limited to 'src/lib/models/ActivePunishment.ts')
-rw-r--r--src/lib/models/ActivePunishment.ts41
1 files changed, 34 insertions, 7 deletions
diff --git a/src/lib/models/ActivePunishment.ts b/src/lib/models/ActivePunishment.ts
index 9fcafbe..c204c9a 100644
--- a/src/lib/models/ActivePunishment.ts
+++ b/src/lib/models/ActivePunishment.ts
@@ -36,31 +36,58 @@ export class ActivePunishment
/**
* The ID of this punishment (no real use just for a primary key)
*/
- id: string;
+ public get id(): string {
+ return null;
+ }
+ public set id(value: string) {}
+
/**
* The type of punishment.
*/
- type: ActivePunishmentType;
+ public get type(): ActivePunishmentType {
+ return null;
+ }
+ public set type(value: ActivePunishmentType) {}
+
/**
* The user who is punished.
*/
- user: Snowflake;
+ public get user(): Snowflake {
+ return null;
+ }
+ public set user(value: Snowflake) {}
+
/**
* The guild they are punished in.
*/
- guild: Snowflake;
+ public get guild(): Snowflake {
+ return null;
+ }
+ public set guild(value: Snowflake) {}
+
/**
* Additional info about the punishment if applicable. The channel id for channel blocks and role for punishment roles.
*/
- extraInfo: Snowflake;
+ public get extraInfo(): Snowflake {
+ return null;
+ }
+ public set extraInfo(value: Snowflake) {}
+
/**
* The date when this punishment expires (optional).
*/
- expires: Date | null;
+ public get expires(): Date | null {
+ return null;
+ }
+ public set expires(value: Date | null) {}
+
/**
* The reference to the modlog entry.
*/
- modlog: string;
+ public get modlog(): string {
+ return null;
+ }
+ public set modlog(value: string) {}
static initModel(sequelize: Sequelize): void {
ActivePunishment.init(