diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-26 21:53:51 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-26 21:53:51 -0400 |
commit | 921e98369c8a8aa58220a232eb8b711be59f9884 (patch) | |
tree | 1566574bcad21d4c16ddf869b55f20a4665d54cc /src/lib/models | |
parent | b7f254cd426138880318d2ba6a06e8e86ae407bf (diff) | |
download | tanzanite-921e98369c8a8aa58220a232eb8b711be59f9884.tar.gz tanzanite-921e98369c8a8aa58220a232eb8b711be59f9884.tar.bz2 tanzanite-921e98369c8a8aa58220a232eb8b711be59f9884.zip |
start settings command
Diffstat (limited to 'src/lib/models')
-rw-r--r-- | src/lib/models/Guild.ts | 79 |
1 files changed, 68 insertions, 11 deletions
diff --git a/src/lib/models/Guild.ts b/src/lib/models/Guild.ts index 614bf15..66deddb 100644 --- a/src/lib/models/Guild.ts +++ b/src/lib/models/Guild.ts @@ -18,6 +18,7 @@ export interface GuildModel { autoModPhases: string[]; enabledFeatures: GuildFeatures[]; joinRoles: Snowflake[]; + automodLogChannel: Snowflake; } export interface GuildModelCreationAttributes { @@ -34,16 +35,58 @@ export interface GuildModelCreationAttributes { autoModPhases?: string[]; enabledFeatures?: GuildFeatures[]; joinRoles?: Snowflake[]; + automodLogChannel?: Snowflake; } export const guildSettings = { - prefix: { type: 'string' }, - autoPublishChannels: { type: 'channel-array' }, - welcomeChannel: { type: 'channel-array' }, - muteRole: { type: 'role' }, - punishmentEnding: { type: 'string' }, - lockdownChannels: { type: 'channel-array' }, - joinRoles: { type: 'role-array' } + prefix: { + name: 'Prefix', + description: 'description goes here', + type: 'string', + configurable: true + }, + autoPublishChannels: { + name: 'Auto Publish Channels', + description: 'description goes here', + type: 'channel-array', + configurable: true + }, + welcomeChannel: { + name: 'Welcome Channel', + description: 'description goes here', + type: 'channel-array', + configurable: true + }, + muteRole: { + name: 'Mute Role', + description: 'description goes here', + type: 'role', + configurable: true + }, + punishmentEnding: { + name: 'Punishment Ending', + description: 'description goes here', + type: 'string', + configurable: true + }, + lockdownChannels: { + name: 'Lockdown Channels', + description: 'description goes here', + type: 'channel-array', + configurable: false // not implemented yet + }, + joinRoles: { + name: 'Join Roles', + description: 'description goes here', + type: 'role-array', + configurable: true + }, + automodLogChannel: { + name: 'Automod Log Channel', + description: 'description goes here', + type: 'channel', + configurable: true + } }; export const guildFeaturesObj = { @@ -53,11 +96,11 @@ export const guildFeaturesObj = { }, autoPublish: { name: 'Auto Publish', - description: 'Auto publishes all messages in configured announcement channels.' + description: 'Publishes messages in configured announcement channels.' }, autoThread: { name: 'Auto Thread', - description: 'Automatically creates a new thread for every message in configured channels.' + description: 'Creates a new thread for messages in configured channels.' }, blacklistedFile: { name: 'Blacklisted File', @@ -73,7 +116,7 @@ export const guildFeaturesObj = { }, stickyRoles: { name: 'Sticky Roles', - description: "Stores users' roles when they leave the server and returns them when they rejoin." + description: 'Restores past roles to a user when they rejoin.' } }; @@ -211,6 +254,16 @@ export class Guild extends BaseModel<GuildModel, GuildModelCreationAttributes> i throw new Error(NEVER_USED); } + /** + * The channel to send automod logs to. + */ + public get automodLogChannel(): Snowflake { + throw new Error(NEVER_USED); + } + public set automodLogChannel(_: Snowflake) { + throw new Error(NEVER_USED); + } + public static initModel(sequelize: Sequelize, client: BushClient): void { Guild.init( { @@ -242,7 +295,11 @@ export class Guild extends BaseModel<GuildModel, GuildModelCreationAttributes> i lockdownChannels: jsonArrayInit('lockdownChannels'), autoModPhases: jsonArrayInit('autoModPhases'), enabledFeatures: jsonArrayInit('enabledFeatures'), - joinRoles: jsonArrayInit('joinRoles') + joinRoles: jsonArrayInit('joinRoles'), + automodLogChannel: { + type: DataTypes.STRING, + allowNull: true + } }, { sequelize: sequelize } ); |