diff options
Diffstat (limited to 'src')
75 files changed, 173 insertions, 192 deletions
diff --git a/src/arguments/durationSeconds.ts b/src/arguments/durationSeconds.ts index 6b0e91d..98a5262 100644 --- a/src/arguments/durationSeconds.ts +++ b/src/arguments/durationSeconds.ts @@ -1,4 +1,4 @@ -import { BushArgumentTypeCaster } from '../lib'; +import { BushArgumentTypeCaster } from '@lib'; export const durationSecondsTypeCaster: BushArgumentTypeCaster = (_, phrase): number | null => { phrase += 's'; diff --git a/src/arguments/permission.ts b/src/arguments/permission.ts index 3275c49..bb042d5 100644 --- a/src/arguments/permission.ts +++ b/src/arguments/permission.ts @@ -1,5 +1,5 @@ +import { BushArgumentTypeCaster } from '@lib'; import { Permissions } from 'discord.js'; -import { BushArgumentTypeCaster } from '../lib/extensions/discord-akairo/BushArgumentTypeCaster'; export const permissionTypeCaster: BushArgumentTypeCaster = (_, phrase) => { if (!phrase) return null; diff --git a/src/arguments/snowflake.ts b/src/arguments/snowflake.ts index 0e6136f..add3224 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 { BushArgumentTypeCaster } from '../lib'; export const snowflakeTypeCaster: BushArgumentTypeCaster = (_, phrase): Snowflake | null => { if (!phrase) return null; diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts index f8c97a9..bae1133 100644 --- a/src/commands/admin/channelPermissions.ts +++ b/src/commands/admin/channelPermissions.ts @@ -1,6 +1,5 @@ +import { BushCommand, BushMessage, ButtonPaginator } from '@lib'; import { GuildMember, MessageEmbed, Role } from 'discord.js'; -import { BushCommand, BushMessage } from '../../lib'; -import { ButtonPaginator } from '../../lib/common/ButtonPaginator'; export default class ChannelPermissionsCommand extends BushCommand { public constructor() { diff --git a/src/commands/admin/roleAll.ts b/src/commands/admin/roleAll.ts index ec1f2b5..73369fc 100644 --- a/src/commands/admin/roleAll.ts +++ b/src/commands/admin/roleAll.ts @@ -1,5 +1,5 @@ +import { AllowedMentions, BushCommand, BushMessage } from '@lib'; import { GuildMember, Role } from 'discord.js'; -import { AllowedMentions, BushCommand, BushMessage } from '../../lib'; export default class RoleAllCommand extends BushCommand { public constructor() { diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts index 8a575c3..ef0c94e 100644 --- a/src/commands/config/blacklist.ts +++ b/src/commands/config/blacklist.ts @@ -35,14 +35,8 @@ export default class BlacklistCommand extends BushCommand { description: 'Would you like to add or remove someone or something from/to the blacklist?', type: 'STRING', choices: [ - { - name: 'blacklist', - value: 'blacklist' - }, - { - name: 'unblacklist', - value: 'unblacklist' - } + { name: 'blacklist', value: 'blacklist' }, + { name: 'unblacklist', value: 'unblacklist' } ], required: true }, @@ -91,12 +85,16 @@ export default class BlacklistCommand extends BushCommand { .catch(() => false); if (!success) return await message.util.reply({ - content: `${util.emojis.error} There was an error globally **${action}ing** ${target?.tag ?? target.name}.`, + content: `${util.emojis.error} There was an error globally ${action}ing ${util.format.bold( + target?.tag ?? target.name + )}.`, allowedMentions: AllowedMentions.none() }); else return await message.util.reply({ - content: `${util.emojis.success} Successfully **${action}ed** ${target?.tag ?? target.name} globally.`, + content: `${util.emojis.success} Successfully **${action}ed** ${util.format.bold( + target?.tag ?? target.name + )} globally.`, allowedMentions: AllowedMentions.none() }); // guild disable @@ -118,12 +116,12 @@ export default class BlacklistCommand extends BushCommand { .catch(() => false); if (!success) return await message.util.reply({ - content: `${util.emojis.error} There was an error **${action}ing** ${target?.tag ?? target.name}.`, + content: `${util.emojis.error} There was an error ${action}ing ${util.format.bold(target?.tag ?? target.name)}.`, allowedMentions: AllowedMentions.none() }); else return await message.util.reply({ - content: `${util.emojis.success} Successfully **${action}ed** ${target?.tag ?? target.name}.`, + content: `${util.emojis.success} Successfully ${action}ed ${util.format.bold(target?.tag ?? target.name)}.`, allowedMentions: AllowedMentions.none() }); } diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts index 83bcebe..0fdd615 100644 --- a/src/commands/config/config.ts +++ b/src/commands/config/config.ts @@ -218,7 +218,7 @@ export default class SettingsCommand extends BushCommand { case 'add': case 'remove': { const existing = (await message.guild.getSetting(setting)) as string[]; - const updated = util.addOrRemoveFromArray('add', existing, parseVal(value)); + const updated = util.addOrRemoveFromArray(action, existing, parseVal(value)); await message.guild.setSetting(setting, updated, message.member); const messageOptions = await this.generateMessageOptions(message, setting); msg = (await message.util.reply(messageOptions)) as Message; diff --git a/src/commands/dev/say.ts b/src/commands/dev/say.ts index a7e9943..f1695f8 100644 --- a/src/commands/dev/say.ts +++ b/src/commands/dev/say.ts @@ -31,8 +31,8 @@ export default class SayCommand extends BushCommand { if (!message.author.isOwner()) return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`); - await message.delete().catch(() => {}); - await message.util.send({ content: args.content, allowedMentions: AllowedMentions.none() }); + await message.delete().catch(() => null); + await message.util.send({ content: args.content, allowedMentions: AllowedMentions.none() }).catch(() => null); } public override async execSlash(message: AkairoMessage, args: { content: string }): Promise<unknown> { @@ -43,6 +43,6 @@ export default class SayCommand extends BushCommand { }); } await message.interaction.reply({ content: 'Attempting to send message.', ephemeral: true }); - return message.channel!.send({ content: args.content, allowedMentions: AllowedMentions.none() }); + return message.channel!.send({ content: args.content, allowedMentions: AllowedMentions.none() }).catch(() => null); } } diff --git a/src/commands/dev/servers.ts b/src/commands/dev/servers.ts index e366a64..5097695 100644 --- a/src/commands/dev/servers.ts +++ b/src/commands/dev/servers.ts @@ -1,6 +1,5 @@ +import { BushCommand, BushMessage, BushSlashMessage, ButtonPaginator } from '@lib'; import { Guild, MessageEmbedOptions } from 'discord.js'; -import { BushCommand, BushMessage, BushSlashMessage } from '../../lib'; -import { ButtonPaginator } from '../../lib/common/ButtonPaginator'; export default class ServersCommand extends BushCommand { public constructor() { diff --git a/src/commands/dev/test.ts b/src/commands/dev/test.ts index 38ea920..2ab266d 100644 --- a/src/commands/dev/test.ts +++ b/src/commands/dev/test.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage } from '@lib'; +import { BushCommand, BushMessage, ButtonPaginator } from '@lib'; import { ApplicationCommand, Collection, @@ -7,7 +7,6 @@ import { MessageButton, MessageEmbed } from 'discord.js'; -import { ButtonPaginator } from '../../lib/common/ButtonPaginator'; export default class TestCommand extends BushCommand { public constructor() { diff --git a/src/commands/fun/eightBall.ts b/src/commands/fun/eightBall.ts index b3c56da..4e79beb 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, BushMessage, BushSlashMessage } from '@lib'; export default class EightBallCommand extends BushCommand { public constructor() { diff --git a/src/commands/info/avatar.ts b/src/commands/info/avatar.ts index 7625b61..40debf0 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, BushMessage, BushSlashMessage } from '../../lib'; export default class AvatarCommand extends BushCommand { constructor() { diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts index 44c388d..2945050 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, BushMessage, BushSlashMessage } from '../../lib'; export default class GuildInfoCommand extends BushCommand { public constructor() { diff --git a/src/commands/info/icon.ts b/src/commands/info/icon.ts index ce27cc0..08538d7 100644 --- a/src/commands/info/icon.ts +++ b/src/commands/info/icon.ts @@ -1,5 +1,5 @@ +import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; import { MessageEmbed } from 'discord.js'; -import { BushCommand, BushMessage, BushSlashMessage } from '../../lib'; export default class IconCommand extends BushCommand { constructor() { diff --git a/src/commands/info/snowflake.ts b/src/commands/info/snowflake.ts index 083acbf..b203d94 100644 --- a/src/commands/info/snowflake.ts +++ b/src/commands/info/snowflake.ts @@ -1,3 +1,4 @@ +import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; import { CategoryChannel, Channel, @@ -15,7 +16,6 @@ import { User, VoiceChannel } from 'discord.js'; -import { BushCommand, BushMessage, BushSlashMessage } from '../../lib'; export default class SnowflakeCommand extends BushCommand { public constructor() { diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts index dde2270..3f7fac8 100644 --- a/src/commands/leveling/leaderboard.ts +++ b/src/commands/leveling/leaderboard.ts @@ -1,6 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage, Level } from '@lib'; +import { BushCommand, BushMessage, BushSlashMessage, ButtonPaginator, Level } from '@lib'; import { MessageEmbed } from 'discord.js'; -import { ButtonPaginator } from '../../lib/common/ButtonPaginator'; export default class LeaderboardCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index 74b1b54..a267b78 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -1,6 +1,5 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, Moderation } from '@lib'; import { Snowflake, User } from 'discord.js'; -import { Moderation } from '../../lib/common/Moderation'; export default class BanCommand extends BushCommand { public constructor() { @@ -35,8 +34,7 @@ export default class BanCommand extends BushCommand { id: 'days', flag: '--days', match: 'option', - customType: util.arg.range('integer', 0, 7, true), - default: 0 + customType: util.arg.range('integer', 0, 7, true) }, { id: 'force', @@ -83,25 +81,21 @@ export default class BanCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, - { - user: _user, - reason, - days, - force - }: { + args: { user: User | Snowflake; reason?: { duration: number | null; contentWithoutTime: string }; days?: number; force: boolean; } ): Promise<unknown> { - if (reason?.duration === null) reason.duration = 0; + if (typeof args.reason === 'object') args.reason.duration ??= 0; + args.days ??= 0; if (!message.guild) return message.util.reply(`${util.emojis.error} This command cannot be used in dms.`); - const member = message.guild!.members.cache.get((_user as User)?.id); - const user = member?.user ?? (await util.resolveNonCachedUser(_user)); + const member = message.guild!.members.cache.get((args.user as User)?.id ?? args.user); + const user = member?.user ?? (await util.resolveNonCachedUser((args.user as User)?.id ?? args.user)); if (!user) return message.util.reply(`${util.emojis.error} Invalid user.`); - const useForce = force && message.author.isOwner(); + const useForce = args.force && message.author.isOwner(); if (!message.member) throw new Error(`message.member is null`); const canModerateResponse = member ? await Moderation.permissionCheck(message.member, member, 'ban', true, useForce) : true; @@ -110,31 +104,33 @@ export default class BanCommand extends BushCommand { return await message.util.reply(canModerateResponse); } - if (message.util.parsed?.alias === 'dban' && !days) days = 1; + if (message.util.parsed?.alias === 'dban' && !args.days) args.days = 1; + + if (!Number.isInteger(args.days) || args.days! < 0 || args.days! > 7) { + client.console.debug(args.days); - if (!Number.isInteger(days) || days! < 0 || days! > 7) { return message.util.reply(`${util.emojis.error} The delete days must be an integer between 0 and 7.`); } let time: number; - if (reason) { - time = typeof reason === 'string' ? await util.arg.cast('duration', message, reason) : reason.duration; + if (args.reason) { + time = typeof args.reason === 'string' ? await util.arg.cast('duration', message, args.reason) : args.reason.duration; } - const parsedReason = reason?.contentWithoutTime ?? null; + const parsedReason = args.reason?.contentWithoutTime ?? null; const responseCode = member ? await member.bushBan({ reason: parsedReason, moderator: message.member, duration: time! ?? 0, - deleteDays: days ?? 0 + deleteDays: args.days }) : await message.guild.bushBan({ user, reason: parsedReason, moderator: message.member, duration: time! ?? 0, - deleteDays: days ?? 0 + deleteDays: args.days }); const responseMessage = () => { diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index 3238217..d4edb07 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -1,5 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, BushUser } from '@lib'; -import { Moderation } from '../../lib/common/Moderation'; +import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, BushUser, Moderation } 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 4abaa6f..6840f4e 100644 --- a/src/commands/moderation/modlog.ts +++ b/src/commands/moderation/modlog.ts @@ -1,6 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage, BushUser, ModLog } from '@lib'; +import { BushCommand, BushMessage, BushSlashMessage, BushUser, ButtonPaginator, ModLog } from '@lib'; import { MessageEmbed, User } from 'discord.js'; -import { ButtonPaginator } from '../../lib/common/ButtonPaginator'; export default class ModlogCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts index 00631ba..897e95a 100644 --- a/src/commands/moderation/mute.ts +++ b/src/commands/moderation/mute.ts @@ -1,5 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, BushUser } from '@lib'; -import { Moderation } from '../../lib/common/Moderation'; +import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, BushUser, Moderation } 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 a77e46a..65555a1 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 { BushCommand, BushMessage } from '../../lib'; export default class PurgeCommand extends BushCommand { public constructor() { diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts index f9335c4..3b4f5bd 100644 --- a/src/commands/moderation/unmute.ts +++ b/src/commands/moderation/unmute.ts @@ -1,5 +1,4 @@ -import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushSlashMessage, BushUser } from '@lib'; -import { Moderation } from '../../lib/common/Moderation'; +import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushSlashMessage, BushUser, Moderation } 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 c67466b..c510929 100644 --- a/src/commands/moderation/warn.ts +++ b/src/commands/moderation/warn.ts @@ -1,5 +1,4 @@ -import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushSlashMessage, BushUser } from '@lib'; -import { Moderation } from '../../lib/common/Moderation'; +import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushSlashMessage, BushUser, Moderation } from '@lib'; export default class WarnCommand extends BushCommand { public constructor() { diff --git a/src/commands/moulberry-bush/capes.ts b/src/commands/moulberry-bush/capes.ts index 1a09eb0..96b4685 100644 --- a/src/commands/moulberry-bush/capes.ts +++ b/src/commands/moulberry-bush/capes.ts @@ -1,8 +1,6 @@ +import { BushCommand, BushMessage, ButtonPaginator, DeleteButton } from '@lib'; import { MessageEmbedOptions } from 'discord.js'; import got from 'got'; -import { BushCommand, BushMessage } from '../../lib'; -import { ButtonPaginator } from '../../lib/common/ButtonPaginator'; -import { DeleteButton } from '../../lib/common/DeleteButton'; export interface GithubFile { path: string; diff --git a/src/commands/moulberry-bush/moulHammer.ts b/src/commands/moulberry-bush/moulHammer.ts index 129eb84..26841cb 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, BushMessage } from '../../lib'; 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 13976bb..24aa4aa 100644 --- a/src/commands/moulberry-bush/report.ts +++ b/src/commands/moulberry-bush/report.ts @@ -1,6 +1,6 @@ +import { AllowedMentions, BushCommand, BushMessage } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; import moment from 'moment'; -import { AllowedMentions, BushCommand, BushMessage } from '../../lib'; export default class ReportCommand extends BushCommand { public constructor() { diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts index 59c9e43..909ea92 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, BushMessage } from '../../lib'; const rules = [ { diff --git a/src/commands/moulberry-bush/serverStatus.ts b/src/commands/moulberry-bush/serverStatus.ts index 568dd38..6c3664e 100644 --- a/src/commands/moulberry-bush/serverStatus.ts +++ b/src/commands/moulberry-bush/serverStatus.ts @@ -1,6 +1,6 @@ +import { BushCommand, BushMessage } from '@lib'; import { MessageEmbed } from 'discord.js'; import got from 'got'; -import { BushCommand, BushMessage } from '../../lib'; export default class ServerStatusCommand extends BushCommand { public constructor() { diff --git a/src/commands/utilities/activity.ts b/src/commands/utilities/activity.ts index e2a3352..4066934 100644 --- a/src/commands/utilities/activity.ts +++ b/src/commands/utilities/activity.ts @@ -1,5 +1,5 @@ +import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; import { DiscordAPIError, Message, VoiceChannel } from 'discord.js'; -import { BushCommand, BushMessage, BushSlashMessage } from '../../lib'; const activityMap = { 'Poker Night': '755827207812677713', diff --git a/src/commands/utilities/hash.ts b/src/commands/utilities/hash.ts index df604c8..a8fdee1 100644 --- a/src/commands/utilities/hash.ts +++ b/src/commands/utilities/hash.ts @@ -1,6 +1,6 @@ +import { BushCommand, BushMessage } from '@lib'; import crypto from 'crypto'; import got from 'got'; -import { BushCommand, BushMessage } from '../../lib'; export default class HashCommand extends BushCommand { public constructor() { diff --git a/src/commands/utilities/price.ts b/src/commands/utilities/price.ts index be3da8e..4d21c02 100644 --- a/src/commands/utilities/price.ts +++ b/src/commands/utilities/price.ts @@ -1,7 +1,7 @@ +import { BushCommand, BushMessage } from '@lib'; import { CommandInteraction, MessageEmbed } from 'discord.js'; import Fuse from 'fuse.js'; import got from 'got'; -import { BushCommand, BushMessage } from '../../lib'; interface Summary { amount: number; diff --git a/src/commands/utilities/uuid.ts b/src/commands/utilities/uuid.ts index 9484729..823d1ff 100644 --- a/src/commands/utilities/uuid.ts +++ b/src/commands/utilities/uuid.ts @@ -1,4 +1,4 @@ -import { BushCommand, BushMessage } from '../../lib'; +import { BushCommand, 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 b7017c6..60529c5 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, BushMessage, BushSlashMessage } from '../../lib'; export default class ViewRawCommand extends BushCommand { public constructor() { diff --git a/src/commands/utilities/whoHasRole.ts b/src/commands/utilities/whoHasRole.ts index bce88d6..be27c7c 100644 --- a/src/commands/utilities/whoHasRole.ts +++ b/src/commands/utilities/whoHasRole.ts @@ -1,6 +1,5 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, BushMessage, BushSlashMessage, ButtonPaginator } from '@lib'; import { CommandInteraction, Role, Util } from 'discord.js'; -import { ButtonPaginator } from '../../lib/common/ButtonPaginator'; export default class WhoHasRoleCommand extends BushCommand { public constructor() { diff --git a/src/config/example-options.ts b/src/config/example-options.ts index 01519b2..f6b9dc1 100644 --- a/src/config/example-options.ts +++ b/src/config/example-options.ts @@ -1,4 +1,4 @@ -import { Config } from '../lib/utils/Config'; +import { Config } from '@lib'; export default new Config({ credentials: { diff --git a/src/context-menu-commands/message/viewRaw.ts b/src/context-menu-commands/message/viewRaw.ts index 77fd0b9..15d7582 100644 --- a/src/context-menu-commands/message/viewRaw.ts +++ b/src/context-menu-commands/message/viewRaw.ts @@ -1,7 +1,7 @@ +import { BushMessage } from '@lib'; import { ContextMenuCommand } from 'discord-akairo'; import { ContextMenuInteraction } from 'discord.js'; import ViewRawCommand from '../../commands/utilities/viewRaw'; -import { BushMessage } from '../../lib'; export default class ViewRawContextMenuCommand extends ContextMenuCommand { public constructor() { diff --git a/src/lib/common/ButtonPaginator.ts b/src/lib/common/ButtonPaginator.ts index 68955cc..6d4c49a 100644 --- a/src/lib/common/ButtonPaginator.ts +++ b/src/lib/common/ButtonPaginator.ts @@ -85,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)) + if (interaction.user.id !== this.message.author.id && !client.config.owners.includes(interaction.user.id)) return await interaction?.deferUpdate().catch(() => undefined); switch (interaction.customId) { @@ -118,12 +118,14 @@ export class ButtonPaginator { } protected async end() { - if (!this.deleteOnExit) - return await this.sentMessage!.edit({ - content: this.text, - embeds: [this.embeds[this.curPage]], - components: [this.getPaginationRow(true)] - }).catch(() => undefined); + if (this.sentMessage && !this.sentMessage.deleted) + return await this.sentMessage + .edit({ + content: this.text, + embeds: [this.embeds[this.curPage]], + components: [this.getPaginationRow(true)] + }) + .catch(() => undefined); } protected async edit(interaction: MessageComponentInteraction) { diff --git a/src/lib/extensions/discord-akairo/BushCommandUtil.ts b/src/lib/extensions/discord-akairo/BushCommandUtil.ts index bda0e74..7720d57 100644 --- a/src/lib/extensions/discord-akairo/BushCommandUtil.ts +++ b/src/lib/extensions/discord-akairo/BushCommandUtil.ts @@ -4,18 +4,19 @@ import { Collection } from 'discord.js'; import { BushMessage } from '../discord.js/BushMessage'; import { BushCommand } from './BushCommand'; import { BushCommandHandler } from './BushCommandHandler'; +import { BushSlashMessage } from './BushSlashMessage'; export interface BushParsedComponentData extends ParsedComponentData { command?: BushCommand; } -export class BushCommandUtil extends CommandUtil { +export class BushCommandUtil<BushMessageType extends BushMessage | BushSlashMessage> extends CommandUtil<BushMessageType> { public declare parsed: BushParsedComponentData | null; public declare handler: BushCommandHandler; - public declare message: BushMessage; + public declare message: BushMessageType; public declare messages: Collection<Snowflake, BushMessage> | null; - public constructor(handler: BushCommandHandler, message: BushMessage) { + public constructor(handler: BushCommandHandler, message: BushMessageType) { super(handler, message); } } diff --git a/src/lib/extensions/discord-akairo/BushSlashMessage.ts b/src/lib/extensions/discord-akairo/BushSlashMessage.ts index d75d0a7..b5e48ea 100644 --- a/src/lib/extensions/discord-akairo/BushSlashMessage.ts +++ b/src/lib/extensions/discord-akairo/BushSlashMessage.ts @@ -8,7 +8,7 @@ import { BushCommandUtil } from './BushCommandUtil'; export class BushSlashMessage extends AkairoMessage { public declare client: BushClient; - public declare util: BushCommandUtil; + public declare util: BushCommandUtil<BushSlashMessage>; public declare author: BushUser; public declare member: BushGuildMember | null; public constructor(client: BushClient, interaction: CommandInteraction) { diff --git a/src/lib/extensions/discord.js/BushClientEvents.d.ts b/src/lib/extensions/discord.js/BushClientEvents.d.ts index 4538fbb..b16f632 100644 --- a/src/lib/extensions/discord.js/BushClientEvents.d.ts +++ b/src/lib/extensions/discord.js/BushClientEvents.d.ts @@ -25,8 +25,8 @@ import { PartialBushMessageReaction, PartialBushUser } from '@lib'; +import { AkairoClientEvents } from 'discord-akairo'; import { - ClientEvents, Collection, Interaction, InvalidRequestWarningData, @@ -38,7 +38,7 @@ import { } from 'discord.js'; import { BushGuildBan } from './BushGuildBan'; -export interface BushClientEvents extends ClientEvents { +export interface BushClientEvents extends AkairoClientEvents { applicationCommandCreate: [command: BushApplicationCommand]; applicationCommandDelete: [command: BushApplicationCommand]; applicationCommandUpdate: [ diff --git a/src/lib/extensions/discord.js/BushMessage.ts b/src/lib/extensions/discord.js/BushMessage.ts index f2dd02c..4481910 100644 --- a/src/lib/extensions/discord.js/BushMessage.ts +++ b/src/lib/extensions/discord.js/BushMessage.ts @@ -13,7 +13,7 @@ export type PartialBushMessage = Partialize< >; export class BushMessage extends Message { public declare readonly client: BushClient; - public override util!: BushCommandUtil; + public override util!: BushCommandUtil<BushMessage>; public declare readonly guild: BushGuild | null; public declare readonly member: BushGuildMember | null; public declare author: BushUser; diff --git a/src/lib/index.ts b/src/lib/index.ts index 1e789e5..ec4dcb2 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1,3 +1,9 @@ +export * from './common/AutoMod'; +export * from './common/ButtonPaginator'; +export * from './common/DeleteButton'; +export * from './common/Format'; +export * from './common/Moderation'; +export * from './common/util/Arg'; export * from './extensions/discord-akairo/BushArgumentTypeCaster'; export * from './extensions/discord-akairo/BushClient'; export * from './extensions/discord-akairo/BushClientUtil'; @@ -13,16 +19,29 @@ export * from './extensions/discord-akairo/BushTask'; export * from './extensions/discord-akairo/BushTaskHandler'; export * from './extensions/discord.js/BushActivity'; export * from './extensions/discord.js/BushApplicationCommand'; +export type { BushApplicationCommandManager } from './extensions/discord.js/BushApplicationCommandManager'; +export type { BushApplicationCommandPermissionsManager } from './extensions/discord.js/BushApplicationCommandPermissionsManager'; +export type { BushBaseGuildEmojiManager } from './extensions/discord.js/BushBaseGuildEmojiManager'; export * from './extensions/discord.js/BushButtonInteraction'; export * from './extensions/discord.js/BushCategoryChannel'; +export type { BushChannel } from './extensions/discord.js/BushChannel'; +export type { BushChannelManager } from './extensions/discord.js/BushChannelManager'; +export type { BushClientEvents } from './extensions/discord.js/BushClientEvents'; +export type { BushClientUser } from './extensions/discord.js/BushClientUser'; export * from './extensions/discord.js/BushCommandInteraction'; export * from './extensions/discord.js/BushDMChannel'; export * from './extensions/discord.js/BushEmoji'; export * from './extensions/discord.js/BushGuild'; +export type { BushGuildApplicationCommandManager } from './extensions/discord.js/BushGuildApplicationCommandManager'; +export type { BushGuildBan } from './extensions/discord.js/BushGuildBan'; export * from './extensions/discord.js/BushGuildChannel'; export * from './extensions/discord.js/BushGuildEmoji'; +export type { BushGuildEmojiRoleManager } from './extensions/discord.js/BushGuildEmojiRoleManager'; +export type { BushGuildManager } from './extensions/discord.js/BushGuildManager'; export * from './extensions/discord.js/BushGuildMember'; +export type { BushGuildMemberManager } from './extensions/discord.js/BushGuildMemberManager'; export * from './extensions/discord.js/BushMessage'; +export type { BushMessageManager } from './extensions/discord.js/BushMessageManager'; export * from './extensions/discord.js/BushMessageReaction'; export * from './extensions/discord.js/BushNewsChannel'; export * from './extensions/discord.js/BushPresence'; @@ -34,8 +53,11 @@ export * from './extensions/discord.js/BushStageInstance'; export * from './extensions/discord.js/BushStoreChannel'; export * from './extensions/discord.js/BushTextChannel'; export * from './extensions/discord.js/BushThreadChannel'; +export type { BushThreadManager } from './extensions/discord.js/BushThreadManager'; export * from './extensions/discord.js/BushThreadMember'; +export type { BushThreadMemberManager } from './extensions/discord.js/BushThreadMemberManager'; export * from './extensions/discord.js/BushUser'; +export type { BushUserManager } from './extensions/discord.js/BushUserManager'; export * from './extensions/discord.js/BushVoiceChannel'; export * from './extensions/discord.js/BushVoiceState'; export * from './models/ActivePunishment'; @@ -44,9 +66,11 @@ export * from './models/Global'; export * from './models/Guild'; export * from './models/Level'; export * from './models/ModLog'; +export * from './models/Stat'; export * from './models/StickyRole'; export * from './utils/AllowedMentions'; export * from './utils/BushCache'; export * from './utils/BushConstants'; export * from './utils/BushLogger'; export * from './utils/CanvasProgressBar'; +export * from './utils/Config'; diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts index 3b41c4f..64208a1 100644 --- a/src/lib/utils/BushConstants.ts +++ b/src/lib/utils/BushConstants.ts @@ -71,6 +71,7 @@ export type Pronoun = | 'Ask me my pronouns' | 'Avoid pronouns, use my name'; +const rawCapeUrl = 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/'; export class BushConstants { public static emojis = { success: '<:success:837109864101707807>', @@ -340,44 +341,47 @@ export class BushConstants { maybeNitroDiscrims: ['1111', '2222', '3333', '4444', '5555', '6666', '6969', '7777', '8888', '9999'], - // prettier-ignore capes: [ /* supporter capes */ - { name: 'patreon1', index: 0, purchasable: true }, - { name: 'patreon2', index: 1, purchasable: true }, - { name: 'fade', custom: 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/fade.gif', index: 2, purchasable: true }, - { name: 'lava', custom: 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/lava.gif', index: 3, purchasable: true }, - { name: 'mcworld', custom: 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/mcworld_compressed.gif', index: 4, purchasable: true }, - { name: 'negative', custom: 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/negative_compressed.gif', index: 5, purchasable: true }, - { name: 'space', custom: 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/space_compressed.gif', index: 6, purchasable: true }, - { name: 'void', custom: 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/void.gif', index: 7, purchasable: true }, - { name: 'tunnel', custom: 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/tunnel.gif', index: 8, purchasable: true }, + { name: 'patreon1', purchasable: true }, + { name: 'patreon2', purchasable: true }, + { name: 'fade', custom: `${rawCapeUrl}fade.gif`, purchasable: true }, + { name: 'lava', custom: `${rawCapeUrl}lava.gif`, purchasable: true }, + { name: 'mcworld', custom: `${rawCapeUrl}mcworld_compressed.gif`, purchasable: true }, + { name: 'negative', custom: `${rawCapeUrl}negative_compressed.gif`, purchasable: true }, + { name: 'space', custom: `${rawCapeUrl}space_compressed.gif`, purchasable: true }, + { name: 'void', custom: `${rawCapeUrl}void.gif`, purchasable: true }, + { name: 'tunnel', custom: `${rawCapeUrl}tunnel.gif`, purchasable: true }, /* Staff capes */ - { name: 'contrib', index: 9 }, - { name: 'mbstaff', index: 10 }, - { name: 'ironmoon', index: 11 }, - { name: 'gravy', index: 12 }, - { name: 'nullzee', index: 13 }, + { name: 'contrib' }, + { name: 'mbstaff' }, + { name: 'ironmoon' }, + { name: 'gravy' }, + { name: 'nullzee' }, /* partner capes */ - { name: 'thebakery', index: 14 }, - { name: 'dsm', index: 15 }, - { name: 'packshq', index: 16 }, - { name: 'furf', index: 17 }, - { name: 'skytils', index: 18 }, - { name: 'sbp', index: 19 }, - { name: 'subreddit_light', index: 20 }, - { name: 'subreddit_dark', index: 21 }, - {name : 'skyclient', index: 22 }, + { name: 'thebakery' }, + { name: 'dsm' }, + { name: 'packshq' }, + { name: 'furf' }, + { name: 'skytils' }, + { name: 'sbp' }, + { name: 'subreddit_light' }, + { name: 'subreddit_dark' }, + { name: 'skyclient' }, + { name: 'sharex' }, + { name: 'sharex_white' }, /* streamer capes */ - { name: 'alexxoffi', index: 23 }, - { name: 'jakethybro', index: 24 }, - { name: 'krusty', index: 25 }, - { name: 'krusty_day', index: 26 }, - { name: 'krusty_night', index: 27 }, - { name: 'krusty_sunset', index: 28 }, - { name: 'soldier', index: 29 }, - { name: 'zera', index: 30 }, - ], + { name: 'alexxoffi' }, + { name: 'jakethybro' }, + { name: 'krusty' }, + { name: 'krusty_day' }, + { name: 'krusty_night' }, + { name: 'krusty_sunset' }, + { name: 'soldier' }, + { name: 'zera' }, + { name: 'secondpfirsisch' }, + { name: 'stormy_lh' } + ].map((value, index) => ({ ...value, index })), roleMap: [ { name: '*', id: '792453550768390194' }, { name: 'Admin Perms', id: '746541309853958186' }, diff --git a/src/listeners/client/interactionCreate.ts b/src/listeners/client/interactionCreate.ts index e2042d0..c2d12b2 100644 --- a/src/listeners/client/interactionCreate.ts +++ b/src/listeners/client/interactionCreate.ts @@ -1,6 +1,4 @@ -import { BushButtonInteraction, BushListener } from '@lib'; -import { AutoMod } from '../../lib/common/AutoMod'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; +import { AutoMod, BushButtonInteraction, BushClientEvents, BushListener } from '@lib'; export default class InteractionCreateListener extends BushListener { public constructor() { diff --git a/src/listeners/commands/commandCooldown.ts b/src/listeners/commands/commandCooldown.ts index 5cb3fa9..0ae886a 100644 --- a/src/listeners/commands/commandCooldown.ts +++ b/src/listeners/commands/commandCooldown.ts @@ -1,5 +1,5 @@ +import { BushCommandHandlerEvents, BushListener } from '@lib'; import { Message } from 'discord.js'; -import { BushCommandHandlerEvents, BushListener } from '../../lib'; export default class CommandCooldownListener extends BushListener { public constructor() { diff --git a/src/listeners/commands/commandError.ts b/src/listeners/commands/commandError.ts index 567cd27..fb1bebe 100644 --- a/src/listeners/commands/commandError.ts +++ b/src/listeners/commands/commandError.ts @@ -1,6 +1,6 @@ +import { BushCommandHandlerEvents } from '@lib'; import { AkairoMessage, Command, GuildTextBasedChannels } from 'discord-akairo'; import { DMChannel, Formatters, Message, MessageEmbed } from 'discord.js'; -import { BushCommandHandlerEvents } from '../../lib/extensions/discord-akairo/BushCommandHandler'; import { BushListener } from '../../lib/extensions/discord-akairo/BushListener'; export default class CommandErrorListener extends BushListener { diff --git a/src/listeners/commands/slashNotFound.ts b/src/listeners/commands/slashNotFound.ts index 118d549..2179c9b 100644 --- a/src/listeners/commands/slashNotFound.ts +++ b/src/listeners/commands/slashNotFound.ts @@ -1,4 +1,4 @@ -import { BushCommandHandlerEvents, BushListener } from '../../lib'; +import { BushCommandHandlerEvents, BushListener } from '@lib'; export default class SlashNotFoundListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushBan.ts b/src/listeners/custom/bushBan.ts index 9282ea5..09be0a0 100644 --- a/src/listeners/custom/bushBan.ts +++ b/src/listeners/custom/bushBan.ts @@ -1,6 +1,5 @@ -import { BushListener } from '@lib'; +import { BushClientEvents, BushListener } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushBanListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushKick.ts b/src/listeners/custom/bushKick.ts index cf7257f..8df354c 100644 --- a/src/listeners/custom/bushKick.ts +++ b/src/listeners/custom/bushKick.ts @@ -1,6 +1,5 @@ -import { BushListener } from '@lib'; +import { BushClientEvents, BushListener } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushKickListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushLevelUpdate.ts b/src/listeners/custom/bushLevelUpdate.ts index 006e57d..a4b999b 100644 --- a/src/listeners/custom/bushLevelUpdate.ts +++ b/src/listeners/custom/bushLevelUpdate.ts @@ -1,6 +1,5 @@ +import { BushClientEvents, BushListener } from '@lib'; import { Formatters, TextChannel } from 'discord.js'; -import { BushListener } from '../../lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushLevelUpdateListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushMute.ts b/src/listeners/custom/bushMute.ts index f9763c4..ad95cd6 100644 --- a/src/listeners/custom/bushMute.ts +++ b/src/listeners/custom/bushMute.ts @@ -1,6 +1,5 @@ -import { BushListener } from '@lib'; +import { BushClientEvents, BushListener } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushMuteListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushPunishRole.ts b/src/listeners/custom/bushPunishRole.ts index 2c004c0..943fce5 100644 --- a/src/listeners/custom/bushPunishRole.ts +++ b/src/listeners/custom/bushPunishRole.ts @@ -1,6 +1,5 @@ -import { BushListener } from '@lib'; +import { BushClientEvents, BushListener } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushPunishRoleListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushPunishRoleRemove.ts b/src/listeners/custom/bushPunishRoleRemove.ts index f5260fc..8c48e0e 100644 --- a/src/listeners/custom/bushPunishRoleRemove.ts +++ b/src/listeners/custom/bushPunishRoleRemove.ts @@ -1,6 +1,5 @@ -import { BushListener } from '@lib'; +import { BushClientEvents, BushListener } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushPunishRoleRemoveListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushPurge.ts b/src/listeners/custom/bushPurge.ts index 22de99c..7114f4f 100644 --- a/src/listeners/custom/bushPurge.ts +++ b/src/listeners/custom/bushPurge.ts @@ -1,6 +1,5 @@ -import { BushListener } from '@lib'; +import { BushClientEvents, BushListener } from '@lib'; import { MessageEmbed } from 'discord.js'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushPurgeListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushUnban.ts b/src/listeners/custom/bushUnban.ts index c20b686..59b0fc9 100644 --- a/src/listeners/custom/bushUnban.ts +++ b/src/listeners/custom/bushUnban.ts @@ -1,6 +1,5 @@ -import { BushListener } from '@lib'; +import { BushClientEvents, BushListener } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushUnbanListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushUnmute.ts b/src/listeners/custom/bushUnmute.ts index 795f948..ba1042b 100644 --- a/src/listeners/custom/bushUnmute.ts +++ b/src/listeners/custom/bushUnmute.ts @@ -1,6 +1,5 @@ -import { BushListener } from '@lib'; +import { BushClientEvents, BushListener } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushUnmuteListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushUpdateModlog.ts b/src/listeners/custom/bushUpdateModlog.ts index 16e0dbf..d51696a 100644 --- a/src/listeners/custom/bushUpdateModlog.ts +++ b/src/listeners/custom/bushUpdateModlog.ts @@ -1,6 +1,5 @@ -import { BushListener } from '@lib'; +import { BushClientEvents, BushListener } from '@lib'; import { MessageEmbed } from 'discord.js'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushUpdateModlogListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushUpdateSettings.ts b/src/listeners/custom/bushUpdateSettings.ts index eae3062..39638cc 100644 --- a/src/listeners/custom/bushUpdateSettings.ts +++ b/src/listeners/custom/bushUpdateSettings.ts @@ -1,6 +1,5 @@ -import { BushListener } from '@lib'; +import { BushClientEvents, BushListener } from '@lib'; import { MessageEmbed } from 'discord.js'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushUpdateSettingsListener extends BushListener { public constructor() { diff --git a/src/listeners/custom/bushWarn.ts b/src/listeners/custom/bushWarn.ts index 2e72e52..16c1d1e 100644 --- a/src/listeners/custom/bushWarn.ts +++ b/src/listeners/custom/bushWarn.ts @@ -1,6 +1,5 @@ -import { BushListener } from '@lib'; +import { BushClientEvents, BushListener } from '@lib'; import { GuildMember, MessageEmbed } from 'discord.js'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BushWarnListener extends BushListener { public constructor() { diff --git a/src/listeners/guild/guildCreate.ts b/src/listeners/guild/guildCreate.ts index 64e5285..62149c3 100644 --- a/src/listeners/guild/guildCreate.ts +++ b/src/listeners/guild/guildCreate.ts @@ -1,5 +1,4 @@ -import { BushListener, Guild } from '../../lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; +import { BushClientEvents, BushListener, Guild } 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 e260a63..4db092b 100644 --- a/src/listeners/guild/guildDelete.ts +++ b/src/listeners/guild/guildDelete.ts @@ -1,5 +1,4 @@ -import { BushListener } from '../../lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; +import { BushClientEvents, BushListener } 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 cb8057f..867101b 100644 --- a/src/listeners/guild/guildMemberAdd.ts +++ b/src/listeners/guild/guildMemberAdd.ts @@ -1,6 +1,5 @@ +import { BushClientEvents, BushGuildMember, BushListener, BushTextChannel, StickyRole } from '@lib'; import { MessageEmbed, Snowflake, Util } from 'discord.js'; -import { BushGuildMember, BushListener, BushTextChannel, StickyRole } from '../../lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class GuildMemberAddListener extends BushListener { public constructor() { diff --git a/src/listeners/guild/guildMemberRemove.ts b/src/listeners/guild/guildMemberRemove.ts index 5f13f22..ff8d2ac 100644 --- a/src/listeners/guild/guildMemberRemove.ts +++ b/src/listeners/guild/guildMemberRemove.ts @@ -1,6 +1,5 @@ +import { BushClientEvents, BushGuildMember, BushListener, BushTextChannel, PartialBushGuildMember, StickyRole } from '@lib'; import { MessageEmbed, Util } from 'discord.js'; -import { BushGuildMember, BushListener, BushTextChannel, PartialBushGuildMember, StickyRole } from '../../lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class GuildMemberRemoveListener extends BushListener { public constructor() { diff --git a/src/listeners/guild/syncUnban.ts b/src/listeners/guild/syncUnban.ts index 9a6a607..48f068f 100644 --- a/src/listeners/guild/syncUnban.ts +++ b/src/listeners/guild/syncUnban.ts @@ -1,5 +1,4 @@ -import { ActivePunishment, ActivePunishmentType, BushListener } from '@lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; +import { ActivePunishment, ActivePunishmentType, BushClientEvents, BushListener } 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 3a7bbb7..aa91f5d 100644 --- a/src/listeners/message/autoPublisher.ts +++ b/src/listeners/message/autoPublisher.ts @@ -1,5 +1,4 @@ -import { BushListener } from '../../lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; +import { BushClientEvents, BushListener } 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 8f2c4eb..319b214 100644 --- a/src/listeners/message/autoThread.ts +++ b/src/listeners/message/autoThread.ts @@ -1,7 +1,6 @@ +import { BushClientEvents, BushListener, BushTextChannel } from '@lib'; import { GuildTextBasedChannels } from 'discord-akairo'; import { MessageEmbed } from 'discord.js'; -import { BushListener, BushTextChannel } from '../../lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class autoThreadListener extends BushListener { public constructor() { diff --git a/src/listeners/message/automodCreate.ts b/src/listeners/message/automodCreate.ts index 8857aee..9619cf8 100644 --- a/src/listeners/message/automodCreate.ts +++ b/src/listeners/message/automodCreate.ts @@ -1,6 +1,4 @@ -import { BushListener } from '@lib'; -import { AutoMod } from '../../lib/common/AutoMod'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; +import { AutoMod, BushClientEvents, BushListener } 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 9464890..18fbb2e 100644 --- a/src/listeners/message/automodUpdate.ts +++ b/src/listeners/message/automodUpdate.ts @@ -1,6 +1,4 @@ -import { BushListener, BushMessage } from '@lib'; -import { AutoMod } from '../../lib/common/AutoMod'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; +import { AutoMod, BushClientEvents, BushListener, 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 e0e3d19..dd72d88 100644 --- a/src/listeners/message/blacklistedFile.ts +++ b/src/listeners/message/blacklistedFile.ts @@ -1,7 +1,6 @@ +import { BushClientEvents, BushListener } from '@lib'; import crypto from 'crypto'; import got from 'got'; -import { BushListener } from '../../lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BlacklistedFileListener extends BushListener { #blacklistedFiles: { hash: string[]; name: string; description: string }[] = [ diff --git a/src/listeners/message/boosterMessage.ts b/src/listeners/message/boosterMessage.ts index 6ab12d5..cb595d4 100644 --- a/src/listeners/message/boosterMessage.ts +++ b/src/listeners/message/boosterMessage.ts @@ -1,5 +1,4 @@ -import { BushListener } from '../../lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; +import { BushClientEvents, BushListener } 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 fd1533a..f0cb532 100644 --- a/src/listeners/message/directMessage.ts +++ b/src/listeners/message/directMessage.ts @@ -1,6 +1,5 @@ +import { BushClientEvents, BushListener } from '@lib'; import { MessageEmbed } from 'discord.js'; -import { BushListener } from '../../lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class DirectMessageListener extends BushListener { public constructor() { diff --git a/src/listeners/message/verbose.ts b/src/listeners/message/verbose.ts index b6085fb..8214471 100644 --- a/src/listeners/message/verbose.ts +++ b/src/listeners/message/verbose.ts @@ -1,5 +1,4 @@ -import { BushListener } from '../../lib'; -import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; +import { BushClientEvents, BushListener } from '@lib'; export default class MessageVerboseListener extends BushListener { public constructor() { diff --git a/src/tasks/removeExpiredPunishements.ts b/src/tasks/removeExpiredPunishements.ts index 0610718..a5f9d73 100644 --- a/src/tasks/removeExpiredPunishements.ts +++ b/src/tasks/removeExpiredPunishements.ts @@ -1,6 +1,5 @@ -import { BushGuild, BushTask, BushUser } from '@lib'; +import { ActivePunishment, ActivePunishmentType, BushGuild, BushTask, BushUser } from '@lib'; import { Op } from 'sequelize'; -import { ActivePunishment, ActivePunishmentType } from '../lib/models/ActivePunishment'; export default class RemoveExpiredPunishmentsTask extends BushTask { public constructor() { diff --git a/src/tasks/updateCache.ts b/src/tasks/updateCache.ts index e9d0cc6..b8df336 100644 --- a/src/tasks/updateCache.ts +++ b/src/tasks/updateCache.ts @@ -1,7 +1,5 @@ -import { BushClient } from '../lib/extensions/discord-akairo/BushClient'; +import { BushClient, Global, Guild } from '@lib'; import { BushTask } from '../lib/extensions/discord-akairo/BushTask'; -import { Global } from '../lib/models/Global'; -import { Guild } from '../lib/models/Guild'; import config from './../config/options'; export default class UpdateCacheTask extends BushTask { diff --git a/src/tasks/updateStats.ts b/src/tasks/updateStats.ts index 7b0690f..74a8114 100644 --- a/src/tasks/updateStats.ts +++ b/src/tasks/updateStats.ts @@ -1,5 +1,5 @@ +import { Stat } from '@lib'; import { BushTask } from '../lib/extensions/discord-akairo/BushTask'; -import { Stat } from '../lib/models/Stat'; export default class UpdateStatsTask extends BushTask { public constructor() { |