aboutsummaryrefslogtreecommitdiff
path: root/src/lib/models/ActivePunishment.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-31 22:38:06 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-31 22:38:06 -0400
commitc40a94697d64962edda41345e03fa76f51aa431c (patch)
tree1e258d51d6b19b9918f1d478b3f4c51dca3adc93 /src/lib/models/ActivePunishment.ts
parent901d9dfc8c5d95b8c76519e700c624294d4df787 (diff)
downloadtanzanite-c40a94697d64962edda41345e03fa76f51aa431c.tar.gz
tanzanite-c40a94697d64962edda41345e03fa76f51aa431c.tar.bz2
tanzanite-c40a94697d64962edda41345e03fa76f51aa431c.zip
upgrade typescript, improve workflow, bunch of bug fixes and some other things
Diffstat (limited to 'src/lib/models/ActivePunishment.ts')
-rw-r--r--src/lib/models/ActivePunishment.ts57
1 files changed, 34 insertions, 23 deletions
diff --git a/src/lib/models/ActivePunishment.ts b/src/lib/models/ActivePunishment.ts
index 0ad6cd8..83ada29 100644
--- a/src/lib/models/ActivePunishment.ts
+++ b/src/lib/models/ActivePunishment.ts
@@ -1,6 +1,6 @@
-import { Snowflake } from 'discord.js';
+import { type Snowflake } from 'discord.js';
import { nanoid } from 'nanoid';
-import { DataTypes, Sequelize } from 'sequelize';
+import { DataTypes, type Sequelize } from 'sequelize';
import { BaseModel } from './BaseModel';
export enum ActivePunishmentType {
@@ -30,34 +30,45 @@ export interface ActivePunishmentModelCreationAttributes {
modlog: string;
}
-// declaration merging so that the fields don't override Sequelize's getters
-export interface ActivePunishment {
- /** The ID of this punishment (no real use just for a primary key) */
- id: string;
+export class ActivePunishment
+ extends BaseModel<ActivePunishmentModel, ActivePunishmentModelCreationAttributes>
+ implements ActivePunishmentModel
+{
+ /**
+ * The ID of this punishment (no real use just for a primary key)
+ */
+ public declare id: string;
- /** The type of punishment. */
- type: ActivePunishmentType;
+ /**
+ * The type of punishment.
+ */
+ public declare type: ActivePunishmentType;
- /** The user who is punished. */
- user: Snowflake;
+ /**
+ * The user who is punished.
+ */
+ public declare user: Snowflake;
- /** The guild they are punished in. */
- guild: Snowflake;
+ /**
+ * The guild they are punished in.
+ */
+ public declare guild: Snowflake;
- /** Additional info about the punishment if applicable. The channel id for channel blocks and role for punishment roles. */
- extraInfo: Snowflake;
+ /**
+ * Additional info about the punishment if applicable. The channel id for channel blocks and role for punishment roles.
+ */
+ public declare extraInfo: Snowflake;
- /** The date when this punishment expires (optional). */
- expires: Date | null;
+ /**
+ * The date when this punishment expires (optional).
+ */
+ public declare expires: Date | null;
- /** The reference to the modlog entry. */
- modlog: string;
-}
+ /**
+ * The reference to the modlog entry.
+ */
+ public declare modlog: string;
-export class ActivePunishment
- extends BaseModel<ActivePunishmentModel, ActivePunishmentModelCreationAttributes>
- implements ActivePunishmentModel
-{
public static initModel(sequelize: Sequelize): void {
ActivePunishment.init(
{