aboutsummaryrefslogtreecommitdiff
path: root/src/lib/models/Guild.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-09 21:02:18 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-09 21:02:18 -0400
commit25752446d6166ff5733909160bae62cdd121339c (patch)
tree52b45189d7d3b63a8e58c783e0561bf376b4a41b /src/lib/models/Guild.ts
parent51228472c7b724b23457a4d958f3bf66566492cc (diff)
downloadtanzanite-25752446d6166ff5733909160bae62cdd121339c.tar.gz
tanzanite-25752446d6166ff5733909160bae62cdd121339c.tar.bz2
tanzanite-25752446d6166ff5733909160bae62cdd121339c.zip
a whole lot of nothing
Diffstat (limited to 'src/lib/models/Guild.ts')
-rw-r--r--src/lib/models/Guild.ts44
1 files changed, 19 insertions, 25 deletions
diff --git a/src/lib/models/Guild.ts b/src/lib/models/Guild.ts
index 47b4af9..997be6a 100644
--- a/src/lib/models/Guild.ts
+++ b/src/lib/models/Guild.ts
@@ -4,14 +4,15 @@ import { BushClient } from '../extensions/discord-akairo/BushClient';
import { BaseModel } from './BaseModel';
import { jsonArrayInit, jsonParseGet, jsonParseSet, NEVER_USED } from './__helpers';
-export const guildSettingsObj: {
- [x in GuildSettings]: {
- name: string;
- description: string;
- type: 'string' | 'custom' | 'channel' | 'role' | 'user' | 'channel-array' | 'role-array' | 'user-array';
- configurable: boolean;
- };
-} = {
+interface GuildSetting {
+ name: string;
+ description: string;
+ type: 'string' | 'custom' | 'channel' | 'role' | 'user' | 'channel-array' | 'role-array' | 'user-array';
+ configurable: boolean;
+}
+const asGuildSetting = <T>(et: { [K in keyof T]: GuildSetting }) => et;
+
+export const guildSettingsObj = asGuildSetting({
prefix: {
name: 'Prefix',
description: 'The phrase required to trigger text commands in this server.',
@@ -90,27 +91,20 @@ export const guildSettingsObj: {
type: 'channel',
configurable: true
}
-};
+});
-export type GuildSettings =
- | 'prefix'
- | 'autoPublishChannels'
- | 'welcomeChannel'
- | 'muteRole'
- | 'punishmentEnding'
- | 'lockdownChannels'
- | 'joinRoles'
- | 'bypassChannelBlacklist'
- | 'logChannels'
- | 'autoModPhases'
- | 'noXpChannels'
- | 'levelRoles'
- | 'levelUpChannel';
+export type GuildSettings = keyof typeof guildSettingsObj;
export const settingsArr = Object.keys(guildSettingsObj).filter(
(s) => guildSettingsObj[s as GuildSettings].configurable
) as GuildSettings[];
-export const guildFeaturesObj = {
+interface GuildFeature {
+ name: string;
+ description: string;
+}
+const asGuildFeature = <T>(gf: { [K in keyof T]: GuildFeature }) => gf;
+
+export const guildFeaturesObj = asGuildFeature({
automod: {
name: 'Automod',
description: 'Deletes offensive content as well as phishing links.'
@@ -151,7 +145,7 @@ export const guildFeaturesObj = {
name: 'Send Level Up Messages',
description: 'Send a message when a user levels up.'
}
-};
+});
export const guildLogsObj = {
automod: {