aboutsummaryrefslogtreecommitdiff
path: root/src/lib/models/Guild.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/Guild.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/Guild.ts')
-rw-r--r--src/lib/models/Guild.ts98
1 files changed, 87 insertions, 11 deletions
diff --git a/src/lib/models/Guild.ts b/src/lib/models/Guild.ts
index 7a0384c..aac4267 100644
--- a/src/lib/models/Guild.ts
+++ b/src/lib/models/Guild.ts
@@ -32,17 +32,93 @@ export interface GuildModelCreationAttributes {
}
export class Guild extends BaseModel<GuildModel, GuildModelCreationAttributes> implements GuildModel {
- id!: Snowflake;
- prefix!: string;
- autoPublishChannels: Snowflake[];
- blacklistedChannels: Snowflake[];
- blacklistedUsers: Snowflake[];
- welcomeChannel: Snowflake;
- muteRole: Snowflake;
- punishmentEnding: string;
- disabledCommands: string[];
- lockdownChannels: Snowflake[];
- autoModPhases: string[];
+ /**
+ * The ID of the guild
+ */
+ public get id(): Snowflake {
+ return null;
+ }
+ public set id(value: Snowflake) {}
+
+ /**
+ * The bot's prefix for the guild
+ */
+ public get prefix(): string {
+ return null;
+ }
+ public set prefix(value: string) {}
+
+ /**
+ * Channels that will have their messages automatically published
+ */
+ public get autoPublishChannels(): Snowflake[] {
+ return null;
+ }
+ public set autoPublishChannels(value: Snowflake[]) {}
+
+ /**
+ * Channels where the bot won't respond in.
+ */
+ public get blacklistedChannels(): Snowflake[] {
+ return null;
+ }
+ public set blacklistedChannels(value: Snowflake[]) {}
+
+ /**
+ * Users that the bot ignores in this guild
+ */
+ public get blacklistedUsers(): Snowflake[] {
+ return null;
+ }
+ public set blacklistedUsers(value: Snowflake[]) {}
+
+ /**
+ * The channels where the welcome messages are sent
+ */
+ public get welcomeChannel(): Snowflake {
+ return null;
+ }
+ public set welcomeChannel(value: Snowflake) {}
+
+ /**
+ * The role given out when muting someone
+ */
+ public get muteRole(): Snowflake {
+ return null;
+ }
+ public set muteRole(value: Snowflake) {}
+
+ /**
+ * The message that gets sent after someone gets a punishment dm
+ */
+ public get punishmentEnding(): string {
+ return null;
+ }
+ public set punishmentEnding(value: string) {}
+
+ /**
+ * Guild specific disabled commands
+ */
+ public get disabledCommands(): string[] {
+ return null;
+ }
+ public set disabledCommands(value: string[]) {}
+
+ /**
+ * Channels that should get locked down when the lockdown command gets used.
+ */
+ public get lockdownChannels(): Snowflake[] {
+ return null;
+ }
+ public set lockdownChannels(value: Snowflake[]) {}
+
+ /**
+ * Custom automod phases
+ */
+ public get autoModPhases(): string[] {
+ return null;
+ }
+ public set autoModPhases(value: string[]) {}
static initModel(sequelize: Sequelize, client: BushClient): void {
Guild.init(