diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-21 12:39:42 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-21 12:39:42 -0400 |
commit | be60d01553dc4e948c8c13400d5a4932fd741ed8 (patch) | |
tree | 2b65b69d2d9706594ec4966a85e8351f0f4365fe | |
parent | 878bed986193c98ecde99b647b99015bcfec962e (diff) | |
download | tanzanite-be60d01553dc4e948c8c13400d5a4932fd741ed8.tar.gz tanzanite-be60d01553dc4e948c8c13400d5a4932fd741ed8.tar.bz2 tanzanite-be60d01553dc4e948c8c13400d5a4932fd741ed8.zip |
misc
-rw-r--r-- | lib/automod/AutomodShared.ts | 10 | ||||
-rw-r--r-- | lib/extensions/discord.js/ExtendedGuild.ts | 7 | ||||
-rw-r--r-- | lib/models/instance/Guild.ts | 4 | ||||
-rw-r--r-- | lib/models/shared/GuildCount.ts | 2 | ||||
-rw-r--r-- | lib/models/shared/Shared.ts | 2 | ||||
-rw-r--r-- | lib/utils/BushClientUtils.ts | 14 | ||||
-rw-r--r-- | lib/utils/BushLogger.ts | 2 | ||||
-rw-r--r-- | src/listeners/automod/presenceAutomod.ts | 1 | ||||
-rw-r--r-- | src/tasks/feature/updateStats.d.ts | 10 | ||||
-rw-r--r-- | src/tasks/feature/updateStats.js | 24 | ||||
-rw-r--r-- | src/tasks/feature/updateStats.js.map | 1 | ||||
-rw-r--r-- | tsconfig.base.json | 1 | ||||
-rw-r--r-- | tsconfig.eslint.json | 3 |
13 files changed, 22 insertions, 59 deletions
diff --git a/lib/automod/AutomodShared.ts b/lib/automod/AutomodShared.ts index 08cde25..9cdb020 100644 --- a/lib/automod/AutomodShared.ts +++ b/lib/automod/AutomodShared.ts @@ -1,3 +1,8 @@ +import * as Moderation from '#lib/common/Moderation.js'; +import { unmuteResponse } from '#lib/extensions/discord.js/ExtendedGuildMember.js'; +import { colors, emojis } from '#lib/utils/BushConstants.js'; +import * as Format from '#lib/utils/Format.js'; +import { formatUnmuteResponse } from '#lib/utils/FormatResponse.js'; import { ActionRowBuilder, ButtonBuilder, @@ -8,11 +13,6 @@ import { PermissionFlagsBits, Snowflake } from 'discord.js'; -import * as Moderation from '../common/Moderation.js'; -import { unmuteResponse } from '../extensions/discord.js/ExtendedGuildMember.js'; -import { colors, emojis } from '../utils/BushConstants.js'; -import * as Format from '../utils/Format.js'; -import { formatUnmuteResponse } from '../utils/FormatResponse.js'; /** * Handles shared auto moderation functionality. diff --git a/lib/extensions/discord.js/ExtendedGuild.ts b/lib/extensions/discord.js/ExtendedGuild.ts index 63ee2fd..20c3d29 100644 --- a/lib/extensions/discord.js/ExtendedGuild.ts +++ b/lib/extensions/discord.js/ExtendedGuild.ts @@ -11,6 +11,9 @@ import { type GuildLogType, type GuildModel } from '#lib'; +import * as Moderation from '#lib/common/Moderation.js'; +import { Guild as GuildDB, ModLogType } from '#lib/models/index.js'; +import { addOrRemoveFromArray } from '#lib/utils/BushUtils.js'; import assert from 'assert/strict'; import { AttachmentBuilder, @@ -39,10 +42,6 @@ import { type WebhookMessageOptions } from 'discord.js'; import _ from 'lodash'; -import * as Moderation from '../../common/Moderation.js'; -import { Guild as GuildDB } from '../../models/instance/Guild.js'; -import { ModLogType } from '../../models/instance/ModLog.js'; -import { addOrRemoveFromArray } from '../../utils/BushUtils.js'; declare module 'discord.js' { export interface Guild { diff --git a/lib/models/instance/Guild.ts b/lib/models/instance/Guild.ts index 1d645e9..5387f81 100644 --- a/lib/models/instance/Guild.ts +++ b/lib/models/instance/Guild.ts @@ -1,8 +1,8 @@ import config from '#config'; +import { BadWordDetails } from '#lib/automod/AutomodShared.js'; +import { type BushClient } from '#lib/extensions/discord-akairo/BushClient.js'; import { ChannelType, Constants, type Snowflake } from 'discord.js'; import { DataTypes, type Sequelize } from 'sequelize'; -import { BadWordDetails } from '../../automod/AutomodShared.js'; -import { type BushClient } from '../../extensions/discord-akairo/BushClient.js'; import { BaseModel } from '../BaseModel.js'; export interface GuildModel { diff --git a/lib/models/shared/GuildCount.ts b/lib/models/shared/GuildCount.ts index 7afef56..25fd6c0 100644 --- a/lib/models/shared/GuildCount.ts +++ b/lib/models/shared/GuildCount.ts @@ -1,5 +1,5 @@ +import { Environment } from '#config'; import { DataTypes, Model, type Sequelize } from 'sequelize'; -import { Environment } from '../../../config/Config.js'; export interface GuildCountModel { timestamp: Date; diff --git a/lib/models/shared/Shared.ts b/lib/models/shared/Shared.ts index bf8d461..3d83747 100644 --- a/lib/models/shared/Shared.ts +++ b/lib/models/shared/Shared.ts @@ -1,6 +1,6 @@ +import { BadWords } from '#lib/automod/AutomodShared.js'; import { Snowflake } from 'discord.js'; import { DataTypes, Sequelize } from 'sequelize'; -import { BadWords } from '../../automod/AutomodShared.js'; import { BaseModel } from '../BaseModel.js'; export interface SharedModel { diff --git a/lib/utils/BushClientUtils.ts b/lib/utils/BushClientUtils.ts index 2cf546e..bc4a40a 100644 --- a/lib/utils/BushClientUtils.ts +++ b/lib/utils/BushClientUtils.ts @@ -1,3 +1,9 @@ +import { ConfigChannelKey } from '#config'; +import type { BushInspectOptions, CodeBlockLang } from '#lib'; +import { GlobalCache, SharedCache } from '#lib/common/BushCache.js'; +import { CommandMessage } from '#lib/extensions/discord-akairo/BushCommand.js'; +import { SlashMessage } from '#lib/extensions/discord-akairo/SlashMessage.js'; +import { Global, Shared } from '#lib/models/index.js'; import assert from 'assert/strict'; import { cleanCodeBlockContent, @@ -16,14 +22,6 @@ import { type UserResolvable } from 'discord.js'; import _ from 'lodash'; -import { ConfigChannelKey } from '../../config/Config.js'; -import { GlobalCache, SharedCache } from '../common/BushCache.js'; -import { CommandMessage } from '../extensions/discord-akairo/BushCommand.js'; -import { SlashMessage } from '../extensions/discord-akairo/SlashMessage.js'; -import { Global } from '../models/shared/Global.js'; -import { Shared } from '../models/shared/Shared.js'; -import { BushInspectOptions } from '../types/BushInspectOptions.js'; -import { CodeBlockLang } from '../types/CodeBlockLang.js'; import { emojis, Pronoun, PronounCode, pronounMapping, regex } from './BushConstants.js'; import { addOrRemoveFromArray, formatError, inspect } from './BushUtils.js'; import { generateErrorEmbed } from './ErrorHandler.js'; diff --git a/lib/utils/BushLogger.ts b/lib/utils/BushLogger.ts index 4acda69..f575b50 100644 --- a/lib/utils/BushLogger.ts +++ b/lib/utils/BushLogger.ts @@ -1,10 +1,10 @@ import chalk from 'chalk'; // eslint-disable-next-line @typescript-eslint/no-unused-vars +import { type SendMessageType } from '#lib/extensions/discord-akairo/BushClient.js'; import { bold, Client, EmbedBuilder, escapeMarkdown, PartialTextBasedChannelFields, type Message } from 'discord.js'; import { stripVTControlCharacters as stripColor } from 'node:util'; import repl, { REPLServer, REPL_MODE_STRICT } from 'repl'; import { WriteStream } from 'tty'; -import { type SendMessageType } from '../extensions/discord-akairo/BushClient.js'; import { colors } from './BushConstants.js'; import { inspect } from './BushUtils.js'; diff --git a/src/listeners/automod/presenceAutomod.ts b/src/listeners/automod/presenceAutomod.ts index f361508..4e38d36 100644 --- a/src/listeners/automod/presenceAutomod.ts +++ b/src/listeners/automod/presenceAutomod.ts @@ -1,6 +1,7 @@ import { BushClientEvents, BushListener, PresenceAutomod } from '#lib'; import chalk from 'chalk'; +// eslint-disable-next-line @typescript-eslint/no-unused-vars /* export default */ class PresenceAutomodListener extends BushListener { public constructor() { super('presenceAutomod', { diff --git a/src/tasks/feature/updateStats.d.ts b/src/tasks/feature/updateStats.d.ts deleted file mode 100644 index 22e0308..0000000 --- a/src/tasks/feature/updateStats.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { BushTask } from '#lib'; -import { Client } from 'discord.js'; -export default class UpdateStatsTask extends BushTask { - constructor(); - exec(): Promise<void>; - static init(client: Client): Promise<{ - commandsUsed: bigint; - slashCommandsUsed: bigint; - }>; -} diff --git a/src/tasks/feature/updateStats.js b/src/tasks/feature/updateStats.js deleted file mode 100644 index 48d431a..0000000 --- a/src/tasks/feature/updateStats.js +++ /dev/null @@ -1,24 +0,0 @@ -import { BushTask, Stat, Time } from '#lib'; -import { Client } from 'discord.js'; -export default class UpdateStatsTask extends BushTask { - constructor() { - super('updateStats', { - delay: 10 * 60000, - runOnStart: true - }); - } - async exec() { - const row = - (await Stat.findByPk(this.client.config.environment)) ?? - (await Stat.create({ environment: this.client.config.environment })); - row.commandsUsed = this.client.stats.commandsUsed; - row.slashCommandsUsed = this.client.stats.slashCommandsUsed; - await row.save(); - } - static async init(client) { - const temp = - (await Stat.findByPk(client.config.environment)) ?? (await Stat.create({ environment: client.config.environment })); - return { commandsUsed: temp.commandsUsed, slashCommandsUsed: temp.slashCommandsUsed }; - } -} -//# sourceMappingURL=updateStats.js.map diff --git a/src/tasks/feature/updateStats.js.map b/src/tasks/feature/updateStats.js.map deleted file mode 100644 index 01cd260..0000000 --- a/src/tasks/feature/updateStats.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"updateStats.js","sourceRoot":"","sources":["updateStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,QAAQ;IACpD;QACC,KAAK,CAAC,aAAa,EAAE;YACpB,KAAK,EAAE,EAAE,QAAc;YACvB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI;QAChB,MAAM,GAAG,GACR,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YACrD,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QACtE,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC;QAClD,GAAG,CAAC,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC;QAC5D,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAc;QACtC,MAAM,IAAI,GACT,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QACrH,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACvF,CAAC;CACD"}
\ No newline at end of file diff --git a/tsconfig.base.json b/tsconfig.base.json index e878b4a..71b1bb2 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -18,6 +18,7 @@ "moduleResolution": "NodeNext", "paths": { "#lib": ["./lib/index.ts"], + "#lib/*": ["./lib/*"], "#src/*": ["./src/*"], "#args": ["./lib/arguments/index.ts"], "#commands": ["./src/commands/index.ts"], diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index c407a2e..4e7b5c0 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -3,6 +3,5 @@ "compilerOptions": { "allowJs": true, "checkJs": true - }, - "include": ["./**/*"] + } } |