aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-19 18:07:20 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-19 18:07:20 -0400
commitbfb467c3bed23479673b82eba61c05d60acf42d7 (patch)
treec572a03551170e99c0d79466aefd87b7a970d58c /src/lib
parentb29a217f76483e000bd9d75d30250d11a0a88c4d (diff)
downloadtanzanite-bfb467c3bed23479673b82eba61c05d60acf42d7.tar.gz
tanzanite-bfb467c3bed23479673b82eba61c05d60acf42d7.tar.bz2
tanzanite-bfb467c3bed23479673b82eba61c05d60acf42d7.zip
pain
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/models/Guild.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/lib/models/Guild.ts b/src/lib/models/Guild.ts
index 3473ea4..dfba90c 100644
--- a/src/lib/models/Guild.ts
+++ b/src/lib/models/Guild.ts
@@ -15,6 +15,7 @@ export interface GuildModel {
disabledCommands: string[];
lockdownChannels: Snowflake[];
autoModPhases: string[];
+ enabledFeatures: string[];
}
export interface GuildModelCreationAttributes {
@@ -29,8 +30,20 @@ export interface GuildModelCreationAttributes {
disabledCommands?: string[];
lockdownChannels?: Snowflake[];
autoModPhases?: string[];
+ enabledFeatures?: string[];
}
+export const guildSettings = {
+ prefix: { type: 'string' },
+ autoPublishChannels: { type: 'channel-array' },
+ welcomeChannel: { type: 'channel-array' },
+ muteRole: { type: 'role' },
+ punishmentEnding: { type: 'string' },
+ lockdownChannels: { type: 'channel-array' }
+};
+
+export const guildFeatures = ['automodEnabled', 'supportThreads', 'stickyRoles'];
+
const NEVER_USED = 'This should never be executed';
export class Guild extends BaseModel<GuildModel, GuildModelCreationAttributes> implements GuildModel {
@@ -144,6 +157,16 @@ export class Guild extends BaseModel<GuildModel, GuildModelCreationAttributes> i
throw new Error(NEVER_USED);
}
+ /**
+ * The features enabled in a guild
+ */
+ public get enabledFeatures(): string[] {
+ throw new Error(NEVER_USED);
+ }
+ public set enabledFeatures(_: string[]) {
+ throw new Error(NEVER_USED);
+ }
+
public static initModel(sequelize: Sequelize, client: BushClient): void {
Guild.init(
{
@@ -233,6 +256,17 @@ export class Guild extends BaseModel<GuildModel, GuildModelCreationAttributes> i
},
allowNull: false,
defaultValue: '[]'
+ },
+ enabledFeatures: {
+ type: DataTypes.TEXT,
+ get: function () {
+ return JSON.parse(this.getDataValue('enabledFeatures') as unknown as string);
+ },
+ set: function (val: string[]) {
+ return this.setDataValue('enabledFeatures', JSON.stringify(val) as unknown as string[]);
+ },
+ allowNull: false,
+ defaultValue: '[]'
}
},
{ sequelize: sequelize }