diff options
-rw-r--r-- | .vscode/settings.json | 2 | ||||
-rw-r--r-- | package.json | 18 | ||||
-rw-r--r-- | src/lib/common/ButtonPaginator.ts | 130 | ||||
-rw-r--r-- | src/lib/common/DeleteButton.ts | 41 | ||||
-rw-r--r-- | src/lib/common/util/Format.ts | 107 | ||||
-rw-r--r-- | src/lib/extensions/discord-akairo/BushClient.ts | 49 | ||||
-rw-r--r-- | src/lib/extensions/discord-akairo/BushCommand.ts | 13 | ||||
-rw-r--r-- | src/lib/extensions/discord.js/BushGuildChannelManager.d.ts | 123 | ||||
-rw-r--r-- | src/lib/extensions/discord.js/BushMessage.ts | 28 | ||||
-rw-r--r-- | src/lib/extensions/discord.js/other.ts | 159 | ||||
-rw-r--r-- | src/listeners/message/blacklistedFile.ts | 3 | ||||
-rw-r--r-- | yarn.lock | 187 |
12 files changed, 658 insertions, 202 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json index b6f5614..a0c5a18 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -91,5 +91,5 @@ "bold": false, "italic": false } - ], + ] }
\ No newline at end of file diff --git a/package.json b/package.json index a14756f..88727d5 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "format:check": "yarn prettier . --check", "upgrade": "yarn rimraf yarn.lock && yarn cache clean && yarn install && yarn up && yarn up -R && yarn set version latest", "upgrade:sdk": "yarn dlx @yarnpkg/sdks vscode", - "upgrade:manual": "yarn add @notenoughupdates/discord.js-minesweeper @notenoughupdates/events-intercept @notenoughupdates/humanize-duration @notenoughupdates/simplify-number @notenoughupdates/wolfram-alpha-api @sentry/integrations @sentry/node @sentry/tracing canvas deep-lock chalk discord-akairo@npm:@notenoughupdates/discord-akairo@dev discord.js@npm:@notenoughupdates/discord.js@dev fuse.js got lodash mathjs moment nanoid node-os-utils numeral pg pg-hstore prettier pretty-bytes rimraf sequelize source-map-support tinycolor2 tslib typescript vm2 && yarn add --dev @types/express @types/lodash @types/node @types/node-os-utils @types/numeral @types/tinycolor2 @types/validator @typescript-eslint/eslint-plugin @typescript-eslint/parser discord-api-types@0.25.2 eslint eslint-config-prettier", + "upgrade:manual": "yarn add @notenoughupdates/discord.js-minesweeper @notenoughupdates/events-intercept @notenoughupdates/humanize-duration @notenoughupdates/simplify-number @notenoughupdates/wolfram-alpha-api @sentry/integrations @sentry/node @sentry/tracing canvas deep-lock chalk discord-akairo@npm:@notenoughupdates/discord-akairo@dev discord.js@npm:@notenoughupdates/discord.js@dev fuse.js got lodash mathjs moment nanoid node-os-utils numeral pg pg-hstore prettier pretty-bytes rimraf sequelize source-map-support tinycolor2 tslib typescript vm2 && yarn add --dev @types/express @types/lodash @types/node @types/node-os-utils @types/numeral @types/tinycolor2 @types/validator @typescript-eslint/eslint-plugin @typescript-eslint/parser discord-api-types@0.26.0 eslint eslint-config-prettier", "upgrade:package": "powershell -c \"yarn info --name-only | %{\\$_ -replace '^(?:├─ |└─ )?(@?[a-z0-9-~][a-z0-9-._~/]{0,}(?=.*(npm:(?!.*dev)|patch:.*?@npm).*))|.*\\$','\\$1'} | where{[string]::IsNullOrEmpty(\\$_) -eq \\$false} | yarn add\"", "beta": "git push && git checkout beta && git merge master && git push && git checkout master", "deploy:beta": "pm2 deploy ecosystem.config.cjs beta", @@ -62,10 +62,10 @@ "deep-lock": "^1.0.0", "discord-akairo": "npm:@notenoughupdates/discord-akairo@dev", "discord.js": "npm:@notenoughupdates/discord.js@dev", - "fuse.js": "^6.4.6", + "fuse.js": "^6.5.3", "got": "^12.0.0", "lodash": "^4.17.21", - "mathjs": "^10.0.0", + "mathjs": "^10.0.2", "moment": "^2.29.1", "nanoid": "^3.1.30", "node-os-utils": "^1.3.5", @@ -75,7 +75,7 @@ "prettier": "^2.5.1", "pretty-bytes": "^5.6.0", "rimraf": "^3.0.2", - "sequelize": "v6.12.0-beta.3", + "sequelize": "^6.12.4", "source-map-support": "^0.5.21", "tinycolor2": "^1.4.2", "tslib": "^2.3.1", @@ -86,7 +86,7 @@ "@types/eslint": "^8", "@types/express": "^4.17.13", "@types/lodash": "^4.14.178", - "@types/node": "^17.0.2", + "@types/node": "^17.0.5", "@types/node-os-utils": "^1.2.0", "@types/numeral": "^2.0.2", "@types/pg": "^8", @@ -94,10 +94,10 @@ "@types/rimraf": "^3", "@types/source-map-support": "^0", "@types/tinycolor2": "^1.4.3", - "@types/validator": "^13.7.0", - "@typescript-eslint/eslint-plugin": "^5.8.0", - "@typescript-eslint/parser": "^5.8.0", - "discord-api-types": "0.25.2", + "@types/validator": "^13.7.1", + "@typescript-eslint/eslint-plugin": "^5.8.1", + "@typescript-eslint/parser": "^5.8.1", + "discord-api-types": "0.26.0", "eslint": "^8.5.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-deprecation": "^1.3.2" diff --git a/src/lib/common/ButtonPaginator.ts b/src/lib/common/ButtonPaginator.ts index d193b4d..83f4219 100644 --- a/src/lib/common/ButtonPaginator.ts +++ b/src/lib/common/ButtonPaginator.ts @@ -1,50 +1,55 @@ import { DeleteButton, type BushMessage, type BushSlashMessage } from '#lib'; import { CommandUtil } from 'discord-akairo'; import { - Constants, MessageActionRow, MessageButton, MessageEmbed, type MessageComponentInteraction, type MessageEmbedOptions } from 'discord.js'; +import { MessageButtonStyles } from 'discord.js/typings/enums'; +/** + * Sends multiple embeds with controls to switch between them + */ export class ButtonPaginator { + /** + * The message that triggered the command + */ protected message: BushMessage | BushSlashMessage; + + /** + * The embeds to paginate + */ protected embeds: MessageEmbed[] | MessageEmbedOptions[]; + + /** + * The optional text to send with the paginator + */ protected text: string | null; + + /** + * Whether the paginator message gets deleted when the exit button is pressed + */ protected deleteOnExit: boolean; + + /** + * The current page of the paginator + */ protected curPage: number; + + /** + * The paginator message + */ protected sentMessage: BushMessage | undefined; /** - * Sends multiple embeds with controls to switch between them * @param message The message to respond to * @param embeds The embeds to switch between * @param text The text send with the embeds (optional) * @param deleteOnExit Whether to delete the message when the exit button is clicked (defaults to true) * @param startOn The page to start from (**not** the index) */ - public static async send( - message: BushMessage | BushSlashMessage, - embeds: MessageEmbed[] | MessageEmbedOptions[], - text: string | null = null, - deleteOnExit = true, - startOn = 1 - ) { - // no need to paginate if there is only one page - if (embeds.length === 1) return DeleteButton.send(message, { embeds: embeds }); - - return await new ButtonPaginator(message, embeds, text, deleteOnExit, startOn).send(); - } - - /** - * The number of pages in the paginator - */ - protected get numPages(): number { - return this.embeds.length; - } - protected constructor( message: BushMessage | BushSlashMessage, embeds: MessageEmbed[] | MessageEmbedOptions[], @@ -62,7 +67,7 @@ export class ButtonPaginator { // add footers for (let i = 0; i < embeds.length; i++) { if (embeds[i] instanceof MessageEmbed) { - (embeds[i] as MessageEmbed).setFooter(`Page ${(i + 1).toLocaleString()}/${embeds.length.toLocaleString()}`); + (embeds[i] as MessageEmbed).setFooter({ text: `Page ${(i + 1).toLocaleString()}/${embeds.length.toLocaleString()}` }); } else { (embeds[i] as MessageEmbedOptions).footer = { text: `Page ${(i + 1).toLocaleString()}/${embeds.length.toLocaleString()}` @@ -71,6 +76,16 @@ export class ButtonPaginator { } } + /** + * The number of pages in the paginator + */ + protected get numPages(): number { + return this.embeds.length; + } + + /** + * Sends the paginator message + */ protected async send() { this.sentMessage = (await this.message.util.reply({ content: this.text, @@ -87,6 +102,10 @@ export class ButtonPaginator { collector.on('end', () => void this.end()); } + /** + * Handles interactions with the paginator + * @param interaction The interaction received + */ 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(() => null); @@ -94,35 +113,44 @@ export class ButtonPaginator { switch (interaction.customId) { case 'paginate_beginning': this.curPage = 0; - return this.edit(interaction); + await this.edit(interaction); + break; case 'paginate_back': this.curPage--; - return await this.edit(interaction); + await this.edit(interaction); + break; case 'paginate_stop': if (this.deleteOnExit) { await interaction.deferUpdate().catch(() => null); - return await this.sentMessage!.delete().catch(() => null); + await this.sentMessage!.delete().catch(() => null); + break; } else { - return await interaction + await interaction ?.update({ content: `${this.text ? `${this.text}\n` : ''}Command closed by user.`, embeds: [], components: [] }) .catch(() => null); + break; } case 'paginate_next': this.curPage++; - return await this.edit(interaction); + await this.edit(interaction); + break; case 'paginate_end': this.curPage = this.embeds.length - 1; - return await this.edit(interaction); + await this.edit(interaction); + break; } } + /** + * Ends the paginator + */ protected async end() { if (this.sentMessage && !CommandUtil.deletedMessages.has(this.sentMessage.id)) - return await this.sentMessage + await this.sentMessage .edit({ content: this.text, embeds: [this.embeds[this.curPage]], @@ -131,8 +159,12 @@ export class ButtonPaginator { .catch(() => null); } + /** + * Edits the paginator message + * @param interaction The interaction received + */ protected async edit(interaction: MessageComponentInteraction) { - return interaction + await interaction ?.update({ content: this.text, embeds: [this.embeds[this.curPage]], @@ -141,40 +173,66 @@ export class ButtonPaginator { .catch(() => null); } + /** + * Generates the pagination row based on the class properties + * @param disableAll Whether to disable all buttons + * @returns The generated {@link MessageActionRow} + */ protected getPaginationRow(disableAll = false): MessageActionRow { return new MessageActionRow().addComponents( new MessageButton({ - style: Constants.MessageButtonStyles.PRIMARY, + style: MessageButtonStyles.PRIMARY, customId: 'paginate_beginning', emoji: PaginateEmojis.BEGGING, disabled: disableAll || this.curPage === 0 }), new MessageButton({ - style: Constants.MessageButtonStyles.PRIMARY, + style: MessageButtonStyles.PRIMARY, customId: 'paginate_back', emoji: PaginateEmojis.BACK, disabled: disableAll || this.curPage === 0 }), new MessageButton({ - style: Constants.MessageButtonStyles.PRIMARY, + style: MessageButtonStyles.PRIMARY, customId: 'paginate_stop', emoji: PaginateEmojis.STOP, disabled: disableAll }), new MessageButton({ - style: Constants.MessageButtonStyles.PRIMARY, + style: MessageButtonStyles.PRIMARY, customId: 'paginate_next', emoji: PaginateEmojis.FORWARD, disabled: disableAll || this.curPage === this.numPages - 1 }), new MessageButton({ - style: Constants.MessageButtonStyles.PRIMARY, + style: MessageButtonStyles.PRIMARY, customId: 'paginate_end', emoji: PaginateEmojis.END, disabled: disableAll || this.curPage === this.numPages - 1 }) ); } + + /** + * Sends multiple embeds with controls to switch between them + * @param message The message to respond to + * @param embeds The embeds to switch between + * @param text The text send with the embeds (optional) + * @param deleteOnExit Whether to delete the message when the exit button is clicked (defaults to true) + * @param startOn The page to start from (**not** the index) + */ + public static async send( + message: BushMessage | BushSlashMessage, + embeds: MessageEmbed[] | MessageEmbedOptions[], + text: string | null = null, + deleteOnExit = true, + startOn = 1 + ) { + // no need to paginate if there is only one page + if (embeds.length === 1) return DeleteButton.send(message, { embeds: embeds }); + + return await new ButtonPaginator(message, embeds, text, deleteOnExit, startOn).send(); + } } export const enum PaginateEmojis { diff --git a/src/lib/common/DeleteButton.ts b/src/lib/common/DeleteButton.ts index e2509a9..b666a4f 100644 --- a/src/lib/common/DeleteButton.ts +++ b/src/lib/common/DeleteButton.ts @@ -1,25 +1,34 @@ import { PaginateEmojis, type BushMessage, type BushSlashMessage } from '#lib'; import { CommandUtil } from 'discord-akairo'; -import { Constants, MessageActionRow, MessageButton, type MessageComponentInteraction, type MessageOptions } from 'discord.js'; +import { MessageActionRow, MessageButton, type MessageComponentInteraction, type MessageOptions } from 'discord.js'; +import { MessageButtonStyles } from 'discord.js/typings/enums'; +/** + * Sends a message with a button for the user to delete it. + */ export class DeleteButton { + /** + * Options for sending the message + */ protected messageOptions: MessageOptions; - protected message: BushMessage | BushSlashMessage; /** - * Sends a message with a button for the user to delete it. - * @param message - The message to respond to - * @param options - The send message options + * The message that triggered the command */ - static async send(message: BushMessage | BushSlashMessage, options: Omit<MessageOptions, 'components'>) { - return new DeleteButton(message, options).send(); - } + protected message: BushMessage | BushSlashMessage; + /** + * @param message The message to respond to + * @param options The send message options + */ protected constructor(message: BushMessage | BushSlashMessage, options: MessageOptions) { this.message = message; this.messageOptions = options; } + /** + * Sends a message with a button for the user to delete it. + */ protected async send() { this.updateComponents(); @@ -43,11 +52,16 @@ export class DeleteButton { }); } + /** + * Generates the components for the message + * @param edit Whether or not the message is being edited + * @param disable Whether or not to disable the buttons + */ protected updateComponents(edit = false, disable = false): void { this.messageOptions.components = [ new MessageActionRow().addComponents( new MessageButton({ - style: Constants.MessageButtonStyles.PRIMARY, + style: MessageButtonStyles.PRIMARY, customId: 'paginate__stop', emoji: PaginateEmojis.STOP, disabled: disable @@ -58,4 +72,13 @@ export class DeleteButton { this.messageOptions.reply = undefined; } } + + /** + * Sends a message with a button for the user to delete it. + * @param message The message to respond to + * @param options The send message options + */ + public static async send(message: BushMessage | BushSlashMessage, options: Omit<MessageOptions, 'components'>) { + return new DeleteButton(message, options).send(); + } } diff --git a/src/lib/common/util/Format.ts b/src/lib/common/util/Format.ts new file mode 100644 index 0000000..6cb6edc --- /dev/null +++ b/src/lib/common/util/Format.ts @@ -0,0 +1,107 @@ +import { type CodeBlockLang } from '#lib'; +import { EscapeMarkdownOptions, Formatters, Util } from 'discord.js'; + +/** + * Formats and escapes content for formatting + */ +export class Format { + /** + * Wraps the content inside a codeblock with no language. + * @param content The content to wrap. + */ + public static codeBlock(content: string): string; + + /** + * Wraps the content inside a codeblock with the specified language. + * @param language The language for the codeblock. + * @param content The content to wrap. + */ + public static codeBlock(language: CodeBlockLang, content: string): string; + public static codeBlock(languageOrContent: string, content?: string): string { + return typeof content === 'undefined' + ? Formatters.codeBlock(Util.escapeCodeBlock(`${languageOrContent}`)) + : Formatters.codeBlock(`${languageOrContent}`, Util.escapeCodeBlock(`${content}`)); + } + + /** + * Wraps the content inside \`backticks\`, which formats it as inline code. + * @param content The content to wrap. + */ + public static inlineCode(content: string): string { + return Formatters.inlineCode(Util.escapeInlineCode(`${content}`)); + } + + /** + * Formats the content into italic text. + * @param content The content to wrap. + */ + public static italic(content: string): string { + return Formatters.italic(Util.escapeItalic(`${content}`)); + } + + /** + * Formats the content into bold text. + * @param content The content to wrap. + */ + public static bold(content: string): string { + return Formatters.bold(Util.escapeBold(`${content}`)); + } + + /** + * Formats the content into underscored text. + * @param content The content to wrap. + */ + public static underscore(content: string): string { + return Formatters.underscore(Util.escapeUnderline(`${content}`)); + } + + /** + * Formats the content into strike-through text. + * @param content The content to wrap. + */ + public static strikethrough(content: string): string { + return Formatters.strikethrough(Util.escapeStrikethrough(`${content}`)); + } + + /** + * Wraps the content inside spoiler (hidden text). + * @param content The content to wrap. + */ + public static spoiler(content: string): string { + return Formatters.spoiler(Util.escapeSpoiler(`${content}`)); + } + + /** + * Escapes any Discord-flavour markdown in a string. + * @param text Content to escape + * @param options Options for escaping the markdown + */ + public static escapeMarkdown(text: string, options?: EscapeMarkdownOptions): string { + return Util.escapeMarkdown(`${text}`, options); + } + + /** + * Formats input: makes it bold and escapes any other markdown + * @param text The input + */ + public static input(text: string): string { + return this.bold(this.escapeMarkdown(this.sanitizeWtlAndControl(`${text}`))); + } + + /** + * Formats input for logs: makes it highlighted + * @param text The input + */ + public static inputLog(text: string): string { + return `<<${this.sanitizeWtlAndControl(`${text}`)}>>`; + } + + /** + * Removes all characters in a string that are either control characters or change the direction of text etc. + * @param str The string you would like sanitized + */ + public static sanitizeWtlAndControl(str: string) { + // eslint-disable-next-line no-control-regex + return `${str}`.replace(/[\u0000-\u001F\u007F-\u009F\u200B]/g, ''); + } +} diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts index 7321c17..706b52a 100644 --- a/src/lib/extensions/discord-akairo/BushClient.ts +++ b/src/lib/extensions/discord-akairo/BushClient.ts @@ -11,33 +11,30 @@ import { snowflake } from '#args'; import type { - BushApplicationCommand, BushBaseGuildEmojiManager, BushChannelManager, BushClientEvents, BushClientUser, BushGuildManager, - BushReactionEmoji, - BushStageChannel, BushUserManager, + BushUserResolvable, Config } from '#lib'; -import { patch, PatchedElements } from '@notenoughupdates/events-intercept'; +import { patch, type PatchedElements } from '@notenoughupdates/events-intercept'; import * as Sentry from '@sentry/node'; import { AkairoClient, ContextMenuCommandHandler, version as akairoVersion } from 'discord-akairo'; import { - Awaitable, Intents, Options, Structures, version as discordJsVersion, - type Collection, + type Awaitable, + type If, type InteractionReplyOptions, type Message, type MessageEditOptions, type MessageOptions, type MessagePayload, - type PartialDMChannel, type ReplyMessageOptions, type Snowflake, type WebhookEditMessageOptions @@ -93,42 +90,6 @@ export type BushEditMessageType = string | MessageEditOptions | MessagePayload; export type BushSlashSendMessageType = string | MessagePayload | InteractionReplyOptions; export type BushSlashEditMessageType = string | MessagePayload | WebhookEditMessageOptions; export type BushSendMessageType = string | MessagePayload | MessageOptions; -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 = Message | BushMessage | Snowflake; -export type BushEmojiResolvable = Snowflake | BushGuildEmoji | BushReactionEmoji; -export type BushEmojiIdentifierResolvable = string | BushEmojiResolvable; -export type BushThreadChannelResolvable = BushThreadChannel | Snowflake; -export type BushApplicationCommandResolvable = BushApplicationCommand | Snowflake; -export type BushGuildTextChannelResolvable = BushTextChannel | BushNewsChannel | Snowflake; -export type BushChannelResolvable = BushAnyChannel | Snowflake; -export type BushGuildChannelResolvable = Snowflake | BushGuildBasedChannel; -export type BushAnyChannel = - | BushCategoryChannel - | BushDMChannel - | PartialDMChannel - | BushNewsChannel - | BushStageChannel - // eslint-disable-next-line deprecation/deprecation - | BushStoreChannel - | BushTextChannel - | BushThreadChannel - | BushVoiceChannel; -export type BushTextBasedChannel = PartialDMChannel | BushThreadChannel | BushDMChannel | BushNewsChannel | BushTextChannel; -export type BushTextBasedChannelTypes = BushTextBasedChannel['type']; -export type BushVoiceBasedChannel = Extract<BushAnyChannel, { bitrate: number }>; -export type BushGuildBasedChannel = Extract<BushAnyChannel, { guild: BushGuild }>; -export type BushNonThreadGuildBasedChannel = Exclude<BushGuildBasedChannel, BushThreadChannel>; -export type BushGuildTextBasedChannel = Extract<BushGuildBasedChannel, BushTextBasedChannel>; -export type BushTextChannelResolvable = Snowflake | BushTextChannel; -export type BushGuildVoiceChannelResolvable = BushVoiceBasedChannel | Snowflake; - -export interface BushFetchedThreads { - threads: Collection<Snowflake, BushThreadChannel>; - hasMore?: boolean; -} const rl = readline.createInterface({ input: process.stdin, @@ -136,8 +97,6 @@ const rl = readline.createInterface({ terminal: false }); -type If<T extends boolean, A, B = null> = T extends true ? A : T extends false ? B : A | B; - const __dirname = path.dirname(fileURLToPath(import.meta.url)); /** diff --git a/src/lib/extensions/discord-akairo/BushCommand.ts b/src/lib/extensions/discord-akairo/BushCommand.ts index 0d0a0a8..c37a55f 100644 --- a/src/lib/extensions/discord-akairo/BushCommand.ts +++ b/src/lib/extensions/discord-akairo/BushCommand.ts @@ -511,6 +511,11 @@ export interface BushCommand extends Command { * @param args - Evaluated arguments. */ exec<R, A>(message: BushMessage, args: A): R; + /** + * Executes the command. + * @param message - Message that triggered the command. + * @param args - Evaluated arguments. + */ exec<R, A>(message: BushMessage | BushSlashMessage, args: A): R; } @@ -523,5 +528,9 @@ type SlashOptionKeys = | keyof AkairoApplicationCommandNumericOptionData | keyof AkairoApplicationCommandSubCommandData; -export type ArgType<T extends keyof BaseBushArgumentType> = NonNullable<BaseBushArgumentType[T]>; -export type OptionalArgType<T extends keyof BaseBushArgumentType> = BaseBushArgumentType[T]; +interface PseudoArguments extends BaseBushArgumentType { + boolean: boolean; +} + +export type ArgType<T extends keyof PseudoArguments> = NonNullable<PseudoArguments[T]>; +export type OptionalArgType<T extends keyof PseudoArguments> = PseudoArguments[T]; diff --git a/src/lib/extensions/discord.js/BushGuildChannelManager.d.ts b/src/lib/extensions/discord.js/BushGuildChannelManager.d.ts new file mode 100644 index 0000000..3b07145 --- /dev/null +++ b/src/lib/extensions/discord.js/BushGuildChannelManager.d.ts @@ -0,0 +1,123 @@ +import type { + BushFetchedThreads, + BushGuild, + BushMappedGuildChannelTypes, + BushNonThreadGuildBasedChannel, + BushStoreChannel +} from '#lib'; +import { + CachedManager, + type BaseFetchOptions, + type ChannelPosition, + type Collection, + type GuildBasedChannel, + type GuildChannelCreateOptions, + type GuildChannelManager, + type GuildChannelResolvable, + type GuildChannelTypes, + type Snowflake +} from 'discord.js'; +import type { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; + +/** + * Manages API methods for GuildChannels and stores their cache. + */ +export class BushGuildChannelManager + extends CachedManager<Snowflake, GuildBasedChannel, GuildChannelResolvable> + implements GuildChannelManager +{ + public constructor(guild: BushGuild, iterable?: Iterable<RawGuildChannelData>); + + /** + * The number of channels in this managers cache excluding thread channels + * that do not count towards a guild's maximum channels restriction. + */ + public readonly channelCountWithoutThreads: number; + + /** + * The guild this Manager belongs to + */ + public guild: BushGuild; + + /** + * Creates a new channel in the guild. + * @param name The name of the new channel + * @param options Options for creating the new channel + * @example + * // Create a new text channel + * guild.channels.create('new-general', { reason: 'Needed a cool new channel' }) + * .then(console.log) + * .catch(console.error); + * @example + * // Create a new channel with permission overwrites + * guild.channels.create('new-voice', { + * type: 'GUILD_VOICE', + * permissionOverwrites: [ + * { + * id: message.author.id, + * deny: [Permissions.FLAGS.VIEW_CHANNEL], + * }, + * ], + * }) + * @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/4414590563479) for more information + */ + // eslint-disable-next-line deprecation/deprecation + public create(name: string, options: GuildChannelCreateOptions & { type: 'GUILD_STORE' }): Promise<BushStoreChannel>; + + /** + * Creates a new channel in the guild. + * @param name The name of the new channel + * @param options Options for creating the new channel + */ + public create<T extends GuildChannelTypes>( + name: string, + options: GuildChannelCreateOptions & { type: T } + ): Promise<BushMappedGuildChannelTypes[T]>; + + /** + * Creates a new channel in the guild. + * @param name The name of the new channel + * @param options Options for creating the new channel + */ + public create(name: string, options: GuildChannelCreateOptions): Promise<BushNonThreadGuildBasedChannel>; + + /** + * Obtains one or more guild channels from Discord, or the channel cache if they're already available. + * @param id The channel's id + * @param options Additional options for this fetch + * @example + * // Fetch all channels from the guild (excluding threads) + * message.guild.channels.fetch() + * .then(channels => console.log(`There are ${channels.size} channels.`)) + * .catch(console.error); + * @example + * // Fetch a single channel + * message.guild.channels.fetch('222197033908436994') + * .then(channel => console.log(`The channel name is: ${channel.name}`)) + * .catch(console.error); + */ + public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<BushNonThreadGuildBasedChannel | null>; + public fetch(id?: undefined, options?: BaseFetchOptions): Promise<Collection<Snowflake, BushNonThreadGuildBasedChannel>>; + + /** + * Batch-updates the guild's channels' positions. + * <info>Only one channel's parent can be changed at a time</info> + * @param channelPositions Channel positions to update + * @example + * guild.channels.setPositions([{ channel: channelId, position: newChannelIndex }]) + * .then(guild => console.log(`Updated channel positions for ${guild}`)) + * .catch(console.error); + */ + public setPositions(channelPositions: readonly ChannelPosition[]): Promise<BushGuild>; + + /** + * Obtains all active thread channels in the guild from Discord + * @param cache Whether to cache the fetched data + * @example + * // Fetch all threads from the guild + * message.guild.channels.fetchActiveThreads() + * .then(fetched => console.log(`There are ${fetched.threads.size} threads.`)) + * .catch(console.error); + */ + public fetchActiveThreads(cache?: boolean): Promise<BushFetchedThreads>; +} diff --git a/src/lib/extensions/discord.js/BushMessage.ts b/src/lib/extensions/discord.js/BushMessage.ts index b442196..16c57a2 100644 --- a/src/lib/extensions/discord.js/BushMessage.ts +++ b/src/lib/extensions/discord.js/BushMessage.ts @@ -4,10 +4,22 @@ import type { BushGuild, BushGuildMember, BushGuildTextBasedChannel, + BushMessageReaction, BushTextBasedChannel, + BushThreadChannel, BushUser } from '#lib'; -import { Message, type If, type Partialize } from 'discord.js'; +import { + Message, + type EmojiIdentifierResolvable, + type If, + type MessageActionRowComponent, + type MessageEditOptions, + type MessagePayload, + type Partialize, + type ReplyMessageOptions, + type StartThreadOptions +} from 'discord.js'; import type { RawMessageData } from 'discord.js/typings/rawDataTypes'; export type PartialBushMessage = Partialize< @@ -33,5 +45,19 @@ export class BushMessage<Cached extends boolean = boolean> extends Message<Cache } export interface BushMessage<Cached extends boolean = boolean> extends Message<Cached> { + delete(): Promise<BushMessage>; + edit(content: string | MessageEditOptions | MessagePayload): Promise<BushMessage>; + equals(message: BushMessage, rawData: unknown): boolean; + fetchReference(): Promise<BushMessage>; + crosspost(): Promise<BushMessage>; fetch(force?: boolean): Promise<BushMessage>; + pin(): Promise<BushMessage>; + react(emoji: EmojiIdentifierResolvable): Promise<BushMessageReaction>; + removeAttachments(): Promise<BushMessage>; + reply(options: string | MessagePayload | ReplyMessageOptions): Promise<BushMessage>; + resolveComponent(customId: string): MessageActionRowComponent | null; + startThread(options: StartThreadOptions): Promise<BushThreadChannel>; + suppressEmbeds(suppress?: boolean): Promise<BushMessage>; + unpin(): Promise<BushMessage>; + inGuild(): this is BushMessage<true> & this; } diff --git a/src/lib/extensions/discord.js/other.ts b/src/lib/extensions/discord.js/other.ts new file mode 100644 index 0000000..f81e01c --- /dev/null +++ b/src/lib/extensions/discord.js/other.ts @@ -0,0 +1,159 @@ +import type { + BushApplicationCommand, + BushCategoryChannel, + BushDMChannel, + BushGuild, + BushGuildEmoji, + BushGuildMember, + BushMessage, + BushNewsChannel, + BushReactionEmoji, + BushRole, + BushStageChannel, + BushStoreChannel, + BushTextChannel, + BushThreadChannel, + BushThreadMember, + BushUser, + BushVoiceChannel +} from '#lib'; +import type { Collection, EnumValueMapped, Message, PartialDMChannel, Snowflake } from 'discord.js'; +import type { ChannelTypes } from 'discord.js/typings/enums'; + +/** + * Data that resolves to give a ThreadMember object. + */ +export type BushThreadMemberResolvable = BushThreadMember | BushUserResolvable; + +/** + * Data that resolves to give a User object. + */ +export type BushUserResolvable = BushUser | Snowflake | BushMessage | BushGuildMember | BushThreadMember; + +/** + * Data that resolves to give a GuildMember object. + */ +export type BushGuildMemberResolvable = BushGuildMember | BushUserResolvable; + +/** + * Data that can be resolved to a Role object. + */ +export type BushRoleResolvable = BushRole | Snowflake; + +/** + * Data that can be resolved to a Message object. + */ +export type BushMessageResolvable = Message | BushMessage | Snowflake; + +/** + * Data that can be resolved into a GuildEmoji object. + */ +export type BushEmojiResolvable = Snowflake | BushGuildEmoji | BushReactionEmoji; + +/** + * Data that can be resolved to give an emoji identifier. This can be: + * * The unicode representation of an emoji + * * The `<a:name:id>`, `<:name:id>`, `a:name:id` or `name:id` emoji identifier string of an emoji + * * An EmojiResolvable + */ +export type BushEmojiIdentifierResolvable = string | BushEmojiResolvable; + +/** + * Data that can be resolved to a Thread Channel object. + */ +export type BushThreadChannelResolvable = BushThreadChannel | Snowflake; + +/** + * Data that resolves to give an ApplicationCommand object. + */ +export type BushApplicationCommandResolvable = BushApplicationCommand | Snowflake; + +/** + * Data that can be resolved to a GuildTextChannel object. + */ +export type BushGuildTextChannelResolvable = BushTextChannel | BushNewsChannel | Snowflake; + +/** + * Data that can be resolved to give a Channel object. + */ +export type BushChannelResolvable = BushAnyChannel | Snowflake; + +/** + * Data that can be resolved to give a Guild Channel object. + */ +export type BushGuildChannelResolvable = Snowflake | BushGuildBasedChannel; + +export type BushAnyChannel = + | BushCategoryChannel + | BushDMChannel + | PartialDMChannel + | BushNewsChannel + | BushStageChannel + // eslint-disable-next-line deprecation/deprecation + | BushStoreChannel + | BushTextChannel + | BushThreadChannel + | BushVoiceChannel; + +/** + * The channels that are text-based. + */ +export type BushTextBasedChannel = PartialDMChannel | BushThreadChannel | BushDMChannel | BushNewsChannel | BushTextChannel; + +/** + * The types of channels that are text-based. + */ +export type BushTextBasedChannelTypes = BushTextBasedChannel['type']; + +export type BushVoiceBasedChannel = Extract<BushAnyChannel, { bitrate: number }>; + +export type BushGuildBasedChannel = Extract<BushAnyChannel, { guild: BushGuild }>; + +export type BushNonThreadGuildBasedChannel = Exclude<BushGuildBasedChannel, BushThreadChannel>; + +export type BushGuildTextBasedChannel = Extract<BushGuildBasedChannel, BushTextBasedChannel>; + +/** + * Data that can be resolved to a Text Channel object. + */ +export type BushTextChannelResolvable = Snowflake | BushTextChannel; + +/** + * Data that can be resolved to a GuildVoiceChannel object. + */ +export type BushGuildVoiceChannelResolvable = BushVoiceBasedChannel | Snowflake; + +export type BushMappedChannelCategoryTypes = EnumValueMapped< + typeof ChannelTypes, + { + GUILD_NEWS: BushNewsChannel; + GUILD_VOICE: BushVoiceChannel; + GUILD_TEXT: BushTextChannel; + // eslint-disable-next-line deprecation/deprecation + GUILD_STORE: BushStoreChannel; + GUILD_STAGE_VOICE: BushStageChannel; + } +>; + +export type BushMappedGuildChannelTypes = EnumValueMapped< + typeof ChannelTypes, + { + GUILD_CATEGORY: BushCategoryChannel; + } +> & + BushMappedChannelCategoryTypes; + +/** + * The data returned from a thread fetch that returns multiple threads. + */ +export interface BushFetchedThreads { + /** + * The threads that were fetched, with any members returned + */ + threads: Collection<Snowflake, BushThreadChannel>; + + /** + * Whether there are potentially additional threads that require a subsequent call + */ + hasMore?: boolean; +} diff --git a/src/listeners/message/blacklistedFile.ts b/src/listeners/message/blacklistedFile.ts index 26e1719..5b01218 100644 --- a/src/listeners/message/blacklistedFile.ts +++ b/src/listeners/message/blacklistedFile.ts @@ -56,7 +56,7 @@ export default class BlacklistedFileListener extends BushListener { } ]; - constructor() { + public constructor() { super('blacklistedFile', { emitter: 'client', event: 'messageCreate', @@ -66,6 +66,7 @@ export default class BlacklistedFileListener extends BushListener { public override async exec(...[message]: BushClientEvents['messageCreate']) { if (!message.guild || !(await message.guild.hasFeature('blacklistedFile'))) return; + // eslint-disable-next-line deprecation/deprecation const embedAttachments = message.embeds.filter((e) => ['image', 'video', 'gifv'].includes(e.type)); const foundEmojis = [...message.content.matchAll(/<(?<animated>a?):\w+:(?<id>\d+)>/g)]; if (message.attachments.size + embedAttachments.length + foundEmojis.length < 1) return; @@ -5,7 +5,7 @@ __metadata: version: 5 cacheKey: 8 -"@babel/runtime@npm:^7.16.0": +"@babel/runtime@npm:^7.16.5": version: 7.16.5 resolution: "@babel/runtime@npm:7.16.5" dependencies: @@ -14,16 +14,16 @@ __metadata: languageName: node linkType: hard -"@discordjs/builders@npm:^0.10.0": - version: 0.10.0 - resolution: "@discordjs/builders@npm:0.10.0" +"@discordjs/builders@npm:^0.11.0": + version: 0.11.0 + resolution: "@discordjs/builders@npm:0.11.0" dependencies: "@sindresorhus/is": ^4.2.0 - discord-api-types: ^0.25.2 + discord-api-types: ^0.26.0 ts-mixer: ^6.0.0 tslib: ^2.3.1 zod: ^3.11.6 - checksum: 8195f519f28587dee05d9b975c19357c40623d17dc4ced01db11d24faab16969743c40d7cfb959ccb78ffb525c6d03f4f9c821dd712fef57bdd609b53add8727 + checksum: 7a25b59bb52d2e3695bca27946a99cf2de95b7edd5be424ea9f4707a465524be21263e25e532e12438e99f9f55fb98b033885c760aeb96424b8c12f663f50760 languageName: node linkType: hard @@ -461,7 +461,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:^17.0.2": +"@types/node@npm:*, @types/node@npm:^17.0.5": version: 17.0.5 resolution: "@types/node@npm:17.0.5" checksum: 105535e78722515c26cfdc1b0cbf1b19f55fe53b814e2e90d8b1e653bc63136d4760c7efc102eca111c6d124a291e37d60d761d569a3f4afb3fba05bad5d9ade @@ -552,7 +552,7 @@ __metadata: languageName: node linkType: hard -"@types/validator@npm:^13.7.0": +"@types/validator@npm:^13.7.1": version: 13.7.1 resolution: "@types/validator@npm:13.7.1" checksum: 810649a23bc46928c85d933be73b106bacb651a412c4172e30a70e84c63cada595d391042274b16e1c05b391af3a4f157b360890fbc5462ee347275222d59b64 @@ -568,12 +568,12 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.8.0": - version: 5.8.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.8.0" +"@typescript-eslint/eslint-plugin@npm:^5.8.1": + version: 5.8.1 + resolution: "@typescript-eslint/eslint-plugin@npm:5.8.1" dependencies: - "@typescript-eslint/experimental-utils": 5.8.0 - "@typescript-eslint/scope-manager": 5.8.0 + "@typescript-eslint/experimental-utils": 5.8.1 + "@typescript-eslint/scope-manager": 5.8.1 debug: ^4.3.2 functional-red-black-tree: ^1.0.1 ignore: ^5.1.8 @@ -586,66 +586,66 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 96a21a3e19baf57e30c97953e35832b1f4e135c865b2dfd5afe53772bd08556b9ad724e55696dce9acf471553ab66ae45737e82abba6c15152f79a47d2d9f055 + checksum: 9e5b5c1e22563fc0a31f1b916cea8b059b6dd218ccbf809b7453e4563065781e4544a6d5ce4cbf60b40394f2604e925d10cafd468a4dd0f490e75775267839a0 languageName: node linkType: hard -"@typescript-eslint/experimental-utils@npm:5.8.0, @typescript-eslint/experimental-utils@npm:^5.0.0": - version: 5.8.0 - resolution: "@typescript-eslint/experimental-utils@npm:5.8.0" +"@typescript-eslint/experimental-utils@npm:5.8.1, @typescript-eslint/experimental-utils@npm:^5.0.0": + version: 5.8.1 + resolution: "@typescript-eslint/experimental-utils@npm:5.8.1" dependencies: "@types/json-schema": ^7.0.9 - "@typescript-eslint/scope-manager": 5.8.0 - "@typescript-eslint/types": 5.8.0 - "@typescript-eslint/typescript-estree": 5.8.0 + "@typescript-eslint/scope-manager": 5.8.1 + "@typescript-eslint/types": 5.8.1 + "@typescript-eslint/typescript-estree": 5.8.1 eslint-scope: ^5.1.1 eslint-utils: ^3.0.0 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: c97798bcc3332331a75661e073d38783ee4882803b0247db76df851bc8594c9b7e23fb9de28aa212c331b18ff2e8c23657ae1b9b994eeec528214fcf8d81e9fb + checksum: 15c17a7b7a45a9e1ebf537e6d6221e423c8f5114c0a517265698745b9a4ae965487ef7856a0b1ee64cbda8db641a9204270fda88398ab1d7013256e0ccbd3e75 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.8.0": - version: 5.8.0 - resolution: "@typescript-eslint/parser@npm:5.8.0" +"@typescript-eslint/parser@npm:^5.8.1": + version: 5.8.1 + resolution: "@typescript-eslint/parser@npm:5.8.1" dependencies: - "@typescript-eslint/scope-manager": 5.8.0 - "@typescript-eslint/types": 5.8.0 - "@typescript-eslint/typescript-estree": 5.8.0 + "@typescript-eslint/scope-manager": 5.8.1 + "@typescript-eslint/types": 5.8.1 + "@typescript-eslint/typescript-estree": 5.8.1 debug: ^4.3.2 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 138b1d20a6c204fdd0c93295b4ec667caf6036e74bfeae0b80cfe14c4d50761bb9f469b30d320d2d85757a1b98c2ae7f30d9a788a293afc1ea10b9f3d9fbc8f7 + checksum: bb1702851ff0ade16a50789c517155557ad7e9b8e5e9c4553aad52fedbc8f94acaade1dc5ba12a96b54a13a68dfea13955ab885aad97cf3c526a8b90880bd8a3 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.8.0": - version: 5.8.0 - resolution: "@typescript-eslint/scope-manager@npm:5.8.0" +"@typescript-eslint/scope-manager@npm:5.8.1": + version: 5.8.1 + resolution: "@typescript-eslint/scope-manager@npm:5.8.1" dependencies: - "@typescript-eslint/types": 5.8.0 - "@typescript-eslint/visitor-keys": 5.8.0 - checksum: 15f365a491c096104d3279617522375b6084117ac21e52cf04935a1cce192d730785a1e47afd8a8ca9aa907f1f9cd34793610406ce93447addf6854cdfa830f3 + "@typescript-eslint/types": 5.8.1 + "@typescript-eslint/visitor-keys": 5.8.1 + checksum: d9254018d723aff32fc512b7292737b154367198ab58e0faf814b4ce77d4de20552ed1678f2639b35e480eb5594eb9d5f1d34360885f5e4d80ca8e5a9ccf666c languageName: node linkType: hard -"@typescript-eslint/types@npm:5.8.0": - version: 5.8.0 - resolution: "@typescript-eslint/types@npm:5.8.0" - checksum: eda7a2c4620fd0cd56a81af6f44d8de96eb5912dda69907cd422e3fb5845b45c004a2c50f1896b6573b70f41f175208434d13dd744ea23aec2094ba916578a81 +"@typescript-eslint/types@npm:5.8.1": + version: 5.8.1 + resolution: "@typescript-eslint/types@npm:5.8.1" + checksum: f9809c2c0f523841adeeb66410911f10492d3df7a912bc3d72304f4edbc5b5cb1a3f5f2a6ded20e8b524cc18e92d2a735fb8b96570e75df669061182932200ef languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.8.0": - version: 5.8.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.8.0" +"@typescript-eslint/typescript-estree@npm:5.8.1": + version: 5.8.1 + resolution: "@typescript-eslint/typescript-estree@npm:5.8.1" dependencies: - "@typescript-eslint/types": 5.8.0 - "@typescript-eslint/visitor-keys": 5.8.0 + "@typescript-eslint/types": 5.8.1 + "@typescript-eslint/visitor-keys": 5.8.1 debug: ^4.3.2 globby: ^11.0.4 is-glob: ^4.0.3 @@ -654,17 +654,17 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 67f51754d1dea9eafc8d052b67a2d7a3b20e20d97de03fc49615fe70d0373323619dfa5986a8e71cb9b2ec6079fb050049100763b5dbadae52b30c7d11c57ebd + checksum: e3cfbd088f1e0104b5b38fcc6e400a0d0e72395694406357e478369c4df532aa2accfe2ee77c71854ca9a04e0e3cddbed86388334805c91ca4241b032cbb6d20 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.8.0": - version: 5.8.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.8.0" +"@typescript-eslint/visitor-keys@npm:5.8.1": + version: 5.8.1 + resolution: "@typescript-eslint/visitor-keys@npm:5.8.1" dependencies: - "@typescript-eslint/types": 5.8.0 + "@typescript-eslint/types": 5.8.1 eslint-visitor-keys: ^3.0.0 - checksum: 03a349d4a577aa128b27d13a16e6e365d18e6aa9f297bc2a632bc2ddae8cfed9cb66c227f87fde9924e9f8a58c40c41df6f537016d037a05fe1908bfa0839d18 + checksum: 46567678718a227b34a255a3606e1a2c5190a470dc9493d4c175f57566d2c16b88780fb273ca44f22cab06d45d87b25371215e93b88ac10a475877bd64bdfece languageName: node linkType: hard @@ -685,11 +685,11 @@ __metadata: linkType: hard "acorn@npm:^8.6.0": - version: 8.6.0 - resolution: "acorn@npm:8.6.0" + version: 8.7.0 + resolution: "acorn@npm:8.7.0" bin: acorn: bin/acorn - checksum: 9d0de73b73cb6ea8ccd8263a8144d9e2c4b6af90ea0c429997538af0ebbe83c5addecee814b2a7f91f7f615d0bd1547cc7137b3fa236ce058adc64feccee850b + checksum: e0f79409d68923fbf1aa6d4166f3eedc47955320d25c89a20cc822e6ba7c48c5963d5bc657bc242d68f7a4ac9faf96eef033e8f73656da6c640d4219935fdfd0 languageName: node linkType: hard @@ -758,13 +758,6 @@ __metadata: languageName: node linkType: hard -"any-promise@npm:^1.3.0": - version: 1.3.0 - resolution: "any-promise@npm:1.3.0" - checksum: 0ee8a9bdbe882c90464d75d1f55cf027f5458650c4bd1f0467e65aec38ccccda07ca5844969ee77ed46d04e7dded3eaceb027e8d32f385688523fe305fa7e1de - languageName: node - linkType: hard - "aproba@npm:^1.0.3 || ^2.0.0": version: 2.0.0 resolution: "aproba@npm:2.0.0" @@ -858,7 +851,7 @@ __metadata: "@types/eslint": ^8 "@types/express": ^4.17.13 "@types/lodash": ^4.14.178 - "@types/node": ^17.0.2 + "@types/node": ^17.0.5 "@types/node-os-utils": ^1.2.0 "@types/numeral": ^2.0.2 "@types/pg": ^8 @@ -866,22 +859,22 @@ __metadata: "@types/rimraf": ^3 "@types/source-map-support": ^0 "@types/tinycolor2": ^1.4.3 - "@types/validator": ^13.7.0 - "@typescript-eslint/eslint-plugin": ^5.8.0 - "@typescript-eslint/parser": ^5.8.0 + "@types/validator": ^13.7.1 + "@typescript-eslint/eslint-plugin": ^5.8.1 + "@typescript-eslint/parser": ^5.8.1 canvas: ^2.8.0 chalk: ^5.0.0 deep-lock: ^1.0.0 discord-akairo: "npm:@notenoughupdates/discord-akairo@dev" - discord-api-types: 0.25.2 + discord-api-types: 0.26.0 discord.js: "npm:@notenoughupdates/discord.js@dev" eslint: ^8.5.0 eslint-config-prettier: ^8.3.0 eslint-plugin-deprecation: ^1.3.2 - fuse.js: ^6.4.6 + fuse.js: ^6.5.3 got: ^12.0.0 lodash: ^4.17.21 - mathjs: ^10.0.0 + mathjs: ^10.0.2 moment: ^2.29.1 nanoid: ^3.1.30 node-os-utils: ^1.3.5 @@ -891,7 +884,7 @@ __metadata: prettier: ^2.5.1 pretty-bytes: ^5.6.0 rimraf: ^3.0.2 - sequelize: v6.12.0-beta.3 + sequelize: ^6.12.4 source-map-support: ^0.5.21 tinycolor2: ^1.4.2 tslib: ^2.3.1 @@ -1178,35 +1171,35 @@ __metadata: linkType: hard "discord-akairo@npm:@notenoughupdates/discord-akairo@dev": - version: 9.0.10-dev.1640462480.67bad80 - resolution: "@notenoughupdates/discord-akairo@npm:9.0.10-dev.1640462480.67bad80" + version: 9.0.10-dev.1640804630.61aa536 + resolution: "@notenoughupdates/discord-akairo@npm:9.0.10-dev.1640804630.61aa536" dependencies: source-map-support: ^0.5.21 - checksum: cf03a768d33d74c6501aba4462c6c3f727a4e164643a41fca0256dfae706d28a104471c3292c919c9977b5c9e2f1aa6a92c918c8872f375fb4e524b1e593d8b8 + checksum: 8a45820af3d3842e47c37d510fe478366d418bd46d30d63817dc87a73f65fec9aec289966fcb4a78638b1560d183dacd88ee73da474521be95ab9608cbb66226 languageName: node linkType: hard -"discord-api-types@npm:0.25.2, discord-api-types@npm:^0.25.2": - version: 0.25.2 - resolution: "discord-api-types@npm:0.25.2" - checksum: bb80a9db706d8ae391ab5eae4536827832ffe744b69659029597aaf90d9b9ece6e9642bd44eb3f38b32a3783ad1eebce378403fc785ca5405f8b71d8d32678a5 +"discord-api-types@npm:0.26.0, discord-api-types@npm:^0.26.0": + version: 0.26.0 + resolution: "discord-api-types@npm:0.26.0" + checksum: 5c2a3f7309fec3830a8da5e98e5260b25304512ae856c770d783492aa4a8c514a64025bb30ceda0c4381bc749db9545c0d7d5573fa0d60bb1718add27c8b4d7d languageName: node linkType: hard "discord.js@npm:@notenoughupdates/discord.js@dev": - version: 13.5.0-dev.1640520488.94c65e7 - resolution: "@notenoughupdates/discord.js@npm:13.5.0-dev.1640520488.94c65e7" + version: 14.0.0-dev.1640799852.127ddf6 + resolution: "@notenoughupdates/discord.js@npm:14.0.0-dev.1640799852.127ddf6" dependencies: - "@discordjs/builders": ^0.10.0 + "@discordjs/builders": ^0.11.0 "@discordjs/collection": ^0.4.0 "@sapphire/async-queue": ^1.1.9 "@types/node-fetch": ^2.5.12 "@types/ws": ^8.2.2 - discord-api-types: ^0.25.2 + discord-api-types: ^0.26.0 form-data: ^4.0.0 node-fetch: ^2.6.1 ws: ^8.4.0 - checksum: 6d1e0f333cf7b4cd6408a135efe791ea7aaadbc67240fae640bb4a6e2d361a3d8ca297b8a194fb4c95dffe5d58913feb5e67cfd38328c6d164168a44ef6f7d09 + checksum: 2b00905ffcdfabb0158b6be4cfdf00727a9b58c715bd3b627f17cff2a2ed6ce2333ffed64ae0edba45bee7b7e466c0f621792b8be41bceb4d8f709d269f5ab30 languageName: node linkType: hard @@ -1563,7 +1556,7 @@ __metadata: languageName: node linkType: hard -"fraction.js@npm:^4.1.1": +"fraction.js@npm:^4.1.2": version: 4.1.2 resolution: "fraction.js@npm:4.1.2" checksum: a67eff2b599cb6546b77ce9c913bd0cccd646e1a525c793ba4e0bf5a399fc403f379227fca83423a6ea79d01e35c2f2b0f141ffa1d09e41377041268a53fb150 @@ -1593,7 +1586,7 @@ __metadata: languageName: node linkType: hard -"fuse.js@npm:^6.4.6": +"fuse.js@npm:^6.5.3": version: 6.5.3 resolution: "fuse.js@npm:6.5.3" checksum: f7c14f4422000e7f7e3515c66f7cefdfc38adec4cf380097f4146a201ea438af60b67dc5849b3c0de0115ce3f9bc5afad6fc6570c08dcfcef5bf6e95eb8e6d6f @@ -2083,22 +2076,22 @@ __metadata: languageName: node linkType: hard -"mathjs@npm:^10.0.0": - version: 10.0.1 - resolution: "mathjs@npm:10.0.1" +"mathjs@npm:^10.0.2": + version: 10.0.2 + resolution: "mathjs@npm:10.0.2" dependencies: - "@babel/runtime": ^7.16.0 + "@babel/runtime": ^7.16.5 complex.js: ^2.0.15 decimal.js: ^10.3.1 escape-latex: ^1.2.0 - fraction.js: ^4.1.1 + fraction.js: ^4.1.2 javascript-natural-sort: ^0.7.1 seedrandom: ^3.0.5 tiny-emitter: ^2.1.0 typed-function: ^2.0.0 bin: mathjs: bin/cli.js - checksum: 0665088f28e420d4025e1f8c7413b3735184816496dd57487c7121eb788a056186a960bb78ec282eda59e860a214af70ff5e54783ab0600acdcd35ab841b1a42 + checksum: 1ea053208b015999bcf1367a8d97fde6c34facd5b42809e4cb45c50660381e081a4aa5cc5790fc141ea1afd3862e1d5f931bdbcb656530eab71c80739bc71f0a languageName: node linkType: hard @@ -2718,12 +2711,10 @@ __metadata: languageName: node linkType: hard -"retry-as-promised@npm:^4.0.0": - version: 4.0.0 - resolution: "retry-as-promised@npm:4.0.0" - dependencies: - any-promise: ^1.3.0 - checksum: bb7080575bdca4dab267cfd0e35a2ad096dbf4fe7e878864adf3ab24794ba1f9f29f52a1c5503117a5bd72abb6ea0d81a55659bbf735d2a8f2192c9e230d0990 +"retry-as-promised@npm:^5.0.0": + version: 5.0.0 + resolution: "retry-as-promised@npm:5.0.0" + checksum: 4d17e0597f967db0516714f0f2b085e2d1e8ea592450b013a1e0cd41dad74a9c3d1eb3c45351887de4bca1c3ac5f74dd07ef9942a3fb0e4db996a83bb28cb46e languageName: node linkType: hard @@ -2809,9 +2800,9 @@ __metadata: languageName: node linkType: hard -"sequelize@npm:v6.12.0-beta.3": - version: 6.12.0-beta.3 - resolution: "sequelize@npm:6.12.0-beta.3" +"sequelize@npm:^6.12.4": + version: 6.12.4 + resolution: "sequelize@npm:6.12.4" dependencies: "@types/debug": ^4.1.7 debug: ^4.3.3 @@ -2821,7 +2812,7 @@ __metadata: moment: ^2.29.1 moment-timezone: ^0.5.34 pg-connection-string: ^2.5.0 - retry-as-promised: ^4.0.0 + retry-as-promised: ^5.0.0 semver: ^7.3.5 sequelize-pool: ^7.1.0 toposort-class: ^1.0.1 @@ -2845,7 +2836,7 @@ __metadata: optional: true tedious: optional: true - checksum: 1fed41325f11d9da977f24bcf0ab324d239b8a38535352f1048c76b545352ea823472758220c66a53125c96c2556d7196936d0e3413f3b84fe85d5ea6cb74e36 + checksum: bf781ea640627cb8f32bcc3521ad100c98cca0f77ac1f0bffeaaa1bb5f15dff200c5e225d752f9c7fc8824f3f1885d3d4944f5a31b990008684eedc19e805059 languageName: node linkType: hard |