diff options
Diffstat (limited to 'src')
215 files changed, 856 insertions, 846 deletions
diff --git a/src/arguments/abbreviatedNumber.ts b/src/arguments/abbreviatedNumber.ts index e6791e6..a95b3e2 100644 --- a/src/arguments/abbreviatedNumber.ts +++ b/src/arguments/abbreviatedNumber.ts @@ -1,5 +1,5 @@ -import { BushArgumentTypeCaster } from '@lib'; -import numeral = require('numeral'); +import { type BushArgumentTypeCaster } from '@lib'; +import numeral from 'numeral'; export const abbreviatedNumberTypeCaster: BushArgumentTypeCaster = (_, phrase): number | null => { if (!phrase) return null; diff --git a/src/arguments/contentWithDuration.ts b/src/arguments/contentWithDuration.ts index 27ff1db..782cf76 100644 --- a/src/arguments/contentWithDuration.ts +++ b/src/arguments/contentWithDuration.ts @@ -1,4 +1,4 @@ -import { BushArgumentTypeCaster } from '@lib'; +import { type BushArgumentTypeCaster } from '@lib'; export const contentWithDurationTypeCaster: BushArgumentTypeCaster = async ( _, diff --git a/src/arguments/discordEmoji.ts b/src/arguments/discordEmoji.ts index 47e734d..551cf11 100644 --- a/src/arguments/discordEmoji.ts +++ b/src/arguments/discordEmoji.ts @@ -1,5 +1,5 @@ -import { Snowflake } from 'discord-api-types'; -import { BushArgumentTypeCaster } from '../lib'; +import { type Snowflake } from 'discord-api-types'; +import { type BushArgumentTypeCaster } from '../lib'; export const discordEmojiTypeCaster: BushArgumentTypeCaster = (_, phrase): { name: string; id: Snowflake } | null => { if (!phrase) return null; diff --git a/src/arguments/duration.ts b/src/arguments/duration.ts index 9f3cf99..f2da700 100644 --- a/src/arguments/duration.ts +++ b/src/arguments/duration.ts @@ -1,4 +1,4 @@ -import { BushArgumentTypeCaster } from '@lib'; +import { type BushArgumentTypeCaster } from '@lib'; export const durationTypeCaster: BushArgumentTypeCaster = (_, phrase): number | null => { return client.util.parseDuration(phrase).duration; diff --git a/src/arguments/durationSeconds.ts b/src/arguments/durationSeconds.ts index 98a5262..9882740 100644 --- a/src/arguments/durationSeconds.ts +++ b/src/arguments/durationSeconds.ts @@ -1,4 +1,4 @@ -import { BushArgumentTypeCaster } from '@lib'; +import { type BushArgumentTypeCaster } from '@lib'; export const durationSecondsTypeCaster: BushArgumentTypeCaster = (_, phrase): number | null => { phrase += 's'; diff --git a/src/arguments/globalUser.ts b/src/arguments/globalUser.ts index 3a71732..6a20260 100644 --- a/src/arguments/globalUser.ts +++ b/src/arguments/globalUser.ts @@ -1,4 +1,4 @@ -import { BushArgumentTypeCaster, BushUser } from '@lib'; +import { BushUser, type BushArgumentTypeCaster } from '@lib'; // resolve non-cached users export const globalUserTypeCaster: BushArgumentTypeCaster = async (_, phrase): Promise<BushUser | null> => { diff --git a/src/arguments/permission.ts b/src/arguments/permission.ts index bb042d5..614a1c7 100644 --- a/src/arguments/permission.ts +++ b/src/arguments/permission.ts @@ -1,4 +1,4 @@ -import { BushArgumentTypeCaster } from '@lib'; +import { type BushArgumentTypeCaster } from '@lib'; import { Permissions } from 'discord.js'; export const permissionTypeCaster: BushArgumentTypeCaster = (_, phrase) => { diff --git a/src/arguments/roleWithDuation.ts b/src/arguments/roleWithDuation.ts index 50f54e2..c139d94 100644 --- a/src/arguments/roleWithDuation.ts +++ b/src/arguments/roleWithDuation.ts @@ -1,4 +1,4 @@ -import { BushArgumentTypeCaster } from '@lib'; +import { type BushArgumentTypeCaster } from '@lib'; export const roleWithDurationTypeCaster: BushArgumentTypeCaster = async ( message, diff --git a/src/arguments/snowflake.ts b/src/arguments/snowflake.ts index add3224..290dc5b 100644 --- a/src/arguments/snowflake.ts +++ b/src/arguments/snowflake.ts @@ -1,5 +1,5 @@ -import { BushArgumentTypeCaster } from '@lib'; -import { Snowflake } from 'discord.js'; +import { type BushArgumentTypeCaster } from '@lib'; +import { type Snowflake } from 'discord.js'; export const snowflakeTypeCaster: BushArgumentTypeCaster = (_, phrase): Snowflake | null => { if (!phrase) return null; diff --git a/src/commands/_fake-command/ironmoon.ts b/src/commands/_fake-command/ironmoon.ts index 612db85..dc34ab6 100644 --- a/src/commands/_fake-command/ironmoon.ts +++ b/src/commands/_fake-command/ironmoon.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class IronmoonCommand extends BushCommand { public constructor() { diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts index dc35c87..3b0b5f1 100644 --- a/src/commands/admin/channelPermissions.ts +++ b/src/commands/admin/channelPermissions.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage, ButtonPaginator } from '@lib'; -import { GuildMember, MessageEmbed, PermissionString, Role } from 'discord.js'; +import { BushCommand, ButtonPaginator, type BushMessage, type BushSlashMessage } from '@lib'; +import { MessageEmbed, type GuildMember, type PermissionString, type Role } from 'discord.js'; export default class ChannelPermissionsCommand extends BushCommand { public constructor() { diff --git a/src/commands/admin/roleAll.ts b/src/commands/admin/roleAll.ts index 1e67874..a9db11d 100644 --- a/src/commands/admin/roleAll.ts +++ b/src/commands/admin/roleAll.ts @@ -1,5 +1,5 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { GuildMember, Role } from 'discord.js'; +import { AllowedMentions, BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; +import { type GuildMember, type Role } from 'discord.js'; export default class RoleAllCommand extends BushCommand { public constructor() { diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts index c928265..bac3ef3 100644 --- a/src/commands/config/blacklist.ts +++ b/src/commands/config/blacklist.ts @@ -1,6 +1,5 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, Global } from '@lib'; -import { Argument } from 'discord-akairo'; -import { Channel, User } from 'discord.js'; +import { AllowedMentions, BushCommand, Global, type BushMessage, type BushSlashMessage } from '@lib'; +import { User, type Channel } from 'discord.js'; export default class BlacklistCommand extends BushCommand { public constructor() { @@ -15,7 +14,7 @@ export default class BlacklistCommand extends BushCommand { args: [ { id: 'target', - customType: Argument.union('channel', 'user'), + customType: util.arg.union('channel', 'user'), prompt: { start: 'What channel or user that you would like to blacklist/unblacklist?', retry: '{error} Pick a valid user or channel.' diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts index 3342456..555b47d 100644 --- a/src/commands/config/config.ts +++ b/src/commands/config/config.ts @@ -1,19 +1,19 @@ -import { BushCommand, BushMessage, BushSlashMessage, GuildSettings, guildSettingsObj, settingsArr } from '@lib'; -import { ArgumentOptions, Flag } from 'discord-akairo'; +import { BushCommand, guildSettingsObj, settingsArr, type BushMessage, type BushSlashMessage, type GuildSettings } from '@lib'; +import { type ArgumentOptions, type Flag } from 'discord-akairo'; import { Channel, Formatters, GuildMember, - Message, MessageActionRow, MessageButton, - MessageComponentInteraction, MessageEmbed, - MessageOptions, MessageSelectMenu, Role, - Snowflake, - User + User, + type Message, + type MessageComponentInteraction, + type MessageOptions, + type Snowflake } from 'discord.js'; import _ from 'lodash'; diff --git a/src/commands/config/customAutomodPhrases.ts b/src/commands/config/customAutomodPhrases.ts index 6bed8fd..25201ff 100644 --- a/src/commands/config/customAutomodPhrases.ts +++ b/src/commands/config/customAutomodPhrases.ts @@ -1,4 +1,4 @@ -// import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +// import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; // export default class CustomAutomodPhrasesCommand extends BushCommand { // public constructor() { diff --git a/src/commands/config/disable.ts b/src/commands/config/disable.ts index 521972b..3ada74e 100644 --- a/src/commands/config/disable.ts +++ b/src/commands/config/disable.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, Global } from '@lib'; +import { AllowedMentions, BushCommand, Global, type BushMessage, type BushSlashMessage } from '@lib'; export default class DisableCommand extends BushCommand { public constructor() { diff --git a/src/commands/config/features.ts b/src/commands/config/features.ts index 8285845..065253c 100644 --- a/src/commands/config/features.ts +++ b/src/commands/config/features.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage, GuildFeatures, guildFeaturesArr, guildFeaturesObj } from '@lib'; -import { Message, MessageActionRow, MessageEmbed, MessageSelectMenu, SelectMenuInteraction } from 'discord.js'; +import { BushCommand, guildFeaturesArr, guildFeaturesObj, type BushMessage, type BushSlashMessage, type GuildFeatures } from '@lib'; +import { MessageActionRow, MessageEmbed, MessageSelectMenu, type Message, type SelectMenuInteraction } from 'discord.js'; export default class FeaturesCommand extends BushCommand { public constructor() { diff --git a/src/commands/config/levelRoles.ts b/src/commands/config/levelRoles.ts index c8f0bf3..e788615 100644 --- a/src/commands/config/levelRoles.ts +++ b/src/commands/config/levelRoles.ts @@ -1,4 +1,4 @@ -// import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +// import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; // export default class LevelRolesCommand extends BushCommand { // public constructor() { diff --git a/src/commands/config/log.ts b/src/commands/config/log.ts index c364a35..af68483 100644 --- a/src/commands/config/log.ts +++ b/src/commands/config/log.ts @@ -1,6 +1,6 @@ -import { BushCommand, BushMessage, BushSlashMessage, guildLogsArr, GuildLogType } from '@lib'; -import { ArgumentOptions, Flag } from 'discord-akairo'; -import { TextChannel } from 'discord.js'; +import { BushCommand, guildLogsArr, type BushMessage, type BushSlashMessage, type GuildLogType } from '@lib'; +import { type ArgumentOptions, type Flag } from 'discord-akairo'; +import { type TextChannel } from 'discord.js'; export default class LogCommand extends BushCommand { public constructor() { diff --git a/src/commands/dev/__template.ts b/src/commands/dev/__template.ts index 0d25766..85cc06e 100644 --- a/src/commands/dev/__template.ts +++ b/src/commands/dev/__template.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class TemplateCommand extends BushCommand { public constructor() { diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts index 5bb99e7..e22f937 100644 --- a/src/commands/dev/eval.ts +++ b/src/commands/dev/eval.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import { exec } from 'child_process'; import { MessageEmbed as _MessageEmbed } from 'discord.js'; import { transpile } from 'typescript'; diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts index a95106f..7920a37 100644 --- a/src/commands/dev/reload.ts +++ b/src/commands/dev/reload.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class ReloadCommand extends BushCommand { public constructor() { diff --git a/src/commands/dev/say.ts b/src/commands/dev/say.ts index 947f3c2..3a8b2de 100644 --- a/src/commands/dev/say.ts +++ b/src/commands/dev/say.ts @@ -1,5 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage } from '@lib'; -import { AkairoMessage } from 'discord-akairo'; +import { AllowedMentions, BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class SayCommand extends BushCommand { public constructor() { @@ -35,7 +34,7 @@ export default class SayCommand extends BushCommand { await message.util.send({ content: args.content, allowedMentions: AllowedMentions.none() }).catch(() => null); } - public override async execSlash(message: AkairoMessage, args: { content: string }) { + public override async execSlash(message: BushSlashMessage, args: { content: string }) { if (!client.config.owners.includes(message.author.id)) { return await message.interaction.reply({ content: `${util.emojis.error} Only my developers can run this command.`, diff --git a/src/commands/dev/servers.ts b/src/commands/dev/servers.ts index e26d2c7..4b98ed9 100644 --- a/src/commands/dev/servers.ts +++ b/src/commands/dev/servers.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage, ButtonPaginator } from '@lib'; -import { Guild, MessageEmbedOptions } from 'discord.js'; +import { BushCommand, ButtonPaginator, type BushMessage, type BushSlashMessage } from '@lib'; +import { type Guild, type MessageEmbedOptions } from 'discord.js'; export default class ServersCommand extends BushCommand { public constructor() { diff --git a/src/commands/dev/sh.ts b/src/commands/dev/sh.ts index 11cd28d..e32408d 100644 --- a/src/commands/dev/sh.ts +++ b/src/commands/dev/sh.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import chalk from 'chalk'; import { exec } from 'child_process'; import { MessageEmbed, Util } from 'discord.js'; diff --git a/src/commands/dev/superUser.ts b/src/commands/dev/superUser.ts index 147a6c4..41cd7eb 100644 --- a/src/commands/dev/superUser.ts +++ b/src/commands/dev/superUser.ts @@ -1,6 +1,6 @@ -import { BushCommand, BushMessage, BushSlashMessage, Global } from '@lib'; -import { ArgumentOptions, Flag } from 'discord-akairo'; -import { User } from 'discord.js'; +import { BushCommand, Global, type BushMessage, type BushSlashMessage } from '@lib'; +import { type ArgumentOptions, type Flag } from 'discord-akairo'; +import { type User } from 'discord.js'; export default class SuperUserCommand extends BushCommand { public constructor() { diff --git a/src/commands/dev/test.ts b/src/commands/dev/test.ts index 8ea57f9..d6c20f7 100644 --- a/src/commands/dev/test.ts +++ b/src/commands/dev/test.ts @@ -1,11 +1,11 @@ -import { BushCommand, BushMessage, ButtonPaginator } from '@lib'; +import { BushCommand, ButtonPaginator, type BushMessage } from '@lib'; import { - ApplicationCommand, - Collection, Constants as jsConstants, MessageActionRow, MessageButton, - MessageEmbed + MessageEmbed, + type ApplicationCommand, + type Collection } from 'discord.js'; export default class TestCommand extends BushCommand { diff --git a/src/commands/fun/coinflip.ts b/src/commands/fun/coinflip.ts index 2d1f70c..ef55518 100644 --- a/src/commands/fun/coinflip.ts +++ b/src/commands/fun/coinflip.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class CoinFlipCommand extends BushCommand { public constructor() { diff --git a/src/commands/fun/dice.ts b/src/commands/fun/dice.ts index 5058617..fef5c7a 100644 --- a/src/commands/fun/dice.ts +++ b/src/commands/fun/dice.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class EightBallCommand extends BushCommand { public constructor() { diff --git a/src/commands/fun/eightBall.ts b/src/commands/fun/eightBall.ts index e96e006..2555fdb 100644 --- a/src/commands/fun/eightBall.ts +++ b/src/commands/fun/eightBall.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class EightBallCommand extends BushCommand { public constructor() { diff --git a/src/commands/fun/minesweeper.ts b/src/commands/fun/minesweeper.ts index c9b0a8c..6c6d4f4 100644 --- a/src/commands/fun/minesweeper.ts +++ b/src/commands/fun/minesweeper.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import Minesweeper from 'discord.js-minesweeper'; export default class MinesweeperCommand extends BushCommand { diff --git a/src/commands/info/avatar.ts b/src/commands/info/avatar.ts index 44e1556..10994d9 100644 --- a/src/commands/info/avatar.ts +++ b/src/commands/info/avatar.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { GuildMember, MessageEmbed, User } from 'discord.js'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; +import { GuildMember, MessageEmbed, type User } from 'discord.js'; export default class AvatarCommand extends BushCommand { constructor() { diff --git a/src/commands/info/botInfo.ts b/src/commands/info/botInfo.ts index a072224..d5f37e8 100644 --- a/src/commands/info/botInfo.ts +++ b/src/commands/info/botInfo.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import { MessageEmbed, version as discordJSVersion } from 'discord.js'; import * as os from 'os'; import prettyBytes from 'pretty-bytes'; diff --git a/src/commands/info/color.ts b/src/commands/info/color.ts index 021f319..5c3f14c 100644 --- a/src/commands/info/color.ts +++ b/src/commands/info/color.ts @@ -1,7 +1,7 @@ -import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushRole, BushSlashMessage } from '@lib'; +import { AllowedMentions, BushCommand, type BushGuildMember, type BushMessage, type BushRole, type BushSlashMessage } from '@lib'; import { Argument } from 'discord-akairo'; -import { Message, MessageEmbed, Role } from 'discord.js'; -import tinycolor from 'tinycolor2'; // this is the only way I got it to work consistently +import { MessageEmbed, Role, type Message } from 'discord.js'; +import tinycolor from 'tinycolor2'; const isValidTinyColor = (_message: Message, phase: string) => { // if the phase is a number it converts it to hex incase it could be representing a color in decimal @@ -37,7 +37,7 @@ export default class ColorCommand extends BushCommand { } public removePrefixAndParenthesis(color: string): string { - return color.substr(4, color.length - 5); + return color.substring(4, color.length - 5); } public override async exec(message: BushMessage | BushSlashMessage, args: { color: string | BushRole | BushGuildMember }) { diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts index 51d9984..3c287dd 100644 --- a/src/commands/info/guildInfo.ts +++ b/src/commands/info/guildInfo.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { BaseGuildVoiceChannel, Guild, GuildPreview, MessageEmbed, Snowflake, Vanity } from 'discord.js'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; +import { Guild, MessageEmbed, type BaseGuildVoiceChannel, type GuildPreview, type Snowflake, type Vanity } from 'discord.js'; export default class GuildInfoCommand extends BushCommand { public constructor() { diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index c814adb..e22aa5d 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -1,6 +1,7 @@ import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; import { MessageActionRow, MessageButton, MessageEmbed } from 'discord.js'; import packageDotJSON from '../../../package.json'; + export default class HelpCommand extends BushCommand { public constructor() { super('help', { diff --git a/src/commands/info/icon.ts b/src/commands/info/icon.ts index 0eb7bfc..b9cc4e0 100644 --- a/src/commands/info/icon.ts +++ b/src/commands/info/icon.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import { MessageEmbed } from 'discord.js'; export default class IconCommand extends BushCommand { diff --git a/src/commands/info/links.ts b/src/commands/info/links.ts index 7b52fef..d4bcff0 100644 --- a/src/commands/info/links.ts +++ b/src/commands/info/links.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import { MessageActionRow, MessageButton } from 'discord.js'; import packageDotJSON from '../../../package.json'; diff --git a/src/commands/info/ping.ts b/src/commands/info/ping.ts index 8d05307..831eeb7 100644 --- a/src/commands/info/ping.ts +++ b/src/commands/info/ping.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { Message, MessageEmbed } from 'discord.js'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; +import { MessageEmbed, type Message } from 'discord.js'; export default class PingCommand extends BushCommand { public constructor() { diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts index 132b719..390d1bb 100644 --- a/src/commands/info/pronouns.ts +++ b/src/commands/info/pronouns.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { MessageEmbed, User } from 'discord.js'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; +import { MessageEmbed, type User } from 'discord.js'; export default class PronounsCommand extends BushCommand { public constructor() { diff --git a/src/commands/info/snowflake.ts b/src/commands/info/snowflake.ts index 2b75b30..2b3c816 100644 --- a/src/commands/info/snowflake.ts +++ b/src/commands/info/snowflake.ts @@ -1,20 +1,20 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import { - CategoryChannel, - Channel, - DeconstructedSnowflake, - DMChannel, - Emoji, - Guild, MessageEmbed, - NewsChannel, - Role, - Snowflake, SnowflakeUtil, - StageChannel, - TextChannel, - User, - VoiceChannel + VoiceChannel, + type CategoryChannel, + type Channel, + type DeconstructedSnowflake, + type DMChannel, + type Emoji, + type Guild, + type NewsChannel, + type Role, + type Snowflake, + type StageChannel, + type TextChannel, + type User } from 'discord.js'; export default class SnowflakeCommand extends BushCommand { diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index 7969875..fe4fd85 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage, BushUser } from '@lib'; -import { MessageEmbed, Snowflake } from 'discord.js'; +import { BushCommand, type BushMessage, type BushSlashMessage, type BushUser } from '@lib'; +import { MessageEmbed, type Snowflake } from 'discord.js'; // TODO: Add bot information export default class UserInfoCommand extends BushCommand { diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts index 61d3769..baede6c 100644 --- a/src/commands/leveling/leaderboard.ts +++ b/src/commands/leveling/leaderboard.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage, ButtonPaginator, Level } from '@lib'; +import { BushCommand, ButtonPaginator, Level, type BushMessage, type BushSlashMessage } from '@lib'; import { MessageEmbed } from 'discord.js'; export default class LeaderboardCommand extends BushCommand { diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts index 588456b..9f2e6bb 100644 --- a/src/commands/leveling/level.ts +++ b/src/commands/leveling/level.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushGuild, BushMessage, BushSlashMessage, BushUser, CanvasProgressBar, Level } from '@lib'; +import { AllowedMentions, BushCommand, CanvasProgressBar, Level, type BushGuild, type BushMessage, type BushSlashMessage, type BushUser } from '@lib'; import canvas from 'canvas'; import { MessageAttachment } from 'discord.js'; import got from 'got/dist/source'; diff --git a/src/commands/leveling/setLevel.ts b/src/commands/leveling/setLevel.ts index 18138bc..9e73308 100644 --- a/src/commands/leveling/setLevel.ts +++ b/src/commands/leveling/setLevel.ts @@ -1,5 +1,5 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, Level } from '@lib'; -import { User } from 'discord.js'; +import { AllowedMentions, BushCommand, Level, type BushMessage, type BushSlashMessage } from '@lib'; +import { type User } from 'discord.js'; export default class SetLevelCommand extends BushCommand { public constructor() { diff --git a/src/commands/leveling/setXp.ts b/src/commands/leveling/setXp.ts index 4bcaff6..a00bfc9 100644 --- a/src/commands/leveling/setXp.ts +++ b/src/commands/leveling/setXp.ts @@ -1,5 +1,5 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, Level } from '@lib'; -import { User } from 'discord.js'; +import { AllowedMentions, BushCommand, Level, type BushMessage, type BushSlashMessage } from '@lib'; +import { type User } from 'discord.js'; export default class SetXpCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/_lockdown.ts b/src/commands/moderation/_lockdown.ts index 34d5698..e71bd80 100644 --- a/src/commands/moderation/_lockdown.ts +++ b/src/commands/moderation/_lockdown.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushNewsChannel, BushSlashMessage, BushTextChannel } from '@lib'; +import { BushCommand, type BushMessage, type BushNewsChannel, type BushSlashMessage, type BushTextChannel } from '@lib'; export default class LockdownCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index 5569069..660235f 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -1,5 +1,5 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, Moderation } from '@lib'; -import { Snowflake, User } from 'discord.js'; +import { AllowedMentions, BushCommand, Moderation, type BushMessage, type BushSlashMessage } from '@lib'; +import { type Snowflake, type User } from 'discord.js'; export default class BanCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/evidence.ts b/src/commands/moderation/evidence.ts index 8dc65f3..a2fa40b 100644 --- a/src/commands/moderation/evidence.ts +++ b/src/commands/moderation/evidence.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage, ModLog } from '@lib'; -import { ArgumentOptions, Flag } from 'discord-akairo'; +import { BushCommand, ModLog, type BushMessage, type BushSlashMessage } from '@lib'; +import { type ArgumentOptions, type Flag } from 'discord-akairo'; export default class EvidenceCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/hideCase.ts b/src/commands/moderation/hideCase.ts index 693197a..44170a9 100644 --- a/src/commands/moderation/hideCase.ts +++ b/src/commands/moderation/hideCase.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage, ModLog } from '@lib'; +import { BushCommand, ModLog, type BushMessage, type BushSlashMessage } from '@lib'; export default class HideCaseCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index dab6807..858a392 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, BushUser, Moderation } from '@lib'; +import { AllowedMentions, BushCommand, Moderation, type BushMessage, type BushSlashMessage, type BushUser } from '@lib'; export default class KickCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts index 2bd0f5a..35ac6f6 100644 --- a/src/commands/moderation/modlog.ts +++ b/src/commands/moderation/modlog.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage, BushUser, ButtonPaginator, ModLog } from '@lib'; +import { BushCommand, ButtonPaginator, ModLog, type BushMessage, type BushSlashMessage, type BushUser } from '@lib'; import { MessageEmbed, User } from 'discord.js'; export default class ModlogCommand extends BushCommand { diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts index 6f594a0..9938d3f 100644 --- a/src/commands/moderation/mute.ts +++ b/src/commands/moderation/mute.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, BushUser, Moderation } from '@lib'; +import { AllowedMentions, BushCommand, Moderation, type BushMessage, type BushSlashMessage, type BushUser } from '@lib'; export default class MuteCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/purge.ts b/src/commands/moderation/purge.ts index e5fea8e..ef2b0b5 100644 --- a/src/commands/moderation/purge.ts +++ b/src/commands/moderation/purge.ts @@ -1,5 +1,5 @@ import { BushCommand, BushMessage } from '@lib'; -import { Collection, Snowflake } from 'discord.js'; +import { Collection, type Snowflake } from 'discord.js'; export default class PurgeCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/removeReactionEmoji.ts b/src/commands/moderation/removeReactionEmoji.ts index 3e14aa2..1645b46 100644 --- a/src/commands/moderation/removeReactionEmoji.ts +++ b/src/commands/moderation/removeReactionEmoji.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage } from '@lib'; -import { Emoji, Snowflake } from 'discord.js'; +import { BushCommand, type BushMessage } from '@lib'; +import { type Emoji, type Snowflake } from 'discord.js'; export default class RemoveReactionEmojiCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts index a0d6518..73901e5 100644 --- a/src/commands/moderation/role.ts +++ b/src/commands/moderation/role.ts @@ -1,5 +1,5 @@ -import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushRole, BushSlashMessage } from '@lib'; -import { ArgumentOptions, Flag } from 'discord-akairo'; +import { AllowedMentions, BushCommand, type BushGuildMember, type BushMessage, type BushRole, type BushSlashMessage } from '@lib'; +import { type ArgumentOptions, type Flag } from 'discord-akairo'; export default class RoleCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/slowmode.ts b/src/commands/moderation/slowmode.ts index 4192ecf..40b5ed1 100644 --- a/src/commands/moderation/slowmode.ts +++ b/src/commands/moderation/slowmode.ts @@ -1,6 +1,6 @@ -import { BushCommand, BushMessage, BushNewsChannel, BushSlashMessage, BushTextChannel, BushThreadChannel } from '@lib'; +import { BushCommand, type BushMessage, type BushNewsChannel, type BushSlashMessage, type BushTextChannel, type BushThreadChannel } from '@lib'; import { Argument } from 'discord-akairo'; -import { NewsChannel, TextChannel, ThreadChannel } from 'discord.js'; +import { TextChannel, ThreadChannel, type NewsChannel } from 'discord.js'; export default class SlowModeCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/unban.ts b/src/commands/moderation/unban.ts index 3d61e82..ec610d9 100644 --- a/src/commands/moderation/unban.ts +++ b/src/commands/moderation/unban.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, BushUser } from '@lib'; +import { AllowedMentions, BushCommand, type BushMessage, type BushSlashMessage, type BushUser } from '@lib'; export default class UnbanCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts index ca7861c..f0e0899 100644 --- a/src/commands/moderation/unmute.ts +++ b/src/commands/moderation/unmute.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushSlashMessage, BushUser, Moderation } from '@lib'; +import { AllowedMentions, BushCommand, Moderation, type BushGuildMember, type BushMessage, type BushSlashMessage, type BushUser } from '@lib'; export default class UnmuteCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts index d326806..a050351 100644 --- a/src/commands/moderation/warn.ts +++ b/src/commands/moderation/warn.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushSlashMessage, BushUser, Moderation } from '@lib'; +import { AllowedMentions, BushCommand, Moderation, type BushGuildMember, type BushMessage, type BushSlashMessage, type BushUser } from '@lib'; export default class WarnCommand extends BushCommand { public constructor() { diff --git a/src/commands/moulberry-bush/capePerms.ts b/src/commands/moulberry-bush/capePerms.ts index ddd975d..703f32e 100644 --- a/src/commands/moulberry-bush/capePerms.ts +++ b/src/commands/moulberry-bush/capePerms.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import { MessageEmbed } from 'discord.js'; import got from 'got'; diff --git a/src/commands/moulberry-bush/capes.ts b/src/commands/moulberry-bush/capes.ts index 3590d9f..fab70df 100644 --- a/src/commands/moulberry-bush/capes.ts +++ b/src/commands/moulberry-bush/capes.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, ButtonPaginator, DeleteButton } from '@lib'; -import { MessageEmbedOptions } from 'discord.js'; +import { BushCommand, ButtonPaginator, DeleteButton, type BushMessage } from '@lib'; +import { type MessageEmbedOptions } from 'discord.js'; import got from 'got'; export default class CapesCommand extends BushCommand { diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts index 7aa3001..54a31e7 100644 --- a/src/commands/moulberry-bush/giveawayPing.ts +++ b/src/commands/moulberry-bush/giveawayPing.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage } from '@lib'; +import { AllowedMentions, BushCommand, type BushMessage } from '@lib'; export default class GiveawayPingCommand extends BushCommand { public constructor() { diff --git a/src/commands/moulberry-bush/moulHammer.ts b/src/commands/moulberry-bush/moulHammer.ts index 5f1c11a..2c10bd4 100644 --- a/src/commands/moulberry-bush/moulHammer.ts +++ b/src/commands/moulberry-bush/moulHammer.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage } from '@lib'; -import { MessageEmbed, User } from 'discord.js'; +import { BushCommand, type BushMessage } from '@lib'; +import { MessageEmbed, type User } from 'discord.js'; export default class MoulHammerCommand extends BushCommand { public constructor() { diff --git a/src/commands/moulberry-bush/report.ts b/src/commands/moulberry-bush/report.ts index ae6d8c7..9a69c4a 100644 --- a/src/commands/moulberry-bush/report.ts +++ b/src/commands/moulberry-bush/report.ts @@ -1,5 +1,5 @@ -import { AllowedMentions, BushCommand, BushMessage } from '@lib'; -import { GuildMember, MessageEmbed } from 'discord.js'; +import { AllowedMentions, BushCommand, type BushMessage } from '@lib'; +import { MessageEmbed, type GuildMember } from 'discord.js'; import moment from 'moment'; export default class ReportCommand extends BushCommand { diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts index fa421f5..6beb6b4 100644 --- a/src/commands/moulberry-bush/rule.ts +++ b/src/commands/moulberry-bush/rule.ts @@ -1,5 +1,5 @@ -import { AllowedMentions, BushCommand, BushMessage } from '@lib'; -import { MessageEmbed, User } from 'discord.js'; +import { AllowedMentions, BushCommand, type BushMessage } from '@lib'; +import { MessageEmbed, type User } from 'discord.js'; const rules = [ { diff --git a/src/commands/moulberry-bush/serverStatus.ts b/src/commands/moulberry-bush/serverStatus.ts index f656e4c..17f1090 100644 --- a/src/commands/moulberry-bush/serverStatus.ts +++ b/src/commands/moulberry-bush/serverStatus.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage } from '@lib'; +import { BushCommand, type BushMessage } from '@lib'; import { MessageEmbed } from 'discord.js'; import got from 'got'; diff --git a/src/commands/utilities/activity.ts b/src/commands/utilities/activity.ts index 455bbf3..91d6328 100644 --- a/src/commands/utilities/activity.ts +++ b/src/commands/utilities/activity.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import { DiscordAPIError, Message, VoiceChannel } from 'discord.js'; const activityMap = { diff --git a/src/commands/utilities/calculator.ts b/src/commands/utilities/calculator.ts index b32b29b..1df4264 100644 --- a/src/commands/utilities/calculator.ts +++ b/src/commands/utilities/calculator.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { AllowedMentions, BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import { MessageEmbed } from 'discord.js'; import { evaluate } from 'mathjs'; diff --git a/src/commands/utilities/decode.ts b/src/commands/utilities/decode.ts index 6812d91..5ecd6f1 100644 --- a/src/commands/utilities/decode.ts +++ b/src/commands/utilities/decode.ts @@ -1,5 +1,5 @@ -import { AllowedMentions, BushCommand, BushMessage } from '@lib'; -import { AkairoMessage } from 'discord-akairo'; +import { AllowedMentions, BushCommand, type BushMessage } from '@lib'; +import { type AkairoMessage } from 'discord-akairo'; import { MessageEmbed } from 'discord.js'; const encodingTypesArray = ['ascii', 'utf8', 'utf-8', 'utf16le', 'ucs2', 'ucs-2', 'base64', 'latin1', 'binary', 'hex']; diff --git a/src/commands/utilities/hash.ts b/src/commands/utilities/hash.ts index 646ed28..5b3bcfb 100644 --- a/src/commands/utilities/hash.ts +++ b/src/commands/utilities/hash.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage } from '@lib'; +import { BushCommand, type BushMessage } from '@lib'; import crypto from 'crypto'; import got from 'got'; diff --git a/src/commands/utilities/price.ts b/src/commands/utilities/price.ts index a232e56..333bfea 100644 --- a/src/commands/utilities/price.ts +++ b/src/commands/utilities/price.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage } from '@lib'; +import { BushCommand, type BushMessage } from '@lib'; import { MessageEmbed } from 'discord.js'; import Fuse from 'fuse.js'; import got from 'got'; diff --git a/src/commands/utilities/steal.ts b/src/commands/utilities/steal.ts index b92a2da..4ee7fb1 100644 --- a/src/commands/utilities/steal.ts +++ b/src/commands/utilities/steal.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage } from '@lib'; -import { Snowflake } from 'discord-api-types'; +import { BushCommand, type BushMessage } from '@lib'; +import { type Snowflake } from 'discord.js'; export default class StealCommand extends BushCommand { public constructor() { diff --git a/src/commands/utilities/suicide.ts b/src/commands/utilities/suicide.ts index 8d6f002..8050dcb 100644 --- a/src/commands/utilities/suicide.ts +++ b/src/commands/utilities/suicide.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { AllowedMentions, BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import { MessageEmbed } from 'discord.js'; export default class TemplateCommand extends BushCommand { diff --git a/src/commands/utilities/uuid.ts b/src/commands/utilities/uuid.ts index 56566d4..64e5b56 100644 --- a/src/commands/utilities/uuid.ts +++ b/src/commands/utilities/uuid.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage } from '@lib'; +import { BushCommand, type BushMessage } from '@lib'; export default class UuidCommand extends BushCommand { public constructor() { diff --git a/src/commands/utilities/viewRaw.ts b/src/commands/utilities/viewRaw.ts index 3667d40..45939b0 100644 --- a/src/commands/utilities/viewRaw.ts +++ b/src/commands/utilities/viewRaw.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { DMChannel, MessageEmbed, NewsChannel, Snowflake, TextChannel } from 'discord.js'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; +import { MessageEmbed, type DMChannel, type NewsChannel, type Snowflake, type TextChannel } from 'discord.js'; export default class ViewRawCommand extends BushCommand { public constructor() { diff --git a/src/commands/utilities/whoHasRole.ts b/src/commands/utilities/whoHasRole.ts index ce7a70e..69285d8 100644 --- a/src/commands/utilities/whoHasRole.ts +++ b/src/commands/utilities/whoHasRole.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage, ButtonPaginator } from '@lib'; -import { CommandInteraction, Role, Util } from 'discord.js'; +import { BushCommand, ButtonPaginator, type BushMessage, type BushSlashMessage } from '@lib'; +import { Util, type CommandInteraction, type Role } from 'discord.js'; export default class WhoHasRoleCommand extends BushCommand { public constructor() { diff --git a/src/commands/utilities/wolframAlpha.ts b/src/commands/utilities/wolframAlpha.ts index ea055e8..a2b4036 100644 --- a/src/commands/utilities/wolframAlpha.ts +++ b/src/commands/utilities/wolframAlpha.ts @@ -1,5 +1,5 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { MessageEmbed, MessageOptions } from 'discord.js'; +import { AllowedMentions, BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; +import { MessageEmbed, type MessageOptions } from 'discord.js'; import WolframAlphaAPI from 'wolfram-alpha-api'; export default class WolframAlphaCommand extends BushCommand { diff --git a/src/context-menu-commands/message/viewRaw.ts b/src/context-menu-commands/message/viewRaw.ts index 24dfb97..4af6fa1 100644 --- a/src/context-menu-commands/message/viewRaw.ts +++ b/src/context-menu-commands/message/viewRaw.ts @@ -1,6 +1,6 @@ -import { BushMessage } from '@lib'; +import { type BushMessage } from '@lib'; import { ContextMenuCommand } from 'discord-akairo'; -import { ContextMenuInteraction } from 'discord.js'; +import { type ContextMenuInteraction } from 'discord.js'; import ViewRawCommand from '../../commands/utilities/viewRaw'; export default class ViewRawContextMenuCommand extends ContextMenuCommand { diff --git a/src/inhibitors/blacklist/channelGlobalBlacklist.ts b/src/inhibitors/blacklist/channelGlobalBlacklist.ts index 2725431..c2aad0e 100644 --- a/src/inhibitors/blacklist/channelGlobalBlacklist.ts +++ b/src/inhibitors/blacklist/channelGlobalBlacklist.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class UserGlobalBlacklistInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/blacklist/channelGuildBlacklist.ts b/src/inhibitors/blacklist/channelGuildBlacklist.ts index 63334c4..6725068 100644 --- a/src/inhibitors/blacklist/channelGuildBlacklist.ts +++ b/src/inhibitors/blacklist/channelGuildBlacklist.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class ChannelGuildBlacklistInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/blacklist/guildBlacklist.ts b/src/inhibitors/blacklist/guildBlacklist.ts index ec78995..f3ae7c7 100644 --- a/src/inhibitors/blacklist/guildBlacklist.ts +++ b/src/inhibitors/blacklist/guildBlacklist.ts @@ -1,4 +1,4 @@ -import { BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushMessage, type BushSlashMessage } from '@lib'; export default class GuildBlacklistInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/blacklist/userGlobalBlacklist.ts b/src/inhibitors/blacklist/userGlobalBlacklist.ts index 65d763d..8b5d00c 100644 --- a/src/inhibitors/blacklist/userGlobalBlacklist.ts +++ b/src/inhibitors/blacklist/userGlobalBlacklist.ts @@ -1,4 +1,4 @@ -import { BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushMessage, type BushSlashMessage } from '@lib'; export default class UserGlobalBlacklistInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/blacklist/userGuildBlacklist.ts b/src/inhibitors/blacklist/userGuildBlacklist.ts index 34a24d3..ed87cf8 100644 --- a/src/inhibitors/blacklist/userGuildBlacklist.ts +++ b/src/inhibitors/blacklist/userGuildBlacklist.ts @@ -1,4 +1,4 @@ -import { BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushMessage, type BushSlashMessage } from '@lib'; export default class UserGuildBlacklistInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/checks/fatal.ts b/src/inhibitors/checks/fatal.ts index 6b62507..01ff78c 100644 --- a/src/inhibitors/checks/fatal.ts +++ b/src/inhibitors/checks/fatal.ts @@ -1,4 +1,4 @@ -import { BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushMessage, type BushSlashMessage } from '@lib'; export default class FatalInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/checks/guildUnavailable.ts b/src/inhibitors/checks/guildUnavailable.ts index 0bd1bec..ad70e4b 100644 --- a/src/inhibitors/checks/guildUnavailable.ts +++ b/src/inhibitors/checks/guildUnavailable.ts @@ -1,4 +1,4 @@ -import { BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushMessage, type BushSlashMessage } from '@lib'; export default class GuildUnavailableInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/command/dm.ts b/src/inhibitors/command/dm.ts index 4e9c53e..5e1f32d 100644 --- a/src/inhibitors/command/dm.ts +++ b/src/inhibitors/command/dm.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class DMInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/command/globalDisabledCommand.ts b/src/inhibitors/command/globalDisabledCommand.ts index a6e24c7..09fc54a 100644 --- a/src/inhibitors/command/globalDisabledCommand.ts +++ b/src/inhibitors/command/globalDisabledCommand.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class DisabledGuildCommandInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/command/guild.ts b/src/inhibitors/command/guild.ts index b960439..a0d3da1 100644 --- a/src/inhibitors/command/guild.ts +++ b/src/inhibitors/command/guild.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class GuildInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/command/guildDisabledCommand.ts b/src/inhibitors/command/guildDisabledCommand.ts index d56e42c..defed50 100644 --- a/src/inhibitors/command/guildDisabledCommand.ts +++ b/src/inhibitors/command/guildDisabledCommand.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class DisabledGuildCommandInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/command/nsfw.ts b/src/inhibitors/command/nsfw.ts index 563cb7a..ba798c2 100644 --- a/src/inhibitors/command/nsfw.ts +++ b/src/inhibitors/command/nsfw.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; -import { TextChannel } from 'discord.js'; +import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; +import { type TextChannel } from 'discord.js'; export default class NsfwInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/command/owner.ts b/src/inhibitors/command/owner.ts index 22ac913..92c8d34 100644 --- a/src/inhibitors/command/owner.ts +++ b/src/inhibitors/command/owner.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class OwnerInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/command/restrictedChannel.ts b/src/inhibitors/command/restrictedChannel.ts index 4578d95..9dab7e2 100644 --- a/src/inhibitors/command/restrictedChannel.ts +++ b/src/inhibitors/command/restrictedChannel.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class RestrictedChannelInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/command/restrictedGuild.ts b/src/inhibitors/command/restrictedGuild.ts index 7ec6926..d7eb5f1 100644 --- a/src/inhibitors/command/restrictedGuild.ts +++ b/src/inhibitors/command/restrictedGuild.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class RestrictedGuildInhibitor extends BushInhibitor { public constructor() { diff --git a/src/inhibitors/command/superUser.ts b/src/inhibitors/command/superUser.ts index 28674ea..2430982 100644 --- a/src/inhibitors/command/superUser.ts +++ b/src/inhibitors/command/superUser.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; export default class SuperUserInhibitor extends BushInhibitor { public constructor() { diff --git a/src/lib/badwords.ts b/src/lib/badwords.ts index 5caddd5..18c7755 100644 --- a/src/lib/badwords.ts +++ b/src/lib/badwords.ts @@ -1,4 +1,4 @@ -import { BadWords, Severity } from "./common/AutoMod"; +import { Severity, type BadWords } from "./common/AutoMod"; export default { /* -------------------------------------------------------------------------- */ diff --git a/src/lib/common/AutoMod.ts b/src/lib/common/AutoMod.ts index 38c488b..c749a33 100644 --- a/src/lib/common/AutoMod.ts +++ b/src/lib/common/AutoMod.ts @@ -1,10 +1,8 @@ -import { GuildMember, MessageActionRow, MessageButton, MessageEmbed, TextChannel } from 'discord.js'; +import { Moderation, type BushButtonInteraction, type BushMessage } from '@lib'; +import { GuildMember, MessageActionRow, MessageButton, MessageEmbed, type TextChannel } from 'discord.js'; import badLinksArray from '../badlinks'; import badLinksSecretArray from '../badlinks-secret'; // I cannot make this public so just make a new file that export defaults an empty array import badWords from '../badwords'; -import { BushButtonInteraction } from '../extensions/discord.js/BushButtonInteraction'; -import { BushMessage } from '../extensions/discord.js/BushMessage'; -import { Moderation } from './Moderation'; export class AutoMod { private message: BushMessage; @@ -190,7 +188,7 @@ export class AutoMod { const [action, userId, reason] = interaction.customId.replace('automod;', '').split(';'); switch (action) { case 'ban': { - const victim = await interaction.guild!.members.fetch(userId); + const victim = await interaction.guild!.members.fetch(userId).catch(() => null); const moderator = interaction.member instanceof GuildMember ? interaction.member diff --git a/src/lib/common/ButtonPaginator.ts b/src/lib/common/ButtonPaginator.ts index da595d5..58134b5 100644 --- a/src/lib/common/ButtonPaginator.ts +++ b/src/lib/common/ButtonPaginator.ts @@ -1,13 +1,12 @@ +import { DeleteButton, type BushMessage, type BushSlashMessage } from '@lib'; import { Constants, MessageActionRow, MessageButton, - MessageComponentInteraction, MessageEmbed, - MessageEmbedOptions + type MessageComponentInteraction, + type MessageEmbedOptions } from 'discord.js'; -import { BushMessage, BushSlashMessage } from '..'; -import { DeleteButton } from './DeleteButton'; export class ButtonPaginator { protected message: BushMessage | BushSlashMessage; @@ -86,7 +85,7 @@ export class ButtonPaginator { protected async collect(interaction: MessageComponentInteraction) { if (interaction.user.id !== this.message.author.id && !client.config.owners.includes(interaction.user.id)) - return await interaction?.deferUpdate().catch(() => undefined); + return await interaction?.deferUpdate().catch(() => null); switch (interaction.customId) { case 'paginate_beginning': @@ -97,8 +96,8 @@ export class ButtonPaginator { return await this.edit(interaction); case 'paginate_stop': if (this.deleteOnExit) { - await interaction.deferUpdate().catch(() => undefined); - return await this.sentMessage!.delete().catch(() => undefined); + await interaction.deferUpdate().catch(() => null); + return await this.sentMessage!.delete().catch(() => null); } else { return await interaction ?.update({ @@ -106,7 +105,7 @@ export class ButtonPaginator { embeds: [], components: [] }) - .catch(() => undefined); + .catch(() => null); } case 'paginate_next': this.curPage++; @@ -125,19 +124,15 @@ export class ButtonPaginator { embeds: [this.embeds[this.curPage]], components: [this.getPaginationRow(true)] }) - .catch(() => undefined); + .catch(() => null); } protected async edit(interaction: MessageComponentInteraction) { - try { - return interaction?.update({ - content: this.text, - embeds: [this.embeds[this.curPage]], - components: [this.getPaginationRow()] - }); - } catch (e) { - return undefined; - } + return interaction?.update({ + content: this.text, + embeds: [this.embeds[this.curPage]], + components: [this.getPaginationRow()] + }).catch(() => null); } protected getPaginationRow(disableAll = false): MessageActionRow { diff --git a/src/lib/common/DeleteButton.ts b/src/lib/common/DeleteButton.ts index 7d2e41b..95bae24 100644 --- a/src/lib/common/DeleteButton.ts +++ b/src/lib/common/DeleteButton.ts @@ -1,6 +1,5 @@ -import { Constants, MessageActionRow, MessageButton, MessageComponentInteraction, MessageOptions } from 'discord.js'; -import { BushMessage, BushSlashMessage } from '..'; -import { PaginateEmojis } from './ButtonPaginator'; +import { PaginateEmojis, type BushMessage, type BushSlashMessage } from '@lib'; +import { Constants, MessageActionRow, MessageButton, type MessageComponentInteraction, type MessageOptions } from 'discord.js'; export class DeleteButton { protected messageOptions: MessageOptions; diff --git a/src/lib/common/Format.ts b/src/lib/common/Format.ts index ba1ee9f..2557b17 100644 --- a/src/lib/common/Format.ts +++ b/src/lib/common/Format.ts @@ -1,5 +1,5 @@ +import { type CodeBlockLang } from '@lib'; import { Formatters, Util } from 'discord.js'; -import { CodeBlockLang } from './typings/CodeBlockLang'; /** * Formats and escapes content for formatting diff --git a/src/lib/common/Moderation.ts b/src/lib/common/Moderation.ts index 0c7c21a..d0367d5 100644 --- a/src/lib/common/Moderation.ts +++ b/src/lib/common/Moderation.ts @@ -1,14 +1,14 @@ -import { Snowflake } from 'discord-api-types'; import { ActivePunishment, ActivePunishmentType, - BushGuildMember, - BushGuildMemberResolvable, - BushGuildResolvable, Guild, ModLog, - ModLogType -} from '..'; + ModLogType, + type BushGuildMember, + type BushGuildMemberResolvable, + type BushGuildResolvable +} from '@lib'; +import { type Snowflake } from 'discord.js'; export class Moderation { /** diff --git a/src/lib/common/typings/BushInspectOptions.d.ts b/src/lib/common/typings/BushInspectOptions.d.ts index c2a2360..11c2dc1 100644 --- a/src/lib/common/typings/BushInspectOptions.d.ts +++ b/src/lib/common/typings/BushInspectOptions.d.ts @@ -1,4 +1,4 @@ -import { InspectOptions } from 'util'; +import { type InspectOptions } from 'util'; /** * {@link https://nodejs.org/api/util.html#util_util_inspect_object_options} diff --git a/src/lib/common/util/Arg.ts b/src/lib/common/util/Arg.ts index d267eb9..3c8e642 100644 --- a/src/lib/common/util/Arg.ts +++ b/src/lib/common/util/Arg.ts @@ -1,6 +1,6 @@ -import { AkairoMessage, Argument, ArgumentTypeCaster, Flag, ParsedValuePredicate } from 'discord-akairo'; -import { Message } from 'discord.js'; -import { BushArgumentType } from '../..'; +import { type BushArgumentType, type BushMessage, type BushSlashMessage } from '@lib'; +import { Argument, type ArgumentTypeCaster, type Flag, type ParsedValuePredicate } from 'discord-akairo'; +import { type Message } from 'discord.js'; export class Arg { /** @@ -9,7 +9,7 @@ export class Arg { * @param message - Message that called the command. * @param phrase - Phrase to process. */ - public static cast(type: BushArgumentType, message: Message | AkairoMessage, phrase: string): Promise<any> { + public static cast(type: BushArgumentType, message: BushMessage | BushSlashMessage, phrase: string): Promise<any> { return Argument.cast(type, client.commandHandler.resolver, message as Message, phrase); } diff --git a/src/lib/extensions/discord-akairo/BushArgumentTypeCaster.ts b/src/lib/extensions/discord-akairo/BushArgumentTypeCaster.ts index 42d989c..c07644c 100644 --- a/src/lib/extensions/discord-akairo/BushArgumentTypeCaster.ts +++ b/src/lib/extensions/discord-akairo/BushArgumentTypeCaster.ts @@ -1,3 +1,3 @@ -import { BushMessage } from '../discord.js/BushMessage'; +import { type BushMessage } from '@lib'; export type BushArgumentTypeCaster = (message: BushMessage, phrase: string) => any; diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts index c5d05b7..8f7533c 100644 --- a/src/lib/extensions/discord-akairo/BushClient.ts +++ b/src/lib/extensions/discord-akairo/BushClient.ts @@ -1,21 +1,20 @@ import * as Sentry from '@sentry/node'; import { AkairoClient, ContextMenuCommandHandler, version as akairoVersion } from 'discord-akairo'; import { - Awaitable, - Collection, - Intents, - InteractionReplyOptions, - Message, - MessageEditOptions, - MessageOptions, - MessagePayload, - Options, - PartialDMChannel, - ReplyMessageOptions, - Snowflake, - Structures, - version as discordJsVersion, - WebhookEditMessageOptions + DMChannel, + Intents, Options, + Structures, version as discordJsVersion, + type Awaitable, + type Collection, + type InteractionReplyOptions, + type Message, + type MessageEditOptions, + type MessageOptions, + type MessagePayload, + type PartialDMChannel, + type ReplyMessageOptions, + type Snowflake, + type WebhookEditMessageOptions } from 'discord.js'; //@ts-ignore: no typings import eventsIntercept from 'events-intercept'; @@ -89,7 +88,7 @@ export type BushThreadMemberResolvable = BushThreadMember | BushUserResolvable; export type BushUserResolvable = BushUser | Snowflake | BushMessage | BushGuildMember | BushThreadMember; export type BushGuildMemberResolvable = BushGuildMember | BushUserResolvable; export type BushRoleResolvable = BushRole | Snowflake; -export type BushMessageResolvable = BushMessage | Snowflake; +export type BushMessageResolvable = Message| BushMessage | Snowflake; export type BushEmojiResolvable = Snowflake | BushGuildEmoji | BushReactionEmoji; export type BushEmojiIdentifierResolvable = string | BushEmojiResolvable; export type BushThreadChannelResolvable = BushThreadChannel | Snowflake; @@ -97,7 +96,7 @@ export type BushApplicationCommandResolvable = BushApplicationCommand | Snowflak export type BushGuildTextChannelResolvable = BushTextChannel | BushNewsChannel | Snowflake; export type BushChannelResolvable = BushChannel | Snowflake; export type BushTextBasedChannels = PartialDMChannel | BushDMChannel | BushTextChannel | BushNewsChannel | BushThreadChannel; -export type BushGuildTextBasedChannel = Exclude<BushTextBasedChannels, PartialDMChannel | BushDMChannel>; +export type BushGuildTextBasedChannel = Exclude<BushTextBasedChannels, PartialDMChannel | BushDMChannel | DMChannel>; export interface BushFetchedThreads { threads: Collection<Snowflake, BushThreadChannel>; hasMore?: boolean; diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index 32081ed..4507458 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -1,31 +1,32 @@ import { - BushCache, - BushClient, + Arg, BushConstants, - BushMessage, - BushSlashMessage, - BushUser, Global, - Pronoun, - PronounCode + type BushCache, + type BushClient, + type BushMessage, + type BushSlashMessage, + type BushUser, + type Pronoun, + type PronounCode } from '@lib'; import { exec } from 'child_process'; import { ClientUtil, Util as AkairoUtil } from 'discord-akairo'; import { APIMessage } from 'discord-api-types'; import { - ColorResolvable, - CommandInteraction, GuildMember, - InteractionReplyOptions, Message, MessageEmbed, - PermissionResolvable, - Snowflake, - TextChannel, ThreadMember, User, - UserResolvable, - Util as DiscordUtil + Util as DiscordUtil, + type ColorResolvable, + type CommandInteraction, + type InteractionReplyOptions, + type PermissionResolvable, + type Snowflake, + type TextChannel, + type UserResolvable } from 'discord.js'; import got from 'got'; import humanizeDuration from 'humanize-duration'; @@ -36,7 +37,6 @@ import CommandErrorListener from '../../../listeners/commands/commandError'; import { Format } from '../../common/Format'; import { BushInspectOptions } from '../../common/typings/BushInspectOptions'; import { CodeBlockLang } from '../../common/typings/CodeBlockLang'; -import { Arg } from '../../common/util/Arg'; import { BushNewsChannel } from '../discord.js/BushNewsChannel'; import { BushTextChannel } from '../discord.js/BushTextChannel'; import { BushSlashEditMessageType, BushSlashSendMessageType, BushUserResolvable } from './BushClient'; @@ -401,7 +401,7 @@ export class BushClientUtil extends ClientUtil { /** * Add or remove an item from an array. All duplicates will be removed. */ - public addOrRemoveFromArray<T extends any>(action: 'add' | 'remove', array: T[], value: T): T[] { + public addOrRemoveFromArray<T>(action: 'add' | 'remove', array: T[], value: T): T[] { const set = new Set(array); action === 'add' ? set.add(value) : set.delete(value); return [...set]; diff --git a/src/lib/extensions/discord-akairo/BushCommand.ts b/src/lib/extensions/discord-akairo/BushCommand.ts index e3066aa..40c5974 100644 --- a/src/lib/extensions/discord-akairo/BushCommand.ts +++ b/src/lib/extensions/discord-akairo/BushCommand.ts @@ -1,9 +1,6 @@ -import { ArgumentOptions, ArgumentPromptOptions, ArgumentTypeCaster, Command, CommandOptions } from 'discord-akairo'; -import { PermissionResolvable, Snowflake } from 'discord.js'; -import { BushMessage } from '../discord.js/BushMessage'; -import { BushClient } from './BushClient'; -import { BushCommandHandler } from './BushCommandHandler'; -import { BushSlashMessage } from './BushSlashMessage'; +import { type BushClient, type BushCommandHandler, type BushMessage, type BushSlashMessage } from '@lib'; +import { Command, type ArgumentOptions, type ArgumentPromptOptions, type ArgumentTypeCaster, type CommandOptions } from 'discord-akairo'; +import { type PermissionResolvable, type Snowflake } from 'discord.js'; export type BaseBushArgumentType = | 'string' diff --git a/src/lib/extensions/discord-akairo/BushCommandHandler.ts b/src/lib/extensions/discord-akairo/BushCommandHandler.ts index 8ab47d8..09cb303 100644 --- a/src/lib/extensions/discord-akairo/BushCommandHandler.ts +++ b/src/lib/extensions/discord-akairo/BushCommandHandler.ts @@ -1,9 +1,6 @@ -import { Category, CommandHandler, CommandHandlerEvents, CommandHandlerOptions } from 'discord-akairo'; -import { Collection, PermissionString } from 'discord.js'; -import { BushMessage } from '../discord.js/BushMessage'; -import { BushClient } from './BushClient'; -import { BushCommand } from './BushCommand'; -import { BushSlashMessage } from './BushSlashMessage'; +import { type BushClient, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; +import { CommandHandler, type Category, type CommandHandlerEvents, type CommandHandlerOptions } from 'discord-akairo'; +import { type Collection, type PermissionString } from 'discord.js'; export type BushCommandHandlerOptions = CommandHandlerOptions; diff --git a/src/lib/extensions/discord-akairo/BushCommandUtil.ts b/src/lib/extensions/discord-akairo/BushCommandUtil.ts index 7720d57..04533bd 100644 --- a/src/lib/extensions/discord-akairo/BushCommandUtil.ts +++ b/src/lib/extensions/discord-akairo/BushCommandUtil.ts @@ -1,10 +1,6 @@ -import { CommandUtil, ParsedComponentData } from 'discord-akairo'; -import { Snowflake } from 'discord-api-types'; -import { Collection } from 'discord.js'; -import { BushMessage } from '../discord.js/BushMessage'; -import { BushCommand } from './BushCommand'; -import { BushCommandHandler } from './BushCommandHandler'; -import { BushSlashMessage } from './BushSlashMessage'; +import { type BushCommand, type BushCommandHandler, type BushMessage, type BushSlashMessage } from '@lib'; +import { CommandUtil, type ParsedComponentData } from 'discord-akairo'; +import { type Collection, type Snowflake } from 'discord.js'; export interface BushParsedComponentData extends ParsedComponentData { command?: BushCommand; diff --git a/src/lib/extensions/discord-akairo/BushInhibitor.ts b/src/lib/extensions/discord-akairo/BushInhibitor.ts index d689a72..638f663 100644 --- a/src/lib/extensions/discord-akairo/BushInhibitor.ts +++ b/src/lib/extensions/discord-akairo/BushInhibitor.ts @@ -1,8 +1,5 @@ +import { type BushClient, type BushCommand, type BushMessage, type BushSlashMessage } from '@lib'; import { Inhibitor } from 'discord-akairo'; -import { BushMessage } from '../discord.js/BushMessage'; -import { BushClient } from './BushClient'; -import { BushCommand } from './BushCommand'; -import { BushSlashMessage } from './BushSlashMessage'; export class BushInhibitor extends Inhibitor { public declare client: BushClient; diff --git a/src/lib/extensions/discord-akairo/BushInhibitorHandler.ts b/src/lib/extensions/discord-akairo/BushInhibitorHandler.ts index 2a947da..4984934 100644 --- a/src/lib/extensions/discord-akairo/BushInhibitorHandler.ts +++ b/src/lib/extensions/discord-akairo/BushInhibitorHandler.ts @@ -1,5 +1,5 @@ +import { type BushClient } from '@lib'; import { InhibitorHandler } from 'discord-akairo'; -import { BushClient } from './BushClient'; export class BushInhibitorHandler extends InhibitorHandler { public declare client: BushClient; diff --git a/src/lib/extensions/discord-akairo/BushListener.ts b/src/lib/extensions/discord-akairo/BushListener.ts index 82e874f..e3c845c 100644 --- a/src/lib/extensions/discord-akairo/BushListener.ts +++ b/src/lib/extensions/discord-akairo/BushListener.ts @@ -1,6 +1,7 @@ +import { type BushClient } from '@lib'; import { Listener } from 'discord-akairo'; -import EventEmitter from 'events'; -import { BushClient } from './BushClient'; +import type EventEmitter from 'events'; + export class BushListener extends Listener { public declare client: BushClient; public constructor( diff --git a/src/lib/extensions/discord-akairo/BushListenerHandler.ts b/src/lib/extensions/discord-akairo/BushListenerHandler.ts index 28615fc..f5354e4 100644 --- a/src/lib/extensions/discord-akairo/BushListenerHandler.ts +++ b/src/lib/extensions/discord-akairo/BushListenerHandler.ts @@ -1,5 +1,5 @@ +import { type BushClient } from '@lib'; import { ListenerHandler } from 'discord-akairo'; -import { BushClient } from './BushClient'; export class BushListenerHandler extends ListenerHandler { declare client: BushClient; diff --git a/src/lib/extensions/discord-akairo/BushSlashMessage.ts b/src/lib/extensions/discord-akairo/BushSlashMessage.ts index b5e48ea..fd248b1 100644 --- a/src/lib/extensions/discord-akairo/BushSlashMessage.ts +++ b/src/lib/extensions/discord-akairo/BushSlashMessage.ts @@ -1,10 +1,6 @@ +import { type BushClient, type BushCommandUtil, type BushGuild, type BushGuildMember, type BushUser } from '@lib'; import { AkairoMessage } from 'discord-akairo'; -import { CommandInteraction } from 'discord.js'; -import { BushGuild } from '../discord.js/BushGuild'; -import { BushGuildMember } from '../discord.js/BushGuildMember'; -import { BushUser } from '../discord.js/BushUser'; -import { BushClient } from './BushClient'; -import { BushCommandUtil } from './BushCommandUtil'; +import { type CommandInteraction } from 'discord.js'; export class BushSlashMessage extends AkairoMessage { public declare client: BushClient; diff --git a/src/lib/extensions/discord-akairo/BushTask.ts b/src/lib/extensions/discord-akairo/BushTask.ts index 1b14a2b..299e977 100644 --- a/src/lib/extensions/discord-akairo/BushTask.ts +++ b/src/lib/extensions/discord-akairo/BushTask.ts @@ -1,5 +1,5 @@ -import { Task, TaskOptions } from 'discord-akairo'; -import { BushClient } from './BushClient'; +import { type BushClient } from '@lib'; +import { Task, type TaskOptions } from 'discord-akairo'; export class BushTask extends Task { public declare client: BushClient; diff --git a/src/lib/extensions/discord-akairo/BushTaskHandler.ts b/src/lib/extensions/discord-akairo/BushTaskHandler.ts index 588988d..8531ff1 100644 --- a/src/lib/extensions/discord-akairo/BushTaskHandler.ts +++ b/src/lib/extensions/discord-akairo/BushTaskHandler.ts @@ -1,5 +1,5 @@ -import { AkairoHandlerOptions, TaskHandler } from 'discord-akairo'; -import { BushClient } from './BushClient'; +import { type BushClient } from '@lib'; +import { TaskHandler, type AkairoHandlerOptions } from 'discord-akairo'; export type BushTaskHandlerOptions = AkairoHandlerOptions; diff --git a/src/lib/extensions/discord.js/BushActivity.ts b/src/lib/extensions/discord.js/BushActivity.ts index 96c924d..1da5fac 100644 --- a/src/lib/extensions/discord.js/BushActivity.ts +++ b/src/lib/extensions/discord.js/BushActivity.ts @@ -1,7 +1,6 @@ +import { type BushEmoji, type BushPresence } from '@lib'; import { Activity } from 'discord.js'; -import { RawActivityData } from 'discord.js/typings/rawDataTypes'; -import { BushEmoji } from './BushEmoji'; -import { BushPresence } from './BushPresence'; +import { type RawActivityData } from 'discord.js/typings/rawDataTypes'; export class BushActivity extends Activity { public declare emoji: BushEmoji | null; diff --git a/src/lib/extensions/discord.js/BushApplicationCommand.ts b/src/lib/extensions/discord.js/BushApplicationCommand.ts index 0d7c000..9dfba65 100644 --- a/src/lib/extensions/discord.js/BushApplicationCommand.ts +++ b/src/lib/extensions/discord.js/BushApplicationCommand.ts @@ -1,8 +1,7 @@ /* eslint-disable @typescript-eslint/ban-types */ -import { ApplicationCommand, Snowflake } from 'discord.js'; -import { RawApplicationCommandData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; +import { type BushClient, type BushGuild } from '@lib'; +import { ApplicationCommand, type Snowflake } from 'discord.js'; +import { type RawApplicationCommandData } from 'discord.js/typings/rawDataTypes'; export class BushApplicationCommand<PermissionsFetchType = {}> extends ApplicationCommand<PermissionsFetchType> { public declare readonly client: BushClient; diff --git a/src/lib/extensions/discord.js/BushApplicationCommandManager.d.ts b/src/lib/extensions/discord.js/BushApplicationCommandManager.d.ts index b993215..89ad55d 100644 --- a/src/lib/extensions/discord.js/BushApplicationCommandManager.d.ts +++ b/src/lib/extensions/discord.js/BushApplicationCommandManager.d.ts @@ -1,9 +1,12 @@ -import { APIApplicationCommand } from 'discord-api-types'; -import { ApplicationCommandData, CachedManager, Collection, FetchApplicationCommandOptions, Snowflake } from 'discord.js'; -import { BushApplicationCommandResolvable, BushClient } from '../discord-akairo/BushClient'; -import { BushApplicationCommand } from './BushApplicationCommand'; -import { BushApplicationCommandPermissionsManager } from './BushApplicationCommandPermissionsManager'; -import { BushGuildResolvable } from './BushCommandInteraction'; +import { + type BushApplicationCommand, + type BushApplicationCommandPermissionsManager, + type BushApplicationCommandResolvable, + type BushClient, + type BushGuildResolvable +} from '@lib'; +import { type APIApplicationCommand } from 'discord-api-types'; +import { CachedManager, type ApplicationCommandData, type Collection, type FetchApplicationCommandOptions, type Snowflake } from 'discord.js'; export class BushApplicationCommandManager< ApplicationCommandScope = BushApplicationCommand<{ guild: BushGuildResolvable }>, @@ -29,6 +32,7 @@ export class BushApplicationCommandManager< guildId: Snowflake ): Promise<BushApplicationCommand>; public fetch(id: Snowflake, options: FetchApplicationCommandOptions & { guildId: Snowflake }): Promise<BushApplicationCommand>; + public fetch(options: FetchApplicationCommandOptions): Promise<Collection<string, ApplicationCommandScope>>; public fetch(id: Snowflake, options?: FetchApplicationCommandOptions): Promise<ApplicationCommandScope>; public fetch(id?: Snowflake, options?: FetchApplicationCommandOptions): Promise<Collection<Snowflake, ApplicationCommandScope>>; public set(commands: ApplicationCommandData[]): Promise<Collection<Snowflake, ApplicationCommandScope>>; diff --git a/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.d.ts b/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.d.ts index ece4a60..0fd47ac 100644 --- a/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.d.ts +++ b/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.d.ts @@ -1,17 +1,16 @@ -import { APIApplicationCommandPermission } from 'discord-api-types'; +import { type BushClient, type BushRoleResolvable, type BushUserResolvable } from '@lib'; +import { type APIApplicationCommandPermission } from 'discord-api-types'; import { - ApplicationCommand, - ApplicationCommandManager, - ApplicationCommandPermissionData, - ApplicationCommandPermissions, - BaseManager, - Collection, - GuildApplicationCommandManager, - GuildApplicationCommandPermissionData, - Snowflake + BaseManager, type ApplicationCommand, + type ApplicationCommandManager, + type ApplicationCommandPermissionData, + type ApplicationCommandPermissions, + type Collection, + type GuildApplicationCommandManager, + type GuildApplicationCommandPermissionData, + type Snowflake } from 'discord.js'; -import { ApplicationCommandPermissionTypes } from 'discord.js/typings/enums'; -import { BushClient, BushRoleResolvable, BushUserResolvable } from '../discord-akairo/BushClient'; +import { type ApplicationCommandPermissionTypes } from 'discord.js/typings/enums'; export class BushApplicationCommandPermissionsManager< BaseOptions, diff --git a/src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts b/src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts index 3e00d96..b3704b6 100644 --- a/src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts +++ b/src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts @@ -1,8 +1,6 @@ -import { Snowflake } from 'discord-api-types'; -import { CachedManager } from 'discord.js'; -import { RawGuildEmojiData } from 'discord.js/typings/rawDataTypes'; -import { BushClient, BushEmojiIdentifierResolvable, BushEmojiResolvable } from '../discord-akairo/BushClient'; -import { BushGuildEmoji } from './BushGuildEmoji'; +import { type BushClient, type BushEmojiIdentifierResolvable, type BushEmojiResolvable, type BushGuildEmoji } from '@lib'; +import { CachedManager, type Snowflake } from 'discord.js'; +import { type RawGuildEmojiData } from 'discord.js/typings/rawDataTypes'; export class BushBaseGuildEmojiManager extends CachedManager<Snowflake, BushGuildEmoji, BushEmojiResolvable> { public constructor(client: BushClient, iterable?: Iterable<RawGuildEmojiData>); diff --git a/src/lib/extensions/discord.js/BushBaseGuildTextChannel.ts b/src/lib/extensions/discord.js/BushBaseGuildTextChannel.ts index 78cfada..38a8a7d 100644 --- a/src/lib/extensions/discord.js/BushBaseGuildTextChannel.ts +++ b/src/lib/extensions/discord.js/BushBaseGuildTextChannel.ts @@ -1,15 +1,19 @@ import { - AllowedThreadTypeForNewsChannel, - AllowedThreadTypeForTextChannel, + type BushCategoryChannel, + type BushClient, + type BushGuild, + type BushGuildMember, + type BushMessageManager, + type BushThreadManager +} from '@lib'; +import { BaseGuildTextChannel, - Collection, - Snowflake + type AllowedThreadTypeForNewsChannel, + type AllowedThreadTypeForTextChannel, + type Collection, + type Snowflake } from 'discord.js'; -import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushCategoryChannel, BushClient, BushGuildMember } from '../..'; -import { BushGuild } from './BushGuild'; -import { BushMessageManager } from './BushMessageManager'; -import { BushThreadManager } from './BushThreadManager'; +import { type RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; export class BushBaseGuildTextChannel extends BaseGuildTextChannel { public constructor(guild: BushGuild, data?: RawGuildChannelData, client?: BushClient, immediatePatch?: boolean) { diff --git a/src/lib/extensions/discord.js/BushButtonInteraction.ts b/src/lib/extensions/discord.js/BushButtonInteraction.ts index 26b98f6..2146e5c 100644 --- a/src/lib/extensions/discord.js/BushButtonInteraction.ts +++ b/src/lib/extensions/discord.js/BushButtonInteraction.ts @@ -1,13 +1,10 @@ -import { APIInteractionGuildMember } from 'discord-api-types/v9'; -import { ButtonInteraction, CacheType, CacheTypeReducer } from 'discord.js'; -import { RawMessageButtonInteractionData } from 'discord.js/typings/rawDataTypes'; -import { BushClient, BushTextBasedChannels } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; -import { BushUser } from './BushUser'; +import { type BushClient, type BushGuild, type BushGuildMember, type BushTextBasedChannels, type BushUser } from '@lib'; +import { type APIInteractionGuildMember } from 'discord-api-types/v9'; +import { ButtonInteraction, type CacheType, type CacheTypeReducer } from 'discord.js'; +import { type RawMessageButtonInteractionData } from 'discord.js/typings/rawDataTypes'; export class BushButtonInteraction<Cached extends CacheType = CacheType> extends ButtonInteraction<Cached> { - public declare readonly channel: BushTextBasedChannels | null; + public declare readonly channel: CacheTypeReducer<Cached, BushTextBasedChannels | null>; public declare readonly guild: CacheTypeReducer<Cached, BushGuild, null>; public declare member: CacheTypeReducer<Cached, BushGuildMember, APIInteractionGuildMember>; public declare user: BushUser; diff --git a/src/lib/extensions/discord.js/BushCategoryChannel.ts b/src/lib/extensions/discord.js/BushCategoryChannel.ts index f5d26f0..a97c21b 100644 --- a/src/lib/extensions/discord.js/BushCategoryChannel.ts +++ b/src/lib/extensions/discord.js/BushCategoryChannel.ts @@ -1,9 +1,6 @@ -import { CategoryChannel, Collection, Snowflake } from 'discord.js'; -import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushGuildChannel } from './BushGuildChannel'; -import { BushGuildMember } from './BushGuildMember'; +import { type BushClient, type BushGuild, type BushGuildChannel, type BushGuildMember } from '@lib'; +import { CategoryChannel, type Collection, type Snowflake } from 'discord.js'; +import { type RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; export class BushCategoryChannel extends CategoryChannel { public declare readonly client: BushClient; diff --git a/src/lib/extensions/discord.js/BushChannel.d.ts b/src/lib/extensions/discord.js/BushChannel.d.ts index 2e465a5..1c47018 100644 --- a/src/lib/extensions/discord.js/BushChannel.d.ts +++ b/src/lib/extensions/discord.js/BushChannel.d.ts @@ -1,11 +1,7 @@ -import { Snowflake } from 'discord-api-types'; -import { Channel, ChannelMention } from 'discord.js'; -import { ChannelTypes } from 'discord.js/typings/enums'; -import { RawChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushClient, BushTextBasedChannels } from '../discord-akairo/BushClient'; -import { BushStageChannel } from './BushStageChannel'; -import { BushThreadChannel } from './BushThreadChannel'; -import { BushVoiceChannel } from './BushVoiceChannel'; +import { type BushClient, type BushStageChannel, type BushTextBasedChannels, type BushThreadChannel, type BushVoiceChannel } from '@lib'; +import { Channel, type ChannelMention, type Snowflake } from 'discord.js'; +import { type ChannelTypes } from 'discord.js/typings/enums'; +import { type RawChannelData } from 'discord.js/typings/rawDataTypes'; export class BushChannel extends Channel { public constructor(client: BushClient, data?: RawChannelData, immediatePatch?: boolean); diff --git a/src/lib/extensions/discord.js/BushChannelManager.d.ts b/src/lib/extensions/discord.js/BushChannelManager.d.ts index 924f5b6..7ebeb79 100644 --- a/src/lib/extensions/discord.js/BushChannelManager.d.ts +++ b/src/lib/extensions/discord.js/BushChannelManager.d.ts @@ -1,8 +1,6 @@ -import { Snowflake } from 'discord-api-types'; -import { CachedManager, Client, FetchChannelOptions } from 'discord.js'; -import { RawChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushChannelResolvable } from '../discord-akairo/BushClient'; -import { BushChannel } from './BushChannel'; +import { type BushChannel, type BushChannelResolvable } from '@lib'; +import { CachedManager, type Client, type FetchChannelOptions, type Snowflake } from 'discord.js'; +import { type RawChannelData } from 'discord.js/typings/rawDataTypes'; export class BushChannelManager extends CachedManager<Snowflake, BushChannel, BushChannelResolvable> { public constructor(client: Client, iterable: Iterable<RawChannelData>); diff --git a/src/lib/extensions/discord.js/BushClientEvents.d.ts b/src/lib/extensions/discord.js/BushClientEvents.d.ts index b16f632..3e9fbf9 100644 --- a/src/lib/extensions/discord.js/BushClientEvents.d.ts +++ b/src/lib/extensions/discord.js/BushClientEvents.d.ts @@ -1,42 +1,42 @@ import { - BushApplicationCommand, - BushClient, - BushDMChannel, - BushGuild, - BushGuildChannel, - BushGuildEmoji, - BushGuildMember, - BushMessage, - BushMessageReaction, - BushNewsChannel, - BushPresence, - BushRole, - BushStageInstance, - BushTextBasedChannels, - BushTextChannel, - BushThreadChannel, - BushThreadMember, - BushUser, - BushVoiceState, - Guild, - GuildSettings, - PartialBushGuildMember, - PartialBushMessage, - PartialBushMessageReaction, - PartialBushUser + type BushApplicationCommand, + type BushClient, + type BushDMChannel, + type BushGuild, + type BushGuildBan, + type BushGuildChannel, + type BushGuildEmoji, + type BushGuildMember, + type BushMessage, + type BushMessageReaction, + type BushNewsChannel, + type BushPresence, + type BushRole, + type BushStageInstance, + type BushTextBasedChannels, + type BushTextChannel, + type BushThreadChannel, + type BushThreadMember, + type BushUser, + type BushVoiceState, + type Guild, + type GuildSettings, + type PartialBushGuildMember, + type PartialBushMessage, + type PartialBushMessageReaction, + type PartialBushUser } from '@lib'; -import { AkairoClientEvents } from 'discord-akairo'; +import { type AkairoClientEvents } from 'discord-akairo'; import { - Collection, - Interaction, - InvalidRequestWarningData, - Invite, - RateLimitData, - Snowflake, - Sticker, - Typing + type Collection, + type Interaction, + type InvalidRequestWarningData, + type Invite, + type RateLimitData, + type Snowflake, + type Sticker, + type Typing } from 'discord.js'; -import { BushGuildBan } from './BushGuildBan'; export interface BushClientEvents extends AkairoClientEvents { applicationCommandCreate: [command: BushApplicationCommand]; diff --git a/src/lib/extensions/discord.js/BushClientUser.d.ts b/src/lib/extensions/discord.js/BushClientUser.d.ts index 1a6cea4..b045a75 100644 --- a/src/lib/extensions/discord.js/BushClientUser.d.ts +++ b/src/lib/extensions/discord.js/BushClientUser.d.ts @@ -1,11 +1,11 @@ import { - ActivityOptions, - Base64Resolvable, - BufferResolvable, - ClientPresence, - ClientUserEditData, - PresenceData, - PresenceStatusData + type ActivityOptions, + type Base64Resolvable, + type BufferResolvable, + type ClientPresence, + type ClientUserEditData, + type PresenceData, + type PresenceStatusData } from 'discord.js'; import { BushUser } from './BushUser'; diff --git a/src/lib/extensions/discord.js/BushCommandInteraction.ts b/src/lib/extensions/discord.js/BushCommandInteraction.ts index eff3b45..4202cfd 100644 --- a/src/lib/extensions/discord.js/BushCommandInteraction.ts +++ b/src/lib/extensions/discord.js/BushCommandInteraction.ts @@ -1,14 +1,16 @@ -import { APIInteractionGuildMember } from 'discord-api-types/v9'; -import { CacheType, CacheTypeReducer, CommandInteraction, Invite, Snowflake } from 'discord.js'; -import { RawCommandInteractionData } from 'discord.js/typings/rawDataTypes'; -import { BushClient, BushTextBasedChannels } from '../discord-akairo/BushClient'; -import { BushApplicationCommand } from './BushApplicationCommand'; -import { BushGuild } from './BushGuild'; -import { BushGuildChannel } from './BushGuildChannel'; -import { BushGuildEmoji } from './BushGuildEmoji'; -import { BushGuildMember } from './BushGuildMember'; -import { BushRole } from './BushRole'; -import { BushUser } from './BushUser'; +import { + type BushApplicationCommand, + type BushGuild, + type BushGuildChannel, + type BushGuildEmoji, + type BushGuildMember, + type BushRole, + type BushUser +} from '@lib'; +import { type APIInteractionGuildMember } from 'discord-api-types/v9'; +import { CommandInteraction, type CacheType, type CacheTypeReducer, type Invite, type Snowflake } from 'discord.js'; +import { type RawCommandInteractionData } from 'discord.js/typings/rawDataTypes'; +import { BushTextBasedChannels, type BushClient } from '../discord-akairo/BushClient'; export type BushGuildResolvable = BushGuild | BushGuildChannel | BushGuildMember | BushGuildEmoji | Invite | BushRole | Snowflake; @@ -18,7 +20,7 @@ export class BushCommandInteraction<Cached extends CacheType = CacheType> extend } public declare readonly client: BushClient; public declare readonly command: BushApplicationCommand | BushApplicationCommand<{ guild: BushGuildResolvable }> | null; - public declare readonly channel: BushTextBasedChannels | null; + public declare readonly channel: CacheTypeReducer<Cached, BushTextBasedChannels | null>; public declare readonly guild: CacheTypeReducer<Cached, BushGuild, null>; public declare member: CacheTypeReducer<Cached, BushGuildMember, APIInteractionGuildMember>; public declare user: BushUser; diff --git a/src/lib/extensions/discord.js/BushDMChannel.ts b/src/lib/extensions/discord.js/BushDMChannel.ts index 4b44f83..9730c30 100644 --- a/src/lib/extensions/discord.js/BushDMChannel.ts +++ b/src/lib/extensions/discord.js/BushDMChannel.ts @@ -1,8 +1,6 @@ +import { type BushClient, type BushMessageManager, type BushUser } from '@lib'; import { DMChannel } from 'discord.js'; -import { RawDMChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushMessageManager } from './BushMessageManager'; -import { BushUser } from './BushUser'; +import { type RawDMChannelData } from 'discord.js/typings/rawDataTypes'; export class BushDMChannel extends DMChannel { public declare readonly client: BushClient; diff --git a/src/lib/extensions/discord.js/BushEmoji.ts b/src/lib/extensions/discord.js/BushEmoji.ts index db1cc11..fc27a99 100644 --- a/src/lib/extensions/discord.js/BushEmoji.ts +++ b/src/lib/extensions/discord.js/BushEmoji.ts @@ -1,6 +1,6 @@ +import { type BushClient } from '@lib'; import { Emoji } from 'discord.js'; -import { RawEmojiData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; +import { type RawEmojiData } from 'discord.js/typings/rawDataTypes'; export class BushEmoji extends Emoji { public declare readonly client: BushClient; diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts index 487ff9a..dff9d85 100644 --- a/src/lib/extensions/discord.js/BushGuild.ts +++ b/src/lib/extensions/discord.js/BushGuild.ts @@ -1,13 +1,19 @@ -import { Guild, MessageOptions, UserResolvable } from 'discord.js'; -import { RawGuildData } from 'discord.js/typings/rawDataTypes'; +import { + type BushClient, + type BushGuildMember, + type BushGuildMemberManager, + type BushTextChannel, + type BushUser, + type BushUserResolvable, + type GuildFeatures, + type GuildLogType, + type GuildModel +} from '@lib'; +import { Guild, type MessageOptions, type UserResolvable } from 'discord.js'; +import { type RawGuildData } from 'discord.js/typings/rawDataTypes'; import { Moderation } from '../../common/Moderation'; -import { Guild as GuildDB, GuildFeatures, GuildLogType, GuildModel } from '../../models/Guild'; +import { Guild as GuildDB } from '../../models/Guild'; import { ModLogType } from '../../models/ModLog'; -import { BushClient, BushUserResolvable } from '../discord-akairo/BushClient'; -import { BushGuildMember } from './BushGuildMember'; -import { BushGuildMemberManager } from './BushGuildMemberManager'; -import { BushTextChannel } from './BushTextChannel'; -import { BushUser } from './BushUser'; export class BushGuild extends Guild { public declare readonly client: BushClient; diff --git a/src/lib/extensions/discord.js/BushGuildApplicationCommandManager.d.ts b/src/lib/extensions/discord.js/BushGuildApplicationCommandManager.d.ts index 38afa94..3c71a01 100644 --- a/src/lib/extensions/discord.js/BushGuildApplicationCommandManager.d.ts +++ b/src/lib/extensions/discord.js/BushGuildApplicationCommandManager.d.ts @@ -1,10 +1,13 @@ /* eslint-disable @typescript-eslint/ban-types */ -import { ApplicationCommandData, BaseFetchOptions, Collection, Snowflake } from 'discord.js'; -import { RawApplicationCommandData } from 'discord.js/typings/rawDataTypes'; -import { BushApplicationCommandResolvable, BushClient } from '../discord-akairo/BushClient'; -import { BushApplicationCommand } from './BushApplicationCommand'; -import { BushApplicationCommandManager } from './BushApplicationCommandManager'; -import { BushGuild } from './BushGuild'; +import { + BushApplicationCommandManager, + type BushApplicationCommand, + type BushApplicationCommandResolvable, + type BushClient, + type BushGuild +} from '@lib'; +import { type ApplicationCommandData, type BaseFetchOptions, type Collection, type Snowflake } from 'discord.js'; +import { type RawApplicationCommandData } from 'discord.js/typings/rawDataTypes'; export class BushGuildApplicationCommandManager extends BushApplicationCommandManager<BushApplicationCommand, {}, BushGuild> { public constructor(guild: BushGuild, iterable?: Iterable<RawApplicationCommandData>); @@ -14,6 +17,7 @@ export class BushGuildApplicationCommandManager extends BushApplicationCommandMa public delete(command: BushApplicationCommandResolvable): Promise<BushApplicationCommand | null>; public edit(command: BushApplicationCommandResolvable, data: ApplicationCommandData): Promise<BushApplicationCommand>; public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<BushApplicationCommand>; + public fetch(options: BaseFetchOptions): Promise<Collection<Snowflake, BushApplicationCommand>>; public fetch(id?: undefined, options?: BaseFetchOptions): Promise<Collection<Snowflake, BushApplicationCommand>>; public set(commands: ApplicationCommandData[]): Promise<Collection<Snowflake, BushApplicationCommand>>; } diff --git a/src/lib/extensions/discord.js/BushGuildBan.d.ts b/src/lib/extensions/discord.js/BushGuildBan.d.ts index 0174220..5d50bb4 100644 --- a/src/lib/extensions/discord.js/BushGuildBan.d.ts +++ b/src/lib/extensions/discord.js/BushGuildBan.d.ts @@ -1,8 +1,6 @@ +import { type BushClient, type BushGuild, type BushUser } from '@lib'; import { GuildBan } from 'discord.js'; -import { RawGuildBanData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushUser } from './BushUser'; +import { type RawGuildBanData } from 'discord.js/typings/rawDataTypes'; export class BushGuildBan extends GuildBan { public constructor(client: BushClient, data: RawGuildBanData, guild: BushGuild); diff --git a/src/lib/extensions/discord.js/BushGuildChannel.ts b/src/lib/extensions/discord.js/BushGuildChannel.ts index 7daa80d..ee51c3b 100644 --- a/src/lib/extensions/discord.js/BushGuildChannel.ts +++ b/src/lib/extensions/discord.js/BushGuildChannel.ts @@ -1,7 +1,6 @@ +import { type BushClient, type BushGuild } from '@lib'; import { GuildChannel } from 'discord.js'; -import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; +import { type RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; export class BushGuildChannel extends GuildChannel { public declare readonly client: BushClient; diff --git a/src/lib/extensions/discord.js/BushGuildEmoji.ts b/src/lib/extensions/discord.js/BushGuildEmoji.ts index 0ac5ebd..8d5493b 100644 --- a/src/lib/extensions/discord.js/BushGuildEmoji.ts +++ b/src/lib/extensions/discord.js/BushGuildEmoji.ts @@ -1,9 +1,6 @@ +import { type BushClient, type BushGuild, type BushGuildEmojiRoleManager, type BushUser } from '@lib'; import { GuildEmoji } from 'discord.js'; -import { RawGuildEmojiData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushGuildEmojiRoleManager } from './BushGuildEmojiRoleManager'; -import { BushUser } from './BushUser'; +import { type RawGuildEmojiData } from 'discord.js/typings/rawDataTypes'; export class BushGuildEmoji extends GuildEmoji { public declare readonly client: BushClient; diff --git a/src/lib/extensions/discord.js/BushGuildEmojiRoleManager.d.ts b/src/lib/extensions/discord.js/BushGuildEmojiRoleManager.d.ts index 6e36292..8b886bd 100644 --- a/src/lib/extensions/discord.js/BushGuildEmojiRoleManager.d.ts +++ b/src/lib/extensions/discord.js/BushGuildEmojiRoleManager.d.ts @@ -1,8 +1,5 @@ -import { Collection, DataManager, Snowflake } from 'discord.js'; -import { BushClient, BushRoleResolvable } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushGuildEmoji } from './BushGuildEmoji'; -import { BushRole } from './BushRole'; +import { type BushClient, type BushGuild, type BushGuildEmoji, type BushRole, type BushRoleResolvable } from '@lib'; +import { DataManager, type Collection, type Snowflake } from 'discord.js'; export class BushGuildEmojiRoleManager extends DataManager<Snowflake, BushRole, BushRoleResolvable> { public constructor(emoji: BushGuildEmoji); diff --git a/src/lib/extensions/discord.js/BushGuildManager.d.ts b/src/lib/extensions/discord.js/BushGuildManager.d.ts index 4ec9276..1a56b8f 100644 --- a/src/lib/extensions/discord.js/BushGuildManager.d.ts +++ b/src/lib/extensions/discord.js/BushGuildManager.d.ts @@ -1,9 +1,13 @@ -import { Snowflake } from 'discord-api-types'; -import { CachedManager, Collection, FetchGuildOptions, FetchGuildsOptions, GuildCreateOptions, OAuth2Guild } from 'discord.js'; -import { RawGuildData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuildResolvable } from './BushCommandInteraction'; -import { BushGuild } from './BushGuild'; +import { type BushClient, type BushGuild, type BushGuildResolvable } from '@lib'; +import { + CachedManager, + type Collection, + type FetchGuildOptions, + type FetchGuildsOptions, type GuildCreateOptions, + type OAuth2Guild, + type Snowflake +} from 'discord.js'; +import { type RawGuildData } from 'discord.js/typings/rawDataTypes'; export class BushGuildManager extends CachedManager<Snowflake, BushGuild, BushGuildResolvable> { public constructor(client: BushClient, iterable?: Iterable<RawGuildData>); diff --git a/src/lib/extensions/discord.js/BushGuildMember.ts b/src/lib/extensions/discord.js/BushGuildMember.ts index b23ff33..32f0156 100644 --- a/src/lib/extensions/discord.js/BushGuildMember.ts +++ b/src/lib/extensions/discord.js/BushGuildMember.ts @@ -1,11 +1,6 @@ -import { GuildMember, MessageEmbed, Partialize, Role } from 'discord.js'; -import { RawGuildMemberData } from 'discord.js/typings/rawDataTypes'; -import { Moderation } from '../../common/Moderation'; -import { ModLogType } from '../../models/ModLog'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushRole } from './BushRole'; -import { BushUser } from './BushUser'; +import { Moderation, ModLogType, type BushClient, type BushGuild, type BushRole, type BushUser } from '@lib'; +import { GuildMember, MessageEmbed, type Partialize, type Role } from 'discord.js'; +import { type RawGuildMemberData } from 'discord.js/typings/rawDataTypes'; interface BushPunishmentOptions { reason?: string | null; diff --git a/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts b/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts index e868b10..f5e0846 100644 --- a/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts +++ b/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts @@ -1,21 +1,25 @@ import { - AddGuildMemberOptions, - BanOptions, + type BushClient, + type BushGuild, + type BushGuildMember, + type BushGuildMemberResolvable, + type BushUser, + type BushUserResolvable +} from '@lib'; +import { CachedManager, - Collection, - FetchMemberOptions, - FetchMembersOptions, - GuildListMembersOptions, - GuildMemberEditData, - GuildPruneMembersOptions, - GuildSearchMembersOptions, - Snowflake + type AddGuildMemberOptions, + type BanOptions, + type Collection, + type FetchMemberOptions, + type FetchMembersOptions, + type GuildListMembersOptions, + type GuildMemberEditData, + type GuildPruneMembersOptions, + type GuildSearchMembersOptions, + type Snowflake } from 'discord.js'; -import { RawGuildMemberData } from 'discord.js/typings/rawDataTypes'; -import { BushClient, BushGuildMemberResolvable, BushUserResolvable } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; -import { BushUser } from './BushUser'; +import { type RawGuildMemberData } from 'discord.js/typings/rawDataTypes'; export class BushGuildMemberManager extends CachedManager<Snowflake, BushGuildMember, BushGuildMemberResolvable> { public constructor(guild: BushGuild, iterable?: Iterable<RawGuildMemberData>); diff --git a/src/lib/extensions/discord.js/BushMessage.ts b/src/lib/extensions/discord.js/BushMessage.ts index 941df29..d64ac6e 100644 --- a/src/lib/extensions/discord.js/BushMessage.ts +++ b/src/lib/extensions/discord.js/BushMessage.ts @@ -1,10 +1,14 @@ -import { If, Message, Partialize } from 'discord.js'; -import { RawMessageData } from 'discord.js/typings/rawDataTypes'; -import { BushClient, BushGuildTextBasedChannel, BushTextBasedChannels } from '../discord-akairo/BushClient'; -import { BushCommandUtil } from '../discord-akairo/BushCommandUtil'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; -import { BushUser } from './BushUser'; +import { + type BushClient, + type BushCommandUtil, + type BushGuild, + type BushGuildMember, + type BushGuildTextBasedChannel, + type BushTextBasedChannels, + type BushUser +} from '@lib'; +import { Message, type If, type Partialize } from 'discord.js'; +import { type RawMessageData } from 'discord.js/typings/rawDataTypes'; export type PartialBushMessage = Partialize< BushMessage, @@ -13,14 +17,13 @@ export type PartialBushMessage = Partialize< >; export class BushMessage<Cached extends boolean = boolean> extends Message<Cached> { public declare readonly client: BushClient; - public override util!: BushCommandUtil<BushMessage>; + public declare util: BushCommandUtil<BushMessage<true>>; public declare readonly guild: BushGuild | null; public declare readonly member: BushGuildMember | null; public declare author: BushUser; public declare readonly channel: If<Cached, BushGuildTextBasedChannel, BushTextBasedChannels>; public constructor(client: BushClient, data: RawMessageData) { super(client, data); - // this.util = new BushCommandUtil(client.commandHandler, this); } public override fetch(force?: boolean): Promise<BushMessage> { return super.fetch(force) as Promise<BushMessage>; diff --git a/src/lib/extensions/discord.js/BushMessageManager.d.ts b/src/lib/extensions/discord.js/BushMessageManager.d.ts index 8495130..98a24d8 100644 --- a/src/lib/extensions/discord.js/BushMessageManager.d.ts +++ b/src/lib/extensions/discord.js/BushMessageManager.d.ts @@ -1,29 +1,25 @@ +import { BushMessageResolvable, type BushMessage, type BushTextBasedChannels } from '@lib'; import { - BaseFetchOptions, - CachedManager, - ChannelLogsQueryOptions, - Collection, - EmojiIdentifierResolvable, - MessageEditOptions, - MessagePayload, - MessageResolvable, - Snowflake + CachedManager, type BaseFetchOptions, + type ChannelLogsQueryOptions, + type Collection, + type EmojiIdentifierResolvable, + type MessageEditOptions, + type MessagePayload, type Snowflake } from 'discord.js'; -import { RawMessageData } from 'discord.js/typings/rawDataTypes'; -import { BushMessageResolvable, BushTextBasedChannels } from '../..'; -import { BushMessage } from './BushMessage'; +import { type RawMessageData } from 'discord.js/typings/rawDataTypes'; export class BushMessageManager extends CachedManager<Snowflake, BushMessage, BushMessageResolvable> { - public constructor(channel: BushTextBasedChannels, iterable?: Iterable<RawMessageData>); - public channel: BushTextBasedChannels; - public cache: Collection<Snowflake, BushMessage>; - public crosspost(message: BushMessageResolvable): Promise<BushMessage>; - public delete(message: BushMessageResolvable): Promise<void>; - public edit(message: MessageResolvable, options: MessagePayload | MessageEditOptions): Promise<BushMessage>; - public fetch(message: Snowflake, options?: BaseFetchOptions): Promise<BushMessage>; - public fetch(options?: ChannelLogsQueryOptions, cacheOptions?: BaseFetchOptions): Promise<Collection<Snowflake, BushMessage>>; - public fetchPinned(cache?: boolean): Promise<Collection<Snowflake, BushMessage>>; - public react(message: BushMessageResolvable, emoji: EmojiIdentifierResolvable): Promise<void>; - public pin(message: BushMessageResolvable): Promise<void>; - public unpin(message: BushMessageResolvable): Promise<void>; + public constructor(channel: BushTextBasedChannels, iterable?: Iterable<RawMessageData>); + public channel: BushTextBasedChannels; + public cache: Collection<Snowflake, BushMessage>; + public crosspost(message: BushMessageResolvable): Promise<BushMessage>; + public delete(message: BushMessageResolvable): Promise<void>; + public edit(message: BushMessageResolvable, options: MessagePayload | MessageEditOptions): Promise<BushMessage>; + public fetch(message: Snowflake, options?: BaseFetchOptions): Promise<BushMessage>; + public fetch(options?: ChannelLogsQueryOptions, cacheOptions?: BaseFetchOptions): Promise<Collection<Snowflake, BushMessage>>; + public fetchPinned(cache?: boolean): Promise<Collection<Snowflake, BushMessage>>; + public react(message: BushMessageResolvable, emoji: EmojiIdentifierResolvable): Promise<void>; + public pin(message: BushMessageResolvable): Promise<void>; + public unpin(message: BushMessageResolvable): Promise<void>; } diff --git a/src/lib/extensions/discord.js/BushMessageReaction.ts b/src/lib/extensions/discord.js/BushMessageReaction.ts index 056e4e6..b56ae28 100644 --- a/src/lib/extensions/discord.js/BushMessageReaction.ts +++ b/src/lib/extensions/discord.js/BushMessageReaction.ts @@ -1,9 +1,6 @@ -import { MessageReaction, Partialize } from 'discord.js'; -import { RawMessageReactionData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuildEmoji } from './BushGuildEmoji'; -import { BushMessage } from './BushMessage'; -import { BushReactionEmoji } from './BushReactionEmoji'; +import { type BushClient, type BushGuildEmoji, type BushMessage, type BushReactionEmoji } from '@lib'; +import { MessageReaction, type Partialize } from 'discord.js'; +import { type RawMessageReactionData } from 'discord.js/typings/rawDataTypes'; export type PartialBushMessageReaction = Partialize<BushMessageReaction, 'count'>; diff --git a/src/lib/extensions/discord.js/BushNewsChannel.ts b/src/lib/extensions/discord.js/BushNewsChannel.ts index d770132..f30de3e 100644 --- a/src/lib/extensions/discord.js/BushNewsChannel.ts +++ b/src/lib/extensions/discord.js/BushNewsChannel.ts @@ -1,12 +1,7 @@ -import { AllowedThreadTypeForNewsChannel, Collection, NewsChannel, Snowflake } from 'discord.js'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; -import { BushMessageManager } from './BushMessageManager'; -import { BushThreadManager } from './BushThreadManager'; +import { type BushGuild, type BushGuildMember, type BushMessageManager, type BushThreadManager } from '@lib'; +import { NewsChannel, type AllowedThreadTypeForNewsChannel, type Collection, type Snowflake } from 'discord.js'; export class BushNewsChannel extends NewsChannel { - public declare readonly client: BushClient; public declare threads: BushThreadManager<AllowedThreadTypeForNewsChannel>; public declare guild: BushGuild; public declare messages: BushMessageManager; diff --git a/src/lib/extensions/discord.js/BushPresence.ts b/src/lib/extensions/discord.js/BushPresence.ts index ff1937c..c5464a5 100644 --- a/src/lib/extensions/discord.js/BushPresence.ts +++ b/src/lib/extensions/discord.js/BushPresence.ts @@ -1,9 +1,6 @@ +import { type BushClient, type BushGuild, type BushGuildMember, type BushUser } from '@lib'; import { Presence } from 'discord.js'; -import { RawPresenceData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; -import { BushUser } from './BushUser'; +import { type RawPresenceData } from 'discord.js/typings/rawDataTypes'; export class BushPresence extends Presence { public declare guild: BushGuild | null; diff --git a/src/lib/extensions/discord.js/BushReactionEmoji.ts b/src/lib/extensions/discord.js/BushReactionEmoji.ts index 3aee2fb..5dd3d92 100644 --- a/src/lib/extensions/discord.js/BushReactionEmoji.ts +++ b/src/lib/extensions/discord.js/BushReactionEmoji.ts @@ -1,10 +1,8 @@ +import { type BushMessageReaction } from '@lib'; import { ReactionEmoji } from 'discord.js'; -import { RawReactionEmojiData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushMessageReaction } from './BushMessageReaction'; +import { type RawReactionEmojiData } from 'discord.js/typings/rawDataTypes'; export class BushReactionEmoji extends ReactionEmoji { - public declare readonly client: BushClient; public declare reaction: BushMessageReaction; public constructor(reaction: BushMessageReaction, emoji: RawReactionEmojiData) { super(reaction, emoji); diff --git a/src/lib/extensions/discord.js/BushRole.ts b/src/lib/extensions/discord.js/BushRole.ts index 084b019..b610699 100644 --- a/src/lib/extensions/discord.js/BushRole.ts +++ b/src/lib/extensions/discord.js/BushRole.ts @@ -1,11 +1,8 @@ -import { Collection, Role, Snowflake } from 'discord.js'; -import { RawRoleData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; +import { type BushClient, type BushGuild, type BushGuildMember } from '@lib'; +import { Role, type Collection, type Snowflake } from 'discord.js'; +import { type RawRoleData } from 'discord.js/typings/rawDataTypes'; export class BushRole extends Role { - public declare readonly client: BushClient; public declare guild: BushGuild; public declare readonly members: Collection<Snowflake, BushGuildMember>; public constructor(client: BushClient, data: RawRoleData, guild: BushGuild) { diff --git a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts index d4ebd4f..cffc099 100644 --- a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts +++ b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts @@ -1,13 +1,10 @@ -import { APIInteractionGuildMember } from 'discord-api-types/v9'; -import { CacheType, CacheTypeReducer, SelectMenuInteraction } from 'discord.js'; -import { RawMessageSelectMenuInteractionData } from 'discord.js/typings/rawDataTypes'; -import { BushClient, BushTextBasedChannels } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; -import { BushUser } from './BushUser'; +import { type BushClient, type BushGuild, type BushGuildMember, type BushTextBasedChannels, type BushUser } from '@lib'; +import { type APIInteractionGuildMember } from 'discord-api-types/v9'; +import { SelectMenuInteraction, type CacheType, type CacheTypeReducer } from 'discord.js'; +import { type RawMessageSelectMenuInteractionData } from 'discord.js/typings/rawDataTypes'; export class BushSelectMenuInteraction<Cached extends CacheType = CacheType> extends SelectMenuInteraction<Cached> { - public declare readonly channel: BushTextBasedChannels | null; + public declare readonly channel: CacheTypeReducer<Cached, BushTextBasedChannels | null>; public declare readonly guild: CacheTypeReducer<Cached, BushGuild, null>; public declare member: CacheTypeReducer<Cached, BushGuildMember, APIInteractionGuildMember>; public declare user: BushUser; diff --git a/src/lib/extensions/discord.js/BushStageChannel.ts b/src/lib/extensions/discord.js/BushStageChannel.ts index 4df64e8..a5b6b53 100644 --- a/src/lib/extensions/discord.js/BushStageChannel.ts +++ b/src/lib/extensions/discord.js/BushStageChannel.ts @@ -1,13 +1,8 @@ -import { Collection, Snowflake, StageChannel } from 'discord.js'; -import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushCategoryChannel } from './BushCategoryChannel'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; -import { BushStageInstance } from './BushStageInstance'; +import { type BushCategoryChannel, type BushGuild, type BushGuildMember, type BushStageInstance } from '@lib'; +import { StageChannel, type Collection, type Snowflake } from 'discord.js'; +import { type RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; export class BushStageChannel extends StageChannel { - public declare readonly client: BushClient; public declare readonly instance: BushStageInstance | null; public declare readonly members: Collection<Snowflake, BushGuildMember>; public declare guild: BushGuild; diff --git a/src/lib/extensions/discord.js/BushStageInstance.ts b/src/lib/extensions/discord.js/BushStageInstance.ts index ab09863..4ebfc3c 100644 --- a/src/lib/extensions/discord.js/BushStageInstance.ts +++ b/src/lib/extensions/discord.js/BushStageInstance.ts @@ -1,11 +1,8 @@ +import { type BushClient, type BushGuild, type BushStageChannel } from '@lib'; import { StageInstance } from 'discord.js'; -import { RawStageInstanceData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushStageChannel } from './BushStageChannel'; +import { type RawStageInstanceData } from 'discord.js/typings/rawDataTypes'; export class BushStageInstance extends StageInstance { - public declare readonly client: BushClient; public declare readonly channel: BushStageChannel | null; public declare readonly guild: BushGuild | null; public constructor(client: BushClient, data: RawStageInstanceData, channel: BushStageChannel) { diff --git a/src/lib/extensions/discord.js/BushStoreChannel.ts b/src/lib/extensions/discord.js/BushStoreChannel.ts index 20bfeab..5b9def0 100644 --- a/src/lib/extensions/discord.js/BushStoreChannel.ts +++ b/src/lib/extensions/discord.js/BushStoreChannel.ts @@ -1,12 +1,8 @@ -import { Collection, Snowflake, StoreChannel } from 'discord.js'; -import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushCategoryChannel } from './BushCategoryChannel'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; +import { type BushCategoryChannel, type BushClient, type BushGuild, type BushGuildMember } from '@lib'; +import { StoreChannel, type Collection, type Snowflake } from 'discord.js'; +import { type RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; export class BushStoreChannel extends StoreChannel { - public declare readonly client: BushClient; public declare guild: BushGuild; public declare readonly members: Collection<Snowflake, BushGuildMember>; public declare readonly parent: BushCategoryChannel | null; diff --git a/src/lib/extensions/discord.js/BushTextChannel.ts b/src/lib/extensions/discord.js/BushTextChannel.ts index 1d4d7fe..5001ddb 100644 --- a/src/lib/extensions/discord.js/BushTextChannel.ts +++ b/src/lib/extensions/discord.js/BushTextChannel.ts @@ -1,12 +1,8 @@ -import { AllowedThreadTypeForTextChannel, TextChannel } from 'discord.js'; -import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushMessageManager } from './BushMessageManager'; -import { BushThreadManager } from './BushThreadManager'; +import { type BushGuild, type BushMessageManager, type BushThreadManager } from '@lib'; +import { TextChannel, type AllowedThreadTypeForTextChannel } from 'discord.js'; +import { type RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; export class BushTextChannel extends TextChannel { - public declare readonly client: BushClient; public declare guild: BushGuild; public declare messages: BushMessageManager; public declare threads: BushThreadManager<AllowedThreadTypeForTextChannel>; diff --git a/src/lib/extensions/discord.js/BushThreadChannel.ts b/src/lib/extensions/discord.js/BushThreadChannel.ts index b78aff7..9319651 100644 --- a/src/lib/extensions/discord.js/BushThreadChannel.ts +++ b/src/lib/extensions/discord.js/BushThreadChannel.ts @@ -1,12 +1,14 @@ -import { Collection, Snowflake, ThreadChannel } from 'discord.js'; -import { RawThreadChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; -import { BushMessageManager } from './BushMessageManager'; -import { BushNewsChannel } from './BushNewsChannel'; -import { BushTextChannel } from './BushTextChannel'; -import { BushThreadMemberManager } from './BushThreadMemberManager'; +import { + type BushClient, + type BushGuild, + type BushGuildMember, + type BushMessageManager, + type BushNewsChannel, + type BushTextChannel, + type BushThreadMemberManager +} from '@lib'; +import { ThreadChannel, type Collection, type Snowflake } from 'discord.js'; +import { type RawThreadChannelData } from 'discord.js/typings/rawDataTypes'; export class BushThreadChannel extends ThreadChannel { public declare guild: BushGuild; diff --git a/src/lib/extensions/discord.js/BushThreadManager.d.ts b/src/lib/extensions/discord.js/BushThreadManager.d.ts index 027d532..86e85a9 100644 --- a/src/lib/extensions/discord.js/BushThreadManager.d.ts +++ b/src/lib/extensions/discord.js/BushThreadManager.d.ts @@ -1,25 +1,27 @@ import { - BaseFetchOptions, - CachedManager, - FetchArchivedThreadOptions, - FetchThreadsOptions, - Snowflake, - ThreadChannelResolvable, - ThreadCreateOptions + type BushThreadChannel +} from '@lib'; +import { + CachedManager, + FetchedThreads, + NewsChannel, + TextChannel, + ThreadChannel, + type BaseFetchOptions, + type FetchArchivedThreadOptions, + type FetchThreadsOptions, + type Snowflake, + type ThreadChannelResolvable, + type ThreadCreateOptions } from 'discord.js'; -import { RawThreadChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushClient, BushFetchedThreads, BushThreadChannelResolvable } from '../discord-akairo/BushClient'; -import { BushNewsChannel } from './BushNewsChannel'; -import { BushTextChannel } from './BushTextChannel'; -import { BushThreadChannel } from './BushThreadChannel'; +import { type RawThreadChannelData } from 'discord.js/typings/rawDataTypes'; export class BushThreadManager<AllowedThreadType> extends CachedManager<Snowflake, BushThreadChannel, ThreadChannelResolvable> { - public constructor(channel: BushTextChannel | BushNewsChannel, iterable?: Iterable<RawThreadChannelData>); - public declare readonly client: BushClient; - public channel: BushTextChannel | BushNewsChannel; - public create(options: ThreadCreateOptions<AllowedThreadType>): Promise<BushThreadChannel>; - public fetch(options: BushThreadChannelResolvable, cacheOptions?: BaseFetchOptions): Promise<BushThreadChannel | null>; - public fetch(options?: FetchThreadsOptions, cacheOptions?: { cache?: boolean }): Promise<BushFetchedThreads>; - public fetchArchived(options?: FetchArchivedThreadOptions, cache?: boolean): Promise<BushFetchedThreads>; - public fetchActive(cache?: boolean): Promise<BushFetchedThreads>; -} + public constructor(channel: TextChannel | NewsChannel, iterable?: Iterable<RawThreadChannelData>); + public channel: TextChannel | NewsChannel; + public create(options: ThreadCreateOptions<AllowedThreadType>): Promise<ThreadChannel>; + public fetch(options: ThreadChannelResolvable, cacheOptions?: BaseFetchOptions): Promise<ThreadChannel | null>; + public fetch(options?: FetchThreadsOptions, cacheOptions?: { cache?: boolean }): Promise<FetchedThreads>; + public fetchArchived(options?: FetchArchivedThreadOptions, cache?: boolean): Promise<FetchedThreads>; + public fetchActive(cache?: boolean): Promise<FetchedThreads>; +}
\ No newline at end of file diff --git a/src/lib/extensions/discord.js/BushThreadMember.ts b/src/lib/extensions/discord.js/BushThreadMember.ts index 10c7e84..70bd26f 100644 --- a/src/lib/extensions/discord.js/BushThreadMember.ts +++ b/src/lib/extensions/discord.js/BushThreadMember.ts @@ -1,8 +1,6 @@ +import { type BushGuildMember, type BushThreadChannel, type BushUser } from '@lib'; import { ThreadMember } from 'discord.js'; -import { RawThreadMemberData } from 'discord.js/typings/rawDataTypes'; -import { BushGuildMember } from './BushGuildMember'; -import { BushThreadChannel } from './BushThreadChannel'; -import { BushUser } from './BushUser'; +import { type RawThreadMemberData } from 'discord.js/typings/rawDataTypes'; export class BushThreadMember extends ThreadMember { public declare readonly guildMember: BushGuildMember | null; diff --git a/src/lib/extensions/discord.js/BushThreadMemberManager.d.ts b/src/lib/extensions/discord.js/BushThreadMemberManager.d.ts index cbc28de..34346aa 100644 --- a/src/lib/extensions/discord.js/BushThreadMemberManager.d.ts +++ b/src/lib/extensions/discord.js/BushThreadMemberManager.d.ts @@ -1,14 +1,20 @@ -import { CachedManager, Collection, Snowflake, ThreadChannel, ThreadMember, UserResolvable } from 'discord.js'; -import { RawThreadMemberData } from 'discord.js/typings/rawDataTypes'; -import { BushClient, BushThreadMemberResolvable } from '../discord-akairo/BushClient'; -import { BushThreadChannel } from './BushThreadChannel'; -import { BushThreadMember } from './BushThreadMember'; +import { type BushClient, type BushThreadChannel, type BushThreadMember, type BushThreadMemberResolvable } from '@lib'; +import { + CachedManager, + type BaseFetchOptions, + type Collection, + type Snowflake, + type UserResolvable +} from 'discord.js'; +import { type RawThreadMemberData } from 'discord.js/typings/rawDataTypes'; export class BushThreadMemberManager extends CachedManager<Snowflake, BushThreadMember, BushThreadMemberResolvable> { public constructor(thread: BushThreadChannel, iterable?: Iterable<RawThreadMemberData>); public declare readonly client: BushClient; - public thread: ThreadChannel; + public thread: BushThreadChannel; public add(member: UserResolvable | '@me', reason?: string): Promise<Snowflake>; - public fetch(cache?: boolean): Promise<Collection<Snowflake, ThreadMember>>; + public fetch(member?: UserResolvable, options?: BaseFetchOptions): Promise<BushThreadMember>; + /** @deprecated Use `fetch(member, options)` instead. */ + public fetch(cache?: boolean): Promise<Collection<Snowflake, BushThreadMember>>; public remove(id: Snowflake | '@me', reason?: string): Promise<Snowflake>; } diff --git a/src/lib/extensions/discord.js/BushUser.ts b/src/lib/extensions/discord.js/BushUser.ts index 15a0d03..6cfe6e9 100644 --- a/src/lib/extensions/discord.js/BushUser.ts +++ b/src/lib/extensions/discord.js/BushUser.ts @@ -1,7 +1,6 @@ -import { Partialize, User } from 'discord.js'; -import { RawUserData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushDMChannel } from './BushDMChannel'; +import { type BushClient, type BushDMChannel } from '@lib'; +import { User, type Partialize } from 'discord.js'; +import { type RawUserData } from 'discord.js/typings/rawDataTypes'; export type PartialBushUser = Partialize<BushUser, 'username' | 'tag' | 'discriminator' | 'isOwner' | 'isSuperUser'>; diff --git a/src/lib/extensions/discord.js/BushUserManager.d.ts b/src/lib/extensions/discord.js/BushUserManager.d.ts index 49fc680..f3fffac 100644 --- a/src/lib/extensions/discord.js/BushUserManager.d.ts +++ b/src/lib/extensions/discord.js/BushUserManager.d.ts @@ -1,8 +1,6 @@ -import { Snowflake } from 'discord-api-types'; -import { BaseFetchOptions, CachedManager } from 'discord.js'; -import { RawUserData } from 'discord.js/typings/rawDataTypes'; -import { BushClient, BushUserResolvable } from '../discord-akairo/BushClient'; -import { BushUser } from './BushUser'; +import { type BushClient, type BushUser, type BushUserResolvable } from '@lib'; +import { CachedManager, type BaseFetchOptions, type Snowflake } from 'discord.js'; +import { type RawUserData } from 'discord.js/typings/rawDataTypes'; export class BushUserManager extends CachedManager<Snowflake, BushUser, BushUserResolvable> { public constructor(client: BushClient, iterable?: Iterable<RawUserData>); diff --git a/src/lib/extensions/discord.js/BushVoiceChannel.ts b/src/lib/extensions/discord.js/BushVoiceChannel.ts index ab0da15..15a402f 100644 --- a/src/lib/extensions/discord.js/BushVoiceChannel.ts +++ b/src/lib/extensions/discord.js/BushVoiceChannel.ts @@ -1,8 +1,6 @@ -import { Collection, Snowflake, VoiceChannel } from 'discord.js'; -import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; +import { type BushClient, type BushGuild, type BushGuildMember } from '@lib'; +import { VoiceChannel, type Collection, type Snowflake } from 'discord.js'; +import { type RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; export class BushVoiceChannel extends VoiceChannel { public declare readonly client: BushClient; diff --git a/src/lib/extensions/discord.js/BushVoiceState.ts b/src/lib/extensions/discord.js/BushVoiceState.ts index d9570ad..7889f3b 100644 --- a/src/lib/extensions/discord.js/BushVoiceState.ts +++ b/src/lib/extensions/discord.js/BushVoiceState.ts @@ -1,11 +1,9 @@ +import { type BushGuild, type BushGuildMember, type BushStageChannel, type BushVoiceChannel } from '@lib'; import { VoiceState } from 'discord.js'; -import { RawVoiceStateData } from 'discord.js/typings/rawDataTypes'; -import { BushGuild } from './BushGuild'; -import { BushGuildMember } from './BushGuildMember'; -import { BushStageChannel } from './BushStageChannel'; -import { BushVoiceChannel } from './BushVoiceChannel'; +import { type RawVoiceStateData } from 'discord.js/typings/rawDataTypes'; export class BushVoiceState extends VoiceState { + // public declare readonly client: BushClient; public declare readonly channel: BushVoiceChannel | BushStageChannel | null; public declare guild: BushGuild; public declare readonly member: BushGuildMember | null; diff --git a/src/lib/index.ts b/src/lib/index.ts index ec4dcb2..da02888 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -3,6 +3,8 @@ export * from './common/ButtonPaginator'; export * from './common/DeleteButton'; export * from './common/Format'; export * from './common/Moderation'; +export type { BushInspectOptions } from './common/typings/BushInspectOptions'; +export type { CodeBlockLang } from './common/typings/CodeBlockLang'; export * from './common/util/Arg'; export * from './extensions/discord-akairo/BushArgumentTypeCaster'; export * from './extensions/discord-akairo/BushClient'; diff --git a/src/lib/models/ActivePunishment.ts b/src/lib/models/ActivePunishment.ts index 0ad6cd8..83ada29 100644 --- a/src/lib/models/ActivePunishment.ts +++ b/src/lib/models/ActivePunishment.ts @@ -1,6 +1,6 @@ -import { Snowflake } from 'discord.js'; +import { type Snowflake } from 'discord.js'; import { nanoid } from 'nanoid'; -import { DataTypes, Sequelize } from 'sequelize'; +import { DataTypes, type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel'; export enum ActivePunishmentType { @@ -30,34 +30,45 @@ export interface ActivePunishmentModelCreationAttributes { modlog: string; } -// declaration merging so that the fields don't override Sequelize's getters -export interface ActivePunishment { - /** The ID of this punishment (no real use just for a primary key) */ - id: string; +export class ActivePunishment + extends BaseModel<ActivePunishmentModel, ActivePunishmentModelCreationAttributes> + implements ActivePunishmentModel +{ + /** + * The ID of this punishment (no real use just for a primary key) + */ + public declare id: string; - /** The type of punishment. */ - type: ActivePunishmentType; + /** + * The type of punishment. + */ + public declare type: ActivePunishmentType; - /** The user who is punished. */ - user: Snowflake; + /** + * The user who is punished. + */ + public declare user: Snowflake; - /** The guild they are punished in. */ - guild: Snowflake; + /** + * The guild they are punished in. + */ + public declare guild: Snowflake; - /** Additional info about the punishment if applicable. The channel id for channel blocks and role for punishment roles. */ - extraInfo: Snowflake; + /** + * Additional info about the punishment if applicable. The channel id for channel blocks and role for punishment roles. + */ + public declare extraInfo: Snowflake; - /** The date when this punishment expires (optional). */ - expires: Date | null; + /** + * The date when this punishment expires (optional). + */ + public declare expires: Date | null; - /** The reference to the modlog entry. */ - modlog: string; -} + /** + * The reference to the modlog entry. + */ + public declare modlog: string; -export class ActivePunishment - extends BaseModel<ActivePunishmentModel, ActivePunishmentModelCreationAttributes> - implements ActivePunishmentModel -{ public static initModel(sequelize: Sequelize): void { ActivePunishment.init( { diff --git a/src/lib/models/BaseModel.ts b/src/lib/models/BaseModel.ts index d9377d1..8fba5e5 100644 --- a/src/lib/models/BaseModel.ts +++ b/src/lib/models/BaseModel.ts @@ -1,13 +1,13 @@ import { Model } from 'sequelize'; -// declaration merging so that the fields don't override Sequelize's getters -// eslint-disable-next-line @typescript-eslint/no-unused-vars -export interface BaseModel<A, B> { - /** The date when the row was created. */ - readonly createdAt: Date; +export abstract class BaseModel<A, B> extends Model<A, B> { + /** + * The date when the row was created. + */ + public declare readonly createdAt: Date; - /** The date when the row was last updated. */ - readonly updatedAt: Date; + /** + * The date when the row was last updated. + */ + public declare readonly updatedAt: Date; } - -export abstract class BaseModel<A, B> extends Model<A, B> {} diff --git a/src/lib/models/Global.ts b/src/lib/models/Global.ts index c5c680d..6b6ebae 100644 --- a/src/lib/models/Global.ts +++ b/src/lib/models/Global.ts @@ -1,5 +1,5 @@ -import { Snowflake } from 'discord.js'; -import { DataTypes, Sequelize } from 'sequelize'; +import { type Snowflake } from 'discord.js'; +import { DataTypes, type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel'; import { jsonArray } from './__helpers'; @@ -21,28 +21,37 @@ export interface GlobalModelCreationAttributes { blacklistedChannels?: Snowflake[]; } -// declaration merging so that the fields don't override Sequelize's getters -export interface Global { - /** The bot's environment. */ - environment: 'production' | 'development' | 'beta'; +export class Global extends BaseModel<GlobalModel, GlobalModelCreationAttributes> implements GlobalModel { + /** + * The bot's environment. + */ + public declare environment: 'production' | 'development' | 'beta'; - /** Trusted users. */ - superUsers: Snowflake[]; + /** + * Trusted users. + */ + public declare superUsers: Snowflake[]; - /** Globally disabled commands. */ - disabledCommands: string[]; + /** + * Globally disabled commands. + */ + public declare disabledCommands: string[]; - /** Globally blacklisted users. */ - blacklistedUsers: Snowflake[]; + /** + * Globally blacklisted users. + */ + public declare blacklistedUsers: Snowflake[]; - /** Guilds blacklisted from using the bot. */ - blacklistedGuilds: Snowflake[]; + /** + * Guilds blacklisted from using the bot. + */ + public declare blacklistedGuilds: Snowflake[]; - /** Channels where the bot is prevented from running. */ - blacklistedChannels: Snowflake[]; -} + /** + * Channels where the bot is prevented from running commands in. + */ + public declare blacklistedChannels: Snowflake[]; -export class Global extends BaseModel<GlobalModel, GlobalModelCreationAttributes> implements GlobalModel { public static initModel(sequelize: Sequelize): void { Global.init( { diff --git a/src/lib/models/Guild.ts b/src/lib/models/Guild.ts index 1fadde9..583cbd7 100644 --- a/src/lib/models/Guild.ts +++ b/src/lib/models/Guild.ts @@ -1,7 +1,7 @@ -import { Snowflake } from 'discord.js'; -import { DataTypes, Sequelize } from 'sequelize'; -import { BadWords } from '../common/AutoMod'; -import { BushClient } from '../extensions/discord-akairo/BushClient'; +import { type Snowflake } from 'discord.js'; +import { DataTypes, type Sequelize } from 'sequelize'; +import { type BadWords } from '../common/AutoMod'; +import { type BushClient } from '../extensions/discord-akairo/BushClient'; import { BaseModel } from './BaseModel'; import { jsonArray, jsonObject } from './__helpers'; @@ -47,64 +47,97 @@ export interface GuildModelCreationAttributes { levelUpChannel?: Snowflake; } -// declaration merging so that the fields don't override Sequelize's getters -export interface Guild { - /** The ID of the guild */ - id: Snowflake; +export class Guild extends BaseModel<GuildModel, GuildModelCreationAttributes> implements GuildModel { + /** + * The ID of the guild + */ + public declare id: Snowflake; - /** The bot's prefix for the guild */ - prefix: string; + /** + * The bot's prefix for the guild + */ + public declare prefix: string; - /** Channels that will have their messages automatically published */ - autoPublishChannels: Snowflake[]; + /** + * Channels that will have their messages automatically published + */ + public declare autoPublishChannels: Snowflake[]; - /** Channels where the bot won't respond in. */ - blacklistedChannels: Snowflake[]; + /** + * Channels where the bot won't respond in. + */ + public declare blacklistedChannels: Snowflake[]; - /** Users that the bot ignores in this guild */ - blacklistedUsers: Snowflake[]; + /** + * Users that the bot ignores in this guild + */ + public declare blacklistedUsers: Snowflake[]; - /** The channels where the welcome messages are sent */ - welcomeChannel: Snowflake; + /** + * The channels where the welcome messages are sent + */ + public declare welcomeChannel: Snowflake; - /** The role given out when muting someone */ - muteRole: Snowflake; + /** + * The role given out when muting someone + */ + public declare muteRole: Snowflake; - /** The message that gets sent after someone gets a punishment dm */ - punishmentEnding: string; + /** + * The message that gets sent after someone gets a punishment dm + */ + public declare punishmentEnding: string; - /** Guild specific disabled commands */ - disabledCommands: string[]; + /** + * Guild specific disabled commands + */ + public declare disabledCommands: string[]; - /** Channels that should get locked down when the lockdown command gets used. */ - lockdownChannels: Snowflake[]; + /** + * Channels that should get locked down when the lockdown command gets used. + */ + public declare lockdownChannels: Snowflake[]; - /** Custom automod phases */ - autoModPhases: BadWords; + /** + * Custom automod phases + */ + public declare autoModPhases: BadWords; - /** The features enabled in a guild */ - enabledFeatures: GuildFeatures[]; + /** + * The features enabled in a guild + */ + public declare enabledFeatures: GuildFeatures[]; - /** The roles to assign to a user if they are not assigned sticky roles */ - joinRoles: Snowflake[]; + /** + * The roles to assign to a user if they are not assigned sticky roles + */ + public declare joinRoles: Snowflake[]; - /** The channels where logging messages will be sent. */ - logChannels: LogChannelDB; + /** + * The channels where logging messages will be sent. + */ + public declare logChannels: LogChannelDB; - /** These users will be able to use commands in channels blacklisted */ - bypassChannelBlacklist: Snowflake[]; + /** + * These users will be able to use commands in channels blacklisted + */ + public declare bypassChannelBlacklist: Snowflake[]; - /** Channels where users will not earn xp for leveling. */ - noXpChannels: Snowflake[]; + /** + * Channels where users will not earn xp for leveling. + */ + public declare noXpChannels: Snowflake[]; - /** What roles get given to users when they reach certain levels. */ - levelRoles: { [level: number]: Snowflake }; + /** + * What roles get given to users when they reach certain levels. + */ + public declare levelRoles: { [level: number]: Snowflake }; - /** The channel to send level up messages in instead of last channel. */ - levelUpChannel: Snowflake; -} + /** + * The channel to send level up messages in instead of last channel. + */ + public declare levelUpChannel: Snowflake; -export class Guild extends BaseModel<GuildModel, GuildModelCreationAttributes> implements GuildModel { public static initModel(sequelize: Sequelize, client: BushClient): void { Guild.init( { diff --git a/src/lib/models/Level.ts b/src/lib/models/Level.ts index 7f418fd..6499bff 100644 --- a/src/lib/models/Level.ts +++ b/src/lib/models/Level.ts @@ -1,5 +1,5 @@ -import { Snowflake } from 'discord.js'; -import { DataTypes, Sequelize } from 'sequelize'; +import { type Snowflake } from 'discord.js'; +import { DataTypes, type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel'; export interface LevelModel { @@ -14,20 +14,25 @@ export interface LevelModelCreationAttributes { xp?: number; } -// declaration merging so that the fields don't override Sequelize's getters -export interface Level { - /** The user's id. */ - user: Snowflake; +export class Level extends BaseModel<LevelModel, LevelModelCreationAttributes> implements LevelModel { + /** + * The user's id. + */ + public declare user: Snowflake; - /** The guild where the user is gaining xp. */ - guild: Snowflake; + /** + * The guild where the user is gaining xp. + */ + public declare guild: Snowflake; - /**The user's xp.*/ - xp: number; -} + /** + * The user's xp. + */ + public declare xp: number; -export class Level extends BaseModel<LevelModel, LevelModelCreationAttributes> implements LevelModel { - /** The user's level. */ + /** + * The user's level. + */ public get level(): number { return Level.convertXpToLevel(this.xp); } @@ -44,19 +49,11 @@ export class Level extends BaseModel<LevelModel, LevelModelCreationAttributes> i } public static convertXpToLevel(xp: number): number { - let i = 1; - let lvl: number; - // eslint-disable-next-line no-constant-condition - while (true) { - const neededXp = Level.convertLevelToXp(i); - if (neededXp > xp) { - lvl = i; - break; - } else { - i++; - } + let i = 0; + while (Level.convertLevelToXp(i + 1) < xp) { + i++; } - return lvl - 1; // I have to do this don't question it ok + return i; } public static convertLevelToXp(level: number): number { diff --git a/src/lib/models/ModLog.ts b/src/lib/models/ModLog.ts index 0151cf6..b2351b9 100644 --- a/src/lib/models/ModLog.ts +++ b/src/lib/models/ModLog.ts @@ -1,6 +1,6 @@ -import { Snowflake } from 'discord.js'; +import { type Snowflake } from 'discord.js'; import { nanoid } from 'nanoid'; -import { DataTypes, Sequelize } from 'sequelize'; +import { DataTypes, type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel'; import { jsonBoolean } from './__helpers'; @@ -47,45 +47,62 @@ export interface ModLogModelCreationAttributes { hidden?: boolean; } -// declaration merging so that the fields don't override Sequelize's getters -export interface ModLog { - /** The primary key of the modlog entry. */ - id: string; +export class ModLog extends BaseModel<ModLogModel, ModLogModelCreationAttributes> implements ModLogModel { + /** + * The primary key of the modlog entry. + */ + public declare id: string; + + /** + * The type of punishment. + */ + public declare type: ModLogType; - /** The type of punishment. */ - type: ModLogType; + /** + * The user being punished. + */ + public declare user: Snowflake; - /** The user being punished. */ - user: Snowflake; + /** + * The user carrying out the punishment. + */ + public declare moderator: Snowflake; - /** The user carrying out the punishment. */ - moderator: Snowflake; - - /** The reason the user is getting punished. */ - reason: string | null; + /** + * The reason the user is getting punished. + */ + public declare reason: string | null; - /** The amount of time the user is getting punished for. */ - duration: number | null; + /** + * The amount of time the user is getting punished for. + */ + public declare duration: number | null; - /** The guild the user is getting punished in. */ - guild: Snowflake; + /** + * The guild the user is getting punished in. + */ + public declare guild: Snowflake; - /** Evidence of what the user is getting punished for. */ - evidence: string; + /** + * Evidence of what the user is getting punished for. + */ + public declare evidence: string; - /** Not an actual modlog just used so a punishment entry can be made. */ - pseudo: boolean; + /** + * Not an actual modlog just used so a punishment entry can be made. + */ + public declare pseudo: boolean; - /** Hides from the modlog command unless show hidden is specified. */ - hidden: boolean; -} + /** + * Hides from the modlog command unless show hidden is specified. + */ + public declare hidden: boolean; -export class ModLog extends BaseModel<ModLogModel, ModLogModelCreationAttributes> implements ModLogModel { public static initModel(sequelize: Sequelize): void { ModLog.init( { id: { type: DataTypes.STRING, primaryKey: true, allowNull: false, defaultValue: nanoid }, - type: { type: DataTypes.STRING, allowNull: false }, //# This is not an enum because of a sequelize issue: https://github.com/sequelize/sequelize/issues/2554 + type: { type: DataTypes.STRING, allowNull: false }, //? This is not an enum because of a sequelize issue: https://github.com/sequelize/sequelize/issues/2554 user: { type: DataTypes.STRING, allowNull: false }, moderator: { type: DataTypes.STRING, allowNull: false }, duration: { type: DataTypes.STRING, allowNull: true }, diff --git a/src/lib/models/Stat.ts b/src/lib/models/Stat.ts index 89fc00f..a6e8f19 100644 --- a/src/lib/models/Stat.ts +++ b/src/lib/models/Stat.ts @@ -1,4 +1,4 @@ -import { DataTypes, Sequelize } from 'sequelize'; +import { DataTypes, type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel'; import { jsonBigint } from './__helpers'; @@ -14,16 +14,17 @@ export interface StatModelCreationAttributes { commandsUsed?: bigint; } -// declaration merging so that the fields don't override Sequelize's getters -export interface Stat { - /** The bot's environment. */ - environment: Environment; +export class Stat extends BaseModel<StatModel, StatModelCreationAttributes> implements StatModel { + /** + * The bot's environment. + */ + public declare environment: Environment; - /** The number of commands used */ - commandsUsed: bigint; -} + /** + * The number of commands used + */ + public declare commandsUsed: bigint; -export class Stat extends BaseModel<StatModel, StatModelCreationAttributes> implements StatModel { public static initModel(sequelize: Sequelize): void { Stat.init( { diff --git a/src/lib/models/StickyRole.ts b/src/lib/models/StickyRole.ts index 77e1889..657bac6 100644 --- a/src/lib/models/StickyRole.ts +++ b/src/lib/models/StickyRole.ts @@ -1,5 +1,5 @@ -import { Snowflake } from 'discord.js'; -import { DataTypes, Sequelize } from 'sequelize'; +import { type Snowflake } from 'discord.js'; +import { DataTypes, type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel'; import { jsonArray } from './__helpers'; @@ -16,22 +16,27 @@ export interface StickyRoleModelCreationAttributes { nickname?: string; } -// declaration merging so that the fields don't override Sequelize's getters -export interface StickyRole { - /** The id of the user the roles belongs to. */ - user: Snowflake; +export class StickyRole extends BaseModel<StickyRoleModel, StickyRoleModelCreationAttributes> implements StickyRoleModel { + /** + * The id of the user the roles belongs to. + */ + public declare user: Snowflake; - /** The guild where this should happen. */ - guild: Snowflake; + /** + * The guild where this should happen. + */ + public declare guild: Snowflake; - /** The roles that the user should have returned */ - roles: Snowflake[]; + /** + * The roles that the user should have returned + */ + public declare roles: Snowflake[]; - /** The user's previous nickname */ - nickname: string; -} + /** + * The user's previous nickname + */ + public declare nickname: string; -export class StickyRole extends BaseModel<StickyRoleModel, StickyRoleModelCreationAttributes> implements StickyRoleModel { public static initModel(sequelize: Sequelize): void { StickyRole.init( { diff --git a/src/lib/models/__helpers.ts b/src/lib/models/__helpers.ts index dafbd84..3a958b9 100644 --- a/src/lib/models/__helpers.ts +++ b/src/lib/models/__helpers.ts @@ -1,4 +1,4 @@ -import { DataTypes, Model } from 'sequelize'; +import { DataTypes, type Model } from 'sequelize'; export function jsonParseGet(this: Model, key: string): any { return JSON.parse(this.getDataValue(key)); diff --git a/src/lib/utils/AllowedMentions.ts b/src/lib/utils/AllowedMentions.ts index 9b02c31..b4b188d 100644 --- a/src/lib/utils/AllowedMentions.ts +++ b/src/lib/utils/AllowedMentions.ts @@ -1,4 +1,4 @@ -import { MessageMentionOptions, MessageMentionTypes } from 'discord.js'; +import { type MessageMentionOptions, type MessageMentionTypes } from 'discord.js'; export class AllowedMentions { public everyone: boolean; diff --git a/src/lib/utils/BushCache.ts b/src/lib/utils/BushCache.ts index cdf328b..a330224 100644 --- a/src/lib/utils/BushCache.ts +++ b/src/lib/utils/BushCache.ts @@ -1,4 +1,4 @@ -import { Collection, Snowflake } from 'discord.js'; +import { Collection, type Snowflake } from 'discord.js'; import { Guild } from '../models/Guild'; export class BushCache { diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts index a4b3108..0377026 100644 --- a/src/lib/utils/BushConstants.ts +++ b/src/lib/utils/BushConstants.ts @@ -1,4 +1,4 @@ -import { Constants, ConstantsColors } from 'discord.js'; +import { Constants, type ConstantsColors } from 'discord.js'; const rawCapeUrl = 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/'; export class BushConstants { diff --git a/src/lib/utils/BushLogger.ts b/src/lib/utils/BushLogger.ts index 2aaba5b..4b89622 100644 --- a/src/lib/utils/BushLogger.ts +++ b/src/lib/utils/BushLogger.ts @@ -1,7 +1,7 @@ import chalk from 'chalk'; -import { Message, MessageEmbed, Util } from 'discord.js'; +import { MessageEmbed, Util, type Message } from 'discord.js'; import { inspect } from 'util'; -import { BushSendMessageType } from '../extensions/discord-akairo/BushClient'; +import { type BushSendMessageType } from '../extensions/discord-akairo/BushClient'; export class BushLogger { static #parseFormatting( diff --git a/src/lib/utils/Config.ts b/src/lib/utils/Config.ts index 81e3a85..0d44924 100644 --- a/src/lib/utils/Config.ts +++ b/src/lib/utils/Config.ts @@ -1,4 +1,4 @@ -import { Snowflake } from 'discord.js'; +import { type Snowflake } from 'discord.js'; export class Config { public credentials: Credentials; diff --git a/src/listeners/client/interactionCreate.ts b/src/listeners/client/interactionCreate.ts index 40c7628..6afc1a1 100644 --- a/src/listeners/client/interactionCreate.ts +++ b/src/listeners/client/interactionCreate.ts @@ -1,4 +1,4 @@ -import { AutoMod, BushButtonInteraction, BushClientEvents, BushListener } from '@lib'; +import { AutoMod, BushListener, type BushButtonInteraction, type BushClientEvents } from '@lib'; export default class InteractionCreateListener extends BushListener { public constructor() { diff --git a/src/listeners/commands/commandBlocked.ts b/src/listeners/commands/commandBlocked.ts index 074b6d6..4f9f492 100644 --- a/src/listeners/commands/commandBlocked.ts +++ b/src/listeners/commands/commandBlocked.ts @@ -1,5 +1,5 @@ -import { BushCommand, BushCommandHandlerEvents, BushListener, BushMessage, BushSlashMessage } from '@lib'; -import { InteractionReplyOptions, Message, MessagePayload, ReplyMessageOptions } from 'discord.js'; +import { BushListener, BushSlashMessage, type BushCommand, type BushCommandHandlerEvents, type BushMessage } from '@lib'; +import { type InteractionReplyOptions, type Message, type MessagePayload, type ReplyMessageOptions } from 'discord.js'; export default class CommandBlockedListener extends BushListener { public constructor() { diff --git a/src/listeners/commands/commandCooldown.ts b/src/listeners/commands/commandCooldown.ts index 118b676..b357ed8 100644 --- a/src/listeners/commands/commandCooldown.ts +++ b/src/listeners/commands/commandCooldown.ts @@ -1,4 +1,4 @@ -import { BushCommandHandlerEvents, BushListener } from '@lib'; +import { BushListener, type BushCommandHandlerEvents, type BushMessage } from '@lib'; export default class CommandCooldownListener extends BushListener { public constructor() { @@ -21,6 +21,6 @@ export default class CommandCooldownListener extends BushListener { content: `⏳ This command is on cooldown for ${Math.round(remaining / 1000)} seconds.`, ephemeral: true }) - : await message.react('⏳').catch(() => null); + : await (message as BushMessage).react('⏳').catch(() => null); } } diff --git a/src/listeners/commands/commandError.ts b/src/listeners/commands/commandError.ts index f29c7e0..a7303e8 100644 --- a/src/listeners/commands/commandError.ts +++ b/src/listeners/commands/commandError.ts @@ -1,7 +1,7 @@ -import { BushCommandHandlerEvents } from '@lib'; +import { type BushCommandHandlerEvents } from '@lib'; import { Severity } from '@sentry/types'; -import { AkairoMessage, Command, GuildTextBasedChannels } from 'discord-akairo'; -import { DMChannel, Formatters, Message, MessageEmbed } from 'discord.js'; +import { Command, type AkairoMessage, type GuildTextBasedChannels } from 'discord-akairo'; +import { Formatters, MessageEmbed, type DMChannel, type Message } from 'discord.js'; import { BushListener } from '../../lib/extensions/discord-akairo/BushListener'; export default class CommandErrorListener extends BushListener { diff --git a/src/listeners/commands/commandMissingPermissions.ts b/src/listeners/commands/commandMissingPermissions.ts index c8a3a6e..010682c 100644 --- a/src/listeners/commands/commandMissingPermissions.ts +++ b/src/listeners/commands/commandMissingPermissions.ts @@ -1,4 +1,4 @@ -import { BushCommandHandlerEvents, BushListener } from '@lib'; +import { BushListener, type BushCommandHandlerEvents } from '@lib'; export default class CommandMissingPermissionsListener extends BushListener { public constructor() { diff --git a/src/listeners/commands/commandStarted.ts b/src/listeners/commands/commandStarted.ts index 5d77d66..eff8c94 100644 --- a/src/listeners/commands/commandStarted.ts +++ b/src/listeners/commands/commandStarted.ts @@ -1,7 +1,7 @@ -import { BushCommandHandlerEvents, BushListener } from '@lib'; +import { BushListener, type BushCommandHandlerEvents } from '@lib'; import { Severity } from '@sentry/types'; -import { GuildTextBasedChannels } from 'discord-akairo'; -import { DMChannel } from 'discord.js'; +import { type GuildTextBasedChannels } from 'discord-akairo'; +import { type DMChannel } from 'discord.js'; export default class CommandStartedListener extends BushListener { public constructor() { diff --git a/src/listeners/commands/messageBlocked.ts b/src/listeners/commands/messageBlocked.ts index 0b1001c..7299eca 100644 --- a/src/listeners/commands/messageBlocked.ts +++ b/src/listeners/commands/messageBlocked.ts @@ -1,4 +1,4 @@ -import { BushCommandHandlerEvents, BushListener } from '@lib'; +import { BushListener, type BushCommandHandlerEvents } from '@lib'; export default class MessageBlockedListener extends BushListener { public constructor() { diff --git a/src/listeners/commands/slashBlocked.ts b/src/listeners/commands/slashBlocked.ts index 6c94187..b5c57bf 100644 --- a/src/listeners/commands/slashBlocked.ts +++ b/src/listeners/commands/slashBlocked.ts @@ -1,4 +1,4 @@ -import { BushCommandHandlerEvents, BushListener } from '@lib'; +import { BushListener, type BushCommandHandlerEvents } from '@lib'; import CommandBlockedListener from './commandBlocked'; export default class SlashBlockedListener extends BushListener { diff --git a/src/listeners/commands/slashCommandError.ts b/src/listeners/commands/slashCommandError.ts index 9b194e5..435e449 100644 --- a/src/listeners/commands/slashCommandError.ts +++ b/src/listeners/commands/slashCommandError.ts @@ -1,4 +1,4 @@ -import { BushCommandHandlerEvents, BushListener } from '@lib'; +import { BushListener, type BushCommandHandlerEvents } from '@lib'; import CommandErrorListener from './commandError'; export default class SlashCommandErrorListener extends BushListener { diff --git a/src/listeners/commands/slashMissingPermissions.ts b/src/listeners/commands/slashMissingPermissions.ts index 33a9363..969c0e9 100644 --- a/src/listeners/commands/slashMissingPermissions.ts +++ b/src/listeners/commands/slashMissingPermissions.ts @@ -1,4 +1,4 @@ -import { BushCommandHandlerEvents, BushListener } from '@lib'; +import { BushListener, type BushCommandHandlerEvents } from '@lib'; import CommandMissingPermissionsListener from './commandMissingPermissions'; export default class SlashMissingPermissionsListener extends BushListener { diff --git a/src/listeners/commands/slashNotFound.ts b/src/listeners/commands/slashNotFound.ts index c5d92bd..26635e8 100644 --- a/src/listeners/commands/slashNotFound.ts +++ b/src/listeners/commands/slashNotFound.ts @@ -1,4 +1,4 @@ -import { BushCommandHandlerEvents, BushListener } from '@lib'; +import { BushListener, type BushCommandHandlerEvents } from '@lib'; export default class SlashNotFoundListener extends BushListener { public constructor() { diff --git a/src/listeners/commands/slashStarted.ts b/src/listeners/commands/slashStarted.ts index e9e4028..46b6610 100644 --- a/src/listeners/commands/slashStarted.ts +++ b/src/listeners/commands/slashStarted.ts @@ -1,4 +1,4 @@ -import { BushCommandHandlerEvents, BushListener } from '@lib'; +import { BushListener, type BushCommandHandlerEvents } from '@lib'; export default class SlashStartedListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushBan.ts b/src/listeners/custom/bushBan.ts index ee5ebcf..8352099 100644 --- a/src/listeners/custom/bushBan.ts +++ b/src/listeners/custom/bushBan.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; export default class BushBanListener extends BushListener { diff --git a/src/listeners/custom/bushKick.ts b/src/listeners/custom/bushKick.ts index 74d90e4..ceb4d54 100644 --- a/src/listeners/custom/bushKick.ts +++ b/src/listeners/custom/bushKick.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; export default class BushKickListener extends BushListener { diff --git a/src/listeners/custom/bushLevelUpdate.ts b/src/listeners/custom/bushLevelUpdate.ts index a4b999b..a5aca7a 100644 --- a/src/listeners/custom/bushLevelUpdate.ts +++ b/src/listeners/custom/bushLevelUpdate.ts @@ -1,5 +1,5 @@ -import { BushClientEvents, BushListener } from '@lib'; -import { Formatters, TextChannel } from 'discord.js'; +import { BushListener, type BushClientEvents } from '@lib'; +import { Formatters, type TextChannel } from 'discord.js'; export default class BushLevelUpdateListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushMute.ts b/src/listeners/custom/bushMute.ts index c5b1d74..67200fe 100644 --- a/src/listeners/custom/bushMute.ts +++ b/src/listeners/custom/bushMute.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; export default class BushMuteListener extends BushListener { diff --git a/src/listeners/custom/bushPunishRole.ts b/src/listeners/custom/bushPunishRole.ts index f34f1d8..b434cd3 100644 --- a/src/listeners/custom/bushPunishRole.ts +++ b/src/listeners/custom/bushPunishRole.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; export default class BushPunishRoleListener extends BushListener { diff --git a/src/listeners/custom/bushPunishRoleRemove.ts b/src/listeners/custom/bushPunishRoleRemove.ts index fa09f44..c147101 100644 --- a/src/listeners/custom/bushPunishRoleRemove.ts +++ b/src/listeners/custom/bushPunishRoleRemove.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; export default class BushPunishRoleRemoveListener extends BushListener { diff --git a/src/listeners/custom/bushPurge.ts b/src/listeners/custom/bushPurge.ts index ac81916..aa43612 100644 --- a/src/listeners/custom/bushPurge.ts +++ b/src/listeners/custom/bushPurge.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { MessageEmbed } from 'discord.js'; export default class BushPurgeListener extends BushListener { diff --git a/src/listeners/custom/bushUnban.ts b/src/listeners/custom/bushUnban.ts index b2007fd..7c8f3cb 100644 --- a/src/listeners/custom/bushUnban.ts +++ b/src/listeners/custom/bushUnban.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; export default class BushUnbanListener extends BushListener { diff --git a/src/listeners/custom/bushUnmute.ts b/src/listeners/custom/bushUnmute.ts index c34cc14..7ef0745 100644 --- a/src/listeners/custom/bushUnmute.ts +++ b/src/listeners/custom/bushUnmute.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; export default class BushUnmuteListener extends BushListener { diff --git a/src/listeners/custom/bushUpdateModlog.ts b/src/listeners/custom/bushUpdateModlog.ts index 62979ae..105c6ad 100644 --- a/src/listeners/custom/bushUpdateModlog.ts +++ b/src/listeners/custom/bushUpdateModlog.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { MessageEmbed } from 'discord.js'; export default class BushUpdateModlogListener extends BushListener { diff --git a/src/listeners/custom/bushUpdateSettings.ts b/src/listeners/custom/bushUpdateSettings.ts index 39e76c7..2a9421f 100644 --- a/src/listeners/custom/bushUpdateSettings.ts +++ b/src/listeners/custom/bushUpdateSettings.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { MessageEmbed } from 'discord.js'; export default class BushUpdateSettingsListener extends BushListener { diff --git a/src/listeners/custom/bushWarn.ts b/src/listeners/custom/bushWarn.ts index b787b5c..027cb65 100644 --- a/src/listeners/custom/bushWarn.ts +++ b/src/listeners/custom/bushWarn.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; export default class BushWarnListener extends BushListener { diff --git a/src/listeners/guild/guildCreate.ts b/src/listeners/guild/guildCreate.ts index 622958f..419d773 100644 --- a/src/listeners/guild/guildCreate.ts +++ b/src/listeners/guild/guildCreate.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener, Guild } from '@lib'; +import { BushListener, Guild, type BushClientEvents } from '@lib'; export default class GuildCreateListener extends BushListener { public constructor() { diff --git a/src/listeners/guild/guildDelete.ts b/src/listeners/guild/guildDelete.ts index 4db092b..674feb1 100644 --- a/src/listeners/guild/guildDelete.ts +++ b/src/listeners/guild/guildDelete.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; export default class GuildDeleteListener extends BushListener { public constructor() { diff --git a/src/listeners/guild/guildMemberAdd.ts b/src/listeners/guild/guildMemberAdd.ts index 295b889..264ea12 100644 --- a/src/listeners/guild/guildMemberAdd.ts +++ b/src/listeners/guild/guildMemberAdd.ts @@ -1,5 +1,5 @@ -import { BushClientEvents, BushGuildMember, BushListener, BushTextChannel, StickyRole } from '@lib'; -import { MessageEmbed, Snowflake, Util } from 'discord.js'; +import { BushListener, StickyRole, type BushClientEvents, type BushGuildMember, type BushTextChannel } from '@lib'; +import { MessageEmbed, Util, type Snowflake } from 'discord.js'; export default class GuildMemberAddListener extends BushListener { public constructor() { diff --git a/src/listeners/guild/guildMemberRemove.ts b/src/listeners/guild/guildMemberRemove.ts index 57ed5ce..d9c9b6f 100644 --- a/src/listeners/guild/guildMemberRemove.ts +++ b/src/listeners/guild/guildMemberRemove.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushGuildMember, BushListener, BushTextChannel, PartialBushGuildMember, StickyRole } from '@lib'; +import { BushGuildMember, BushListener, BushTextChannel, StickyRole, type BushClientEvents, type PartialBushGuildMember } from '@lib'; import { MessageEmbed, Util } from 'discord.js'; export default class GuildMemberRemoveListener extends BushListener { diff --git a/src/listeners/guild/syncUnban.ts b/src/listeners/guild/syncUnban.ts index db654b8..2062679 100644 --- a/src/listeners/guild/syncUnban.ts +++ b/src/listeners/guild/syncUnban.ts @@ -1,4 +1,4 @@ -import { ActivePunishment, ActivePunishmentType, BushClientEvents, BushListener } from '@lib'; +import { ActivePunishment, ActivePunishmentType, BushListener, type BushClientEvents } from '@lib'; export default class SyncUnbanListener extends BushListener { public constructor() { diff --git a/src/listeners/message/autoPublisher.ts b/src/listeners/message/autoPublisher.ts index a0ae39e..2714296 100644 --- a/src/listeners/message/autoPublisher.ts +++ b/src/listeners/message/autoPublisher.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; export default class autoPublisherListener extends BushListener { public constructor() { diff --git a/src/listeners/message/autoThread.ts b/src/listeners/message/autoThread.ts index 319b214..2f0dee8 100644 --- a/src/listeners/message/autoThread.ts +++ b/src/listeners/message/autoThread.ts @@ -1,5 +1,5 @@ -import { BushClientEvents, BushListener, BushTextChannel } from '@lib'; -import { GuildTextBasedChannels } from 'discord-akairo'; +import { BushListener, type BushClientEvents, type BushTextChannel } from '@lib'; +import { type GuildTextBasedChannels } from 'discord-akairo'; import { MessageEmbed } from 'discord.js'; export default class autoThreadListener extends BushListener { @@ -41,7 +41,8 @@ export default class autoThreadListener extends BushListener { name: `Support - ${message.author.username}#${message.author.discriminator}`, autoArchiveDuration: 60, reason: 'Support Thread' - }); + }).catch(() => null); + if (!thread) return; const embed = new MessageEmbed() .setTitle('NotEnoughUpdates Support') .setDescription( diff --git a/src/listeners/message/automodCreate.ts b/src/listeners/message/automodCreate.ts index 0bf4c29..5182557 100644 --- a/src/listeners/message/automodCreate.ts +++ b/src/listeners/message/automodCreate.ts @@ -1,4 +1,4 @@ -import { AutoMod, BushClientEvents, BushListener } from '@lib'; +import { AutoMod, BushListener, type BushClientEvents } from '@lib'; export default class AutomodMessageCreateListener extends BushListener { public constructor() { diff --git a/src/listeners/message/automodUpdate.ts b/src/listeners/message/automodUpdate.ts index ff89a09..fc1f355 100644 --- a/src/listeners/message/automodUpdate.ts +++ b/src/listeners/message/automodUpdate.ts @@ -1,4 +1,4 @@ -import { AutoMod, BushClientEvents, BushListener, BushMessage } from '@lib'; +import { AutoMod, BushListener, type BushClientEvents, type BushMessage } from '@lib'; export default class AutomodMessageUpdateListener extends BushListener { public constructor() { diff --git a/src/listeners/message/blacklistedFile.ts b/src/listeners/message/blacklistedFile.ts index 11af787..bc8b335 100644 --- a/src/listeners/message/blacklistedFile.ts +++ b/src/listeners/message/blacklistedFile.ts @@ -1,5 +1,5 @@ -import { BushClientEvents, BushListener } from '@lib'; -import crypto from 'crypto'; +import { BushListener, type BushClientEvents } from '@lib'; +import * as crypto from 'crypto'; import got from 'got'; export default class BlacklistedFileListener extends BushListener { diff --git a/src/listeners/message/boosterMessage.ts b/src/listeners/message/boosterMessage.ts index a161784..6fcd06e 100644 --- a/src/listeners/message/boosterMessage.ts +++ b/src/listeners/message/boosterMessage.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; export default class BoosterMessageListener extends BushListener { public constructor() { diff --git a/src/listeners/message/directMessage.ts b/src/listeners/message/directMessage.ts index 41e4792..2162c3a 100644 --- a/src/listeners/message/directMessage.ts +++ b/src/listeners/message/directMessage.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; import { MessageEmbed } from 'discord.js'; export default class DirectMessageListener extends BushListener { diff --git a/src/listeners/message/level.ts b/src/listeners/message/level.ts index 06e0485..3702a05 100644 --- a/src/listeners/message/level.ts +++ b/src/listeners/message/level.ts @@ -1,5 +1,5 @@ -import { BushCommandHandlerEvents, BushGuild, BushListener, BushMessage, Level } from '@lib'; -import { MessageType } from 'discord.js'; +import { BushListener, Level, type BushCommandHandlerEvents, type BushGuild, type BushMessage } from '@lib'; +import { type MessageType } from 'discord.js'; export default class LevelListener extends BushListener { #levelCooldowns: Set<string> = new Set(); @@ -11,8 +11,8 @@ export default class LevelListener extends BushListener { }); } public override async exec(...[message]: BushCommandHandlerEvents['messageInvalid']) { - if (message.author.bot || !message.author || !message.guild) return; - if (this.#levelCooldowns.has(`${message.guild.id}-${message.author.id}`)) return; + if (message.author.bot || !message.author || !message.guild || !message.guildId) return; + if (this.#levelCooldowns.has(`${message.guildId}-${message.author.id}`)) return; if ((await message.guild.getSetting('noXpChannels')).includes(message.channel.id)) return; const allowedMessageTypes: MessageType[] = ['DEFAULT', 'REPLY']; // this is so ts will yell at me when discord.js makes some unnecessary breaking change @@ -20,11 +20,11 @@ export default class LevelListener extends BushListener { const [user] = await Level.findOrBuild({ where: { user: message.author.id, - guild: message.guild.id + guild: message.guildId }, defaults: { user: message.author.id, - guild: message.guild.id, + guild: message.guildId, xp: 0 } }); @@ -47,7 +47,7 @@ export default class LevelListener extends BushListener { ); if (success) void client.logger.verbose(`level`, `Gave <<${xpToGive}>> XP to <<${message.author.tag}>> in <<${message.guild}>>.`); - this.#levelCooldowns.add(`${message.guild.id}-${message.author.id}`); - setTimeout(() => this.#levelCooldowns.delete(`${message.guild!.id}-${message.author.id}`), 60_000); + this.#levelCooldowns.add(`${message.guildId}-${message.author.id}`); + setTimeout(() => this.#levelCooldowns.delete(`${message.guildId}-${message.author.id}`), 60_000); } } diff --git a/src/listeners/message/verbose.ts b/src/listeners/message/verbose.ts index 8214471..fbbf055 100644 --- a/src/listeners/message/verbose.ts +++ b/src/listeners/message/verbose.ts @@ -1,4 +1,4 @@ -import { BushClientEvents, BushListener } from '@lib'; +import { BushListener, type BushClientEvents } from '@lib'; export default class MessageVerboseListener extends BushListener { public constructor() { diff --git a/src/tasks/removeExpiredPunishements.ts b/src/tasks/removeExpiredPunishements.ts index b39cdb7..dee6a89 100644 --- a/src/tasks/removeExpiredPunishements.ts +++ b/src/tasks/removeExpiredPunishements.ts @@ -1,4 +1,4 @@ -import { ActivePunishment, ActivePunishmentType, BushGuild, BushTask, BushUser } from '@lib'; +import { ActivePunishment, ActivePunishmentType, BushTask, type BushGuild, type BushUser } from '@lib'; import { Op } from 'sequelize'; export default class RemoveExpiredPunishmentsTask extends BushTask { diff --git a/src/tasks/updateCache.ts b/src/tasks/updateCache.ts index 11d6ca9..6ccf609 100644 --- a/src/tasks/updateCache.ts +++ b/src/tasks/updateCache.ts @@ -1,4 +1,4 @@ -import { BushClient, Global, Guild } from '@lib'; +import { Global, Guild, type BushClient } from '@lib'; import { BushTask } from '../lib/extensions/discord-akairo/BushTask'; import config from './../config/options'; |