aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-19 16:58:07 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-19 16:58:07 -0400
commitea549295bb5271b0b31852ebf9aa84f95f43d92d (patch)
tree2d799618f812f30dbdae2f602a9809144bf18d86 /src
parent76702f62bc0f0e91ad64eec677ce56813601c906 (diff)
downloadtanzanite-ea549295bb5271b0b31852ebf9aa84f95f43d92d.tar.gz
tanzanite-ea549295bb5271b0b31852ebf9aa84f95f43d92d.tar.bz2
tanzanite-ea549295bb5271b0b31852ebf9aa84f95f43d92d.zip
refactoring
Diffstat (limited to 'src')
-rw-r--r--src/lib/extensions/discord-akairo/BushClient.ts17
-rw-r--r--src/lib/models/instance/Guild.ts18
2 files changed, 8 insertions, 27 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts
index 68b2599..5f63839 100644
--- a/src/lib/extensions/discord-akairo/BushClient.ts
+++ b/src/lib/extensions/discord-akairo/BushClient.ts
@@ -202,7 +202,7 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
/**
* A custom logging system for the bot.
*/
- public override logger: BushLogger;
+ public override logger: BushLogger = new BushLogger(this);
/**
* Cached global and guild database data.
@@ -217,7 +217,7 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
/**
* Manages most aspects of the highlight command
*/
- public override highlightManager = new HighlightManager();
+ public override highlightManager: HighlightManager = new HighlightManager(this);
/**
* The perspective api
@@ -227,17 +227,12 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
/**
* Client utilities.
*/
- public override utils: BushClientUtils;
+ public override utils: BushClientUtils = new BushClientUtils(this);
/**
- * @param config The configuration for the bot.
+ * @param config The configuration for the client.
*/
- public constructor(
- /**
- * The configuration for the client.
- */
- public override config: Config
- ) {
+ public constructor(public override config: Config) {
super({
ownerID: config.owners,
intents: Object.keys(GatewayIntentBits)
@@ -256,8 +251,6 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
patch(this);
this.token = config.token as If<Ready, string, string | null>;
- this.logger = new BushLogger(this);
- this.utils = new BushClientUtils(this);
/* =-=-= handlers =-=-= */
this.listenerHandler = new BushListenerHandler(this, {
diff --git a/src/lib/models/instance/Guild.ts b/src/lib/models/instance/Guild.ts
index 7a19b72..f0cac74 100644
--- a/src/lib/models/instance/Guild.ts
+++ b/src/lib/models/instance/Guild.ts
@@ -1,4 +1,4 @@
-import { ChannelType, type Snowflake } from 'discord.js';
+import { ChannelType, Constants, type Snowflake } from 'discord.js';
import { type Sequelize } from 'sequelize';
import { BadWordDetails } from '../../common/AutoMod.js';
import { type BushClient } from '../../extensions/discord-akairo/BushClient.js';
@@ -269,13 +269,7 @@ export const guildSettingsObj = asGuildSetting({
name: 'No Xp Channels',
description: 'Channels where users will not earn xp for leveling.',
type: 'channel-array',
- subType: [
- ChannelType.GuildText,
- ChannelType.GuildNews,
- ChannelType.GuildNewsThread,
- ChannelType.GuildPublicThread,
- ChannelType.GuildPrivateThread
- ]
+ subType: Constants.TextBasedChannelTypes.filter((type) => type !== ChannelType.DM)
},
levelRoles: {
name: 'Level Roles',
@@ -287,13 +281,7 @@ export const guildSettingsObj = asGuildSetting({
name: 'Level Up Channel',
description: 'The channel to send level up messages in instead of last channel.',
type: 'channel',
- subType: [
- ChannelType.GuildText,
- ChannelType.GuildNews,
- ChannelType.GuildNewsThread,
- ChannelType.GuildPublicThread,
- ChannelType.GuildPrivateThread
- ]
+ subType: Constants.TextBasedChannelTypes.filter((type) => type !== ChannelType.DM)
}
});