From e30edf77d2cc27db97a6b6b1f845730c4924046c Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 14 Jul 2022 08:59:20 -0400 Subject: ticket --- src/commands/tickets/ticket-!.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/commands/tickets/ticket-!.ts diff --git a/src/commands/tickets/ticket-!.ts b/src/commands/tickets/ticket-!.ts new file mode 100644 index 0000000..e69de29 -- cgit From bddeb83bc0641a059a08c5887e6585c759c3b643 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 14 Jul 2022 08:59:39 -0400 Subject: invite info --- src/commands/info/inviteInfo.ts | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/commands/info/inviteInfo.ts diff --git a/src/commands/info/inviteInfo.ts b/src/commands/info/inviteInfo.ts new file mode 100644 index 0000000..bfe7eae --- /dev/null +++ b/src/commands/info/inviteInfo.ts @@ -0,0 +1,43 @@ +import { Arg, ArgType, BushCommand, clientSendAndPermCheck, colors, type CommandMessage, type SlashMessage } from '#lib'; +import { ApplicationCommandOptionType, EmbedBuilder, Invite, PermissionFlagsBits } from 'discord.js'; + +export default class InviteInfoCommand extends BushCommand { + public constructor() { + super('inviteInfo', { + aliases: ['invite-info', 'ii'], + category: 'info', + description: 'Get info about an invite.', + usage: ['invite-info [invite]'], + examples: ['invite-info discord.gg/moulberry'], + args: [ + { + id: 'invite', + description: 'The guild to find information about.', + type: 'invite', + prompt: 'What invite would you like to find information about?', + retry: '{error} Choose a valid invite to find information about.', + slashType: ApplicationCommandOptionType.String + } + ], + slash: true, + clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true), + userPermissions: [] + }); + } + + public override async exec(message: CommandMessage | SlashMessage, args: { invite: ArgType<'invite' | 'string'> }) { + const invite = message.util.isSlashMessage(message) + ? ((await Arg.cast('invite', message, args.invite as string)) as ArgType<'invite'>) + : args.invite; + + const inviteInfoEmbed = new EmbedBuilder().setTitle(`Invite to ${invite.guild.name}`).setColor(colors.default); + + this.generateAboutField(inviteInfoEmbed, invite); + } + + private generateAboutField(embed: EmbedBuilder, invite: Invite) { + const about = [`**code:** ${invite.code}`, `**channel:** ${}`]; + + embed.addFields({ name: '» About', value: about.join('\n') }); + } +} -- cgit From 7cec4037ead3287c1d88db4274824b21d9d57d51 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 14 Jul 2022 09:01:43 -0400 Subject: messing around with repo stuff --- assets/Faithful.ttf | Bin 0 -> 275832 bytes package.json | 1 + src/bot.ts | 46 ++--- src/commands/moulberry-bush/neuRepo.ts | 47 +++++ src/lib/common/util/Minecraft.ts | 303 +++++++++++++++++++++++++++++++++ src/tasks/cache/updateNeuItemCache.ts | 12 ++ tsconfig.json | 34 ++-- vite.config.ts | 14 +- yarn.lock | 8 + 9 files changed, 423 insertions(+), 42 deletions(-) create mode 100644 assets/Faithful.ttf create mode 100644 src/commands/moulberry-bush/neuRepo.ts create mode 100644 src/lib/common/util/Minecraft.ts create mode 100644 src/tasks/cache/updateNeuItemCache.ts diff --git a/assets/Faithful.ttf b/assets/Faithful.ttf new file mode 100644 index 0000000..aaadb94 Binary files /dev/null and b/assets/Faithful.ttf differ diff --git a/package.json b/package.json index 971378b..c1882bc 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "dependencies": { "@discordjs/builders": "^0.15.0", "@discordjs/rest": "^0.5.0", + "@ironm00n/nbt-ts": "^1.4.0", "@notenoughupdates/discord.js-minesweeper": "^1.0.10", "@notenoughupdates/events-intercept": "^3.0.1", "@notenoughupdates/humanize-duration": "^4.0.1", diff --git a/src/bot.ts b/src/bot.ts index d7b5ad9..640f2ab 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -1,23 +1,29 @@ -import { init } from './lib/utils/BushLogger.js'; -// creates proxies on console.log and console.warn -// also starts a REPL session -init(); +// import { init } from './lib/utils/BushLogger.js'; +// // creates proxies on console.log and console.warn +// // also starts a REPL session +// init(); -const { dirname } = await import('path'); -const { fileURLToPath } = await import('url'); -const { default: config } = await import('../config/options.js'); -const { Sentry } = await import('./lib/common/Sentry.js'); -const { BushClient } = await import('./lib/index.js'); - -const isDry = process.argv.includes('dry'); -if (!isDry && config.credentials.sentryDsn !== null) new Sentry(dirname(fileURLToPath(import.meta.url)) || process.cwd(), config); -BushClient.extendStructures(); -const client = new BushClient(config); -if (!isDry) await client.dbPreInit(); -await client.init(); -if (isDry) { - await client.destroy(); - process.exit(0); +// eslint-disable-next-line no-constant-condition +if (false) { + // const { dirname } = await import('path'); + // const { fileURLToPath } = await import('url'); + // const { default: config } = await import('../config/options.js'); + // const { Sentry } = await import('./lib/common/Sentry.js'); + // const { BushClient } = await import('./lib/index.js'); + // + // const isDry = process.argv.includes('dry'); + // if (!isDry && config.credentials.sentryDsn !== null) + // new Sentry(dirname(fileURLToPath(import.meta.url)) || process.cwd(), config); + // BushClient.extendStructures(); + // const client = new BushClient(config); + // if (!isDry) await client.dbPreInit(); + // await client.init(); + // if (isDry) { + // await client.destroy(); + // process.exit(0); + // } else { + // await client.start(); + // } } else { - await client.start(); + import('./lib/common/util/Minecraft.js'); } diff --git a/src/commands/moulberry-bush/neuRepo.ts b/src/commands/moulberry-bush/neuRepo.ts new file mode 100644 index 0000000..24f83ad --- /dev/null +++ b/src/commands/moulberry-bush/neuRepo.ts @@ -0,0 +1,47 @@ +import { BushCommand, clientSendAndPermCheck, type ArgType, type CommandMessage, type SlashMessage } from '#lib'; +import { ApplicationCommandOptionType, AutocompleteInteraction, CacheType, PermissionFlagsBits } from 'discord.js'; + +export default class NeuRepoCommand extends BushCommand { + public static items: { name: string; id: string }[] = []; + + public constructor() { + super('neuRepo', { + aliases: ['neu-repo', 'repo-item', 'neu-item', 'item-repo'], + category: "Moulberry's Bush", + description: 'Get information about an item from the NEU item repo.', + usage: ['neu-repo '], + examples: ['neu-repo BARRIER'], + args: [ + { + id: 'item', + description: 'The item id that you would like to find neu item information about.', + type: 'string', + prompt: 'What SkyBlock item would you like to get information about?', + retry: '{error} Pick a valid SkyBlock item ID. Try using the slash command for a better experience.', + slashType: ApplicationCommandOptionType.String, + autocomplete: true + } + /* { + id: 'dangerous', + description: 'Whether or not to use the dangerous branch.', + prompt: 'Would you like to use the dangerous branch instead of the master branch?', + match: 'flag', + flag: ['--dangerous', '-d'], + default: false, + optional: true, + slashType: ApplicationCommandOptionType.Boolean + } */ + ], + slash: true, + clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true), + userPermissions: [] + }); + } + + public override async exec( + message: CommandMessage | SlashMessage, + args: { item: ArgType<'string'> /* dangerous: ArgType<'flag'> */ } + ) {} + + public override async autocomplete(interaction: AutocompleteInteraction) {} +} diff --git a/src/lib/common/util/Minecraft.ts b/src/lib/common/util/Minecraft.ts new file mode 100644 index 0000000..fbacbf0 --- /dev/null +++ b/src/lib/common/util/Minecraft.ts @@ -0,0 +1,303 @@ +import { Byte, Int, parse } from '@ironm00n/nbt-ts'; +import { BitField } from 'discord.js'; +import fs from 'fs/promises'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +export enum FormattingCodes { + Black = '§0', + DarkBlue = '§1', + DarkGreen = '§2', + DarkAqua = '§3', + DarkRed = '§4', + DarkPurple = '§5', + Gold = '§6', + Gray = '§7', + DarkGray = '§8', + Blue = '§9', + Green = '§a', + Aqua = '§b', + Red = '§c', + LightPurple = '§d', + Yellow = '§e', + White = '§f', + + Obfuscated = '§k', + Bold = '§l', + Strikethrough = '§m', + Underline = '§n', + Italic = '§o', + Reset = '§r' +} + +// https://minecraft.fandom.com/wiki/Formatting_codes +export const formattingInfo = { + [FormattingCodes.Black]: { foreground: '#000000', background: '#000000', ansi: '\u001b[0;30m' }, + [FormattingCodes.DarkBlue]: { foreground: '#0000AA', background: '#00002A', ansi: '\u001b[0;34m' }, + [FormattingCodes.DarkGreen]: { foreground: '#00AA00', background: '#002A00', ansi: '\u001b[0;32m' }, + [FormattingCodes.DarkAqua]: { foreground: '#00AAAA', background: '#002A2A', ansi: '\u001b[0;36m' }, + [FormattingCodes.DarkRed]: { foreground: '#AA0000', background: '#2A0000', ansi: '\u001b[0;31m' }, + [FormattingCodes.DarkPurple]: { foreground: '#AA00AA', background: '#2A002A', ansi: '\u001b[0;35m' }, + [FormattingCodes.Gold]: { foreground: '#FFAA00', background: '#2A2A00', ansi: '\u001b[0;33m' }, + [FormattingCodes.Gray]: { foreground: '#AAAAAA', background: '#2A2A2A', ansi: '\u001b[0;37m' }, + [FormattingCodes.DarkGray]: { foreground: '#555555', background: '#151515', ansi: '\u001b[0;90m' }, + [FormattingCodes.Blue]: { foreground: '#5555FF', background: '#15153F', ansi: '\u001b[0;94m' }, + [FormattingCodes.Green]: { foreground: '#55FF55', background: '#153F15', ansi: '\u001b[0;92m' }, + [FormattingCodes.Aqua]: { foreground: '#55FFFF', background: '#153F3F', ansi: '\u001b[0;96m' }, + [FormattingCodes.Red]: { foreground: '#FF5555', background: '#3F1515', ansi: '\u001b[0;91m' }, + [FormattingCodes.LightPurple]: { foreground: '#FF55FF', background: '#3F153F', ansi: '\u001b[0;95m' }, + [FormattingCodes.Yellow]: { foreground: '#FFFF55', background: '#3F3F15', ansi: '\u001b[0;93m' }, + [FormattingCodes.White]: { foreground: '#FFFFFF', background: '#3F3F3F', ansi: '\u001b[0;97m' }, + + [FormattingCodes.Obfuscated]: { ansi: '\u001b[8m' }, + [FormattingCodes.Bold]: { ansi: '\u001b[1m' }, + [FormattingCodes.Strikethrough]: { ansi: '\u001b[9m' }, + [FormattingCodes.Underline]: { ansi: '\u001b[4m' }, + [FormattingCodes.Italic]: { ansi: '\u001b[3m' }, + [FormattingCodes.Reset]: { ansi: '\u001b[0m' } +} as const; + +export type McItemId = Lowercase; +export type SbItemId = Uppercase; +export type MojangJson = string; +export type SbRecipeItem = `${SbItemId}:${number}` | ''; +export type SbRecipe = { + [Location in `${'A' | 'B' | 'C'}${1 | 2 | 3}`]: SbRecipeItem; +}; +export type InfoType = 'WIKI_URL' | ''; + +type Slayer = `${'WOLF' | 'BLAZE' | 'EMAN'}_${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`; + +export interface RawNeuItem { + itemid: McItemId; + displayname: string; + nbttag: MojangJson; + damage: number; + lore: string[]; + recipe?: SbRecipe; + internalname: SbItemId; + modver: string; + infoType: InfoType; + info?: string[]; + crafttext: string; + vanilla?: boolean; + useneucraft?: boolean; + slayer_req?: Slayer; + clickcommand?: string; + x?: number; + y?: number; + z?: number; + island?: string; + recipes?: { type: string; cost: any[]; result: SbItemId }[]; + /** @deprecated */ + parent?: SbItemId; + noseal?: boolean; +} + +export enum HideFlagsBits { + Enchantments = 1, + AttributeModifiers = 2, + Unbreakable = 4, + CanDestroy = 8, + CanPlaceOn = 16, + /** + * potion effects, shield pattern info, "StoredEnchantments", written book + * "generation" and "author", "Explosion", "Fireworks", and map tooltips + */ + OtherInformation = 32, + Dyed = 64 +} + +export type HideFlagsString = keyof typeof HideFlagsBits; + +export class HideFlags extends BitField { + public static override Flags = HideFlagsBits; +} + +export const formattingCode = new RegExp( + `§[${Object.values(FormattingCodes) + .filter((v) => v.startsWith('§')) + .map((v) => v.substring(1)) + .join('')}]` +); + +export function removeMCFormatting(str: string) { + return str.replaceAll(formattingCode, ''); +} + +const repo = path.join(__dirname, '..', '..', '..', '..', '..', 'neu-item-repo-dangerous'); +const itemPath = path.join(repo, 'items'); +const items = await fs.readdir(itemPath); + +// for (let i = 0; i < 5; i++) { +for (const path_ of items) { + // const randomItem = items[Math.floor(Math.random() * items.length)]; + // console.log(randomItem); + const item = (await import(path.join(itemPath, /* randomItem */ path_), { assert: { type: 'json' } })).default as RawNeuItem; + if (item.displayname.includes('(Monster)') || item.displayname.includes('(NPC)')) continue; + /* console.log(path_); + console.dir(item, { depth: Infinity }); */ + + /* console.log('==========='); */ + const nbt = /* fn( */ parse(item.nbttag /* .replaceAll(/([0-9]{1,3}:)(["{])/g, '$2'), { useMaps: true } */) as any; /*); */ + console.dir(nbt, { depth: Infinity }); + console.log('==========='); + // console.dir((nbt.(item.nbttag))); + + /* // eslint-disable-next-line no-inner-declarations + function fn(map: TagMap) { + const ret = {} as any; + map.forEach((val, key) => { + function fn2(val: any): any { + if (val instanceof Map) return fn(val); + else if (Array.isArray(val)) return val.map((v) => fn2(v)); + else return val.valueOf(); + } + ret[key] = fn2(val); + }); + return ret; + } */ + + /* if (nbt?.display && nbt.display.Name !== item.displayname) + console.log(`${path_} display name mismatch: ${mcToAnsi(nbt.display.Name)} != ${mcToAnsi(item.displayname)}`); + + if (nbt?.ExtraAttributes && nbt?.ExtraAttributes.id !== item.internalname) + console.log(`${path_} internal name mismatch: ${mcToAnsi(nbt?.ExtraAttributes.id)} != ${mcToAnsi(item.internalname)}`); */ + + /* console.log('==========='); + + console.log(mcToAnsi(item.displayname)); + console.log(item.lore.map((l) => mcToAnsi(l)).join('\n')); */ + + /* const keys = [ + 'itemid', + 'displayname', + 'nbttag', + 'damage', + 'lore', + 'recipe', + 'internalname', + 'modver', + 'infoType', + 'info', + 'crafttext', + 'vanilla', + 'useneucraft', + 'slayer_req', + 'clickcommand', + 'x', + 'y', + 'z', + 'island', + 'recipes', + 'parent', + 'noseal' + ]; + + Object.keys(item).forEach((k) => { + if (!keys.includes(k)) throw new Error(`Unknown key: ${k}`); + }); + + if ( + 'slayer_req' in item && + !new Array(10).flatMap((_, i) => ['WOLF', 'BLAZE', 'EMAN'].map((e) => e + (i + 1)).includes(item.slayer_req!)) + ) + throw new Error(`Unknown slayer req: ${item.slayer_req!}`); */ + + /* console.log('=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-'); */ +} + +interface NbtTag { + overrideMeta?: Byte; + Unbreakable?: Int; + ench?: string[]; + HideFlags?: HideFlags; + SkullOwner?: SkullOwner; + display?: NbtTagDisplay; + ExtraAttributes?: ExtraAttributes; +} + +interface SkullOwner { + Id?: string; + Properties?: { + textures?: { Value?: string }[]; + }; +} + +interface NbtTagDisplay { + Lore?: string[]; + Name?: string; +} + +type RuneId = string; + +interface ExtraAttributes { + originTag?: Origin; + id?: string; + generator_tier?: Int; + boss_tier?: Int; + enchantments?: { hardened_mana?: Int }; + dungeon_item_level?: Int; + runes?: { [key: RuneId]: Int }; +} + +type Origin = 'SHOP_PURCHASE'; + +class NeuItem { + public itemId: string; + public nbtTag: NbtTag; + + public constructor(raw: RawNeuItem) { + this.itemId = raw.itemid; + this.nbtTag = parse(raw.nbttag); + } + + public get lore(): string { + return ''; + } + + private pet() {} +} + +function mcToAnsi(str: string) { + for (const format in formattingInfo) { + str = str.replaceAll(format, formattingInfo[format as keyof typeof formattingInfo].ansi); + } + return `${str}\u001b[0m`; +} + +const neuConstantsPath = path.join(repo, 'constants'); +const neuPetsPath = path.join(neuConstantsPath, 'pets.json'); +const neuPets = await import(neuPetsPath, { assert: { type: 'json' } }); + +// console.dir(await nbt.parse(buffer)); +/* console.dir( + await nbt.parse( + Buffer.from( + '{overrideMeta:1b,HideFlags:254,SkullOwner:{Id:"4173bc61-9e2f-3c84-8d31-4517e64062ab",Properties:{textures:[0:{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjNhYWY3YjFhNzc4OTQ5Njk2Y2I5OWQ0ZjA0YWQxYWE1MThjZWVlMjU2YzcyZTVlZDY1YmZhNWMyZDg4ZDllIn19fQ=="}]}},display:{Lore:[0:"§8Combat Pet",1:"",2:"§7Intelligence: §a{INTELLIGENCE}",3:"§7Strength: §a{STRENGTH}",4:"",5:"§6Rekindle",6:"§7§7Before death, become §eimmune",7:"§e§7and gain §c{0} §c❁ Strength",8:"§c§7for §a{1} §7seconds",9:"§83 minutes cooldown",10:"",11:"§6Fourth Flare",12:"§7§7On 4th melee strike, §6ignite",13:"§6§7mobs, dealing §c{4}x §7your",14:"§7§9☠ Crit Damage §7each second",15:"§7for §a{5} §7seconds",16:"",17:"§7§eRight-click to add this pet to",18:"§eyour pet menu!",19:"",20:"§5§lEPIC"],Name:"§f§f§7[Lvl {LVL}] §5Phoenix"},ExtraAttributes:{petInfo:"{\\"type\\":\\"PHOENIX\\",\\"active\\":false,\\"exp\\":0.0,\\"tier\\":\\"EPIC\\",\\"hideInfo\\":false}",id:"PHOENIX;3"},AttributeModifiers:[]}', + 'utf8' + ) + ) +); */ + +// import _ from 'lodash'; + +// const str = +// '{overrideMeta:1b,HideFlags:254,SkullOwner:{Id:"4173bc61-9e2f-3c84-8d31-4517e64062ab",Properties:{textures:[0:{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjNhYWY3YjFhNzc4OTQ5Njk2Y2I5OWQ0ZjA0YWQxYWE1MThjZWVlMjU2YzcyZTVlZDY1YmZhNWMyZDg4ZDllIn19fQ=="}]}},display:{Lore:[0:"§8Combat Pet",1:"",2:"§7Intelligence: §a{INTELLIGENCE}",3:"§7Strength: §a{STRENGTH}",4:"",5:"§6Rekindle",6:"§7§7Before death, become §eimmune",7:"§e§7and gain §c{0} §c❁ Strength",8:"§c§7for §a{1} §7seconds",9:"§83 minutes cooldown",10:"",11:"§6Fourth Flare",12:"§7§7On 4th melee strike, §6ignite",13:"§6§7mobs, dealing §c{4}x §7your",14:"§7§9☠ Crit Damage §7each second",15:"§7for §a{5} §7seconds",16:"",17:"§7§eRight-click to add this pet to",18:"§eyour pet menu!",19:"",20:"§5§lEPIC"],Name:"§f§f§7[Lvl {LVL}] §5Phoenix"},ExtraAttributes:{petInfo:"{\\"type\\":\\"PHOENIX\\",\\"active\\":false,\\"exp\\":0.0,\\"tier\\":\\"EPIC\\",\\"hideInfo\\":false}",id:"PHOENIX;3"},AttributeModifiers:[]}'.replaceAll( +// /([0-9]{1,3}:)(["{])/g, +// '$2' +// ); + +// console.log(str); + +// console.dir( +// _.chunk( +// str.split('').map((v, i) => [i, v]), +// 10 +// ).map((v) => [v[0][0], v.map((v) => v[1]).join('')]), +// { maxArrayLength: Infinity, compact: 100 } +// ); + +// console.dir(parse(str)); diff --git a/src/tasks/cache/updateNeuItemCache.ts b/src/tasks/cache/updateNeuItemCache.ts new file mode 100644 index 0000000..fff9e08 --- /dev/null +++ b/src/tasks/cache/updateNeuItemCache.ts @@ -0,0 +1,12 @@ +import { BushTask, Time } from '#lib'; + +export default class UpdatePriceItemCache extends BushTask { + public constructor() { + super('updatePriceItemCache', { + delay: 1 * Time.Hour, + runOnStart: true + }); + } + + public async exec() {} +} diff --git a/tsconfig.json b/tsconfig.json index eb23517..ed3f116 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,24 +18,26 @@ "forceConsistentCasingInFileNames": true, "allowSyntheticDefaultImports": true, "preserveValueImports": true, - "removeComments": true, - "paths": { - "#lib": ["./src/lib/index.ts"], - "#constants": ["./src/lib/utils/BushConstants.ts"], - "#args": ["./src/arguments/index.ts"], - "#commands": ["./src/commands/index.ts"], - "#tags": ["./src/lib/common/tags.js"] - } + "removeComments": true + // "paths": { + // "#lib": ["./src/lib/index.ts"], + // "#constants": ["./src/lib/utils/BushConstants.ts"], + // "#args": ["./src/arguments/index.ts"], + // "#commands": ["./src/commands/index.ts"], + // "#tags": ["./src/lib/common/tags.js"] + // } }, "include": [ - "src/**/*.ts", - "src/**/*d.ts", - "lib/**/*.ts", - "ecosystem.config.cjs", - ".eslintrc.cjs", - "config/**/*.ts", - "tests/**/*.ts", - "vite.config.ts" + // "src/**/*.ts", + // "src/**/*d.ts", + // "lib/**/*.ts", + // "ecosystem.config.cjs", + // ".eslintrc.cjs", + // "config/**/*.ts", + // "tests/**/*.ts", + "vite.config.ts", + "src/bot.ts", + "src/lib/common/util/Minecraft.ts" ], "exclude": ["dist", "node_modules"] } diff --git a/vite.config.ts b/vite.config.ts index 58e1d1c..5bb079e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,9 @@ -import { defineConfig } from 'vitest/config'; +// import { defineConfig } from 'vitest/config'; -export default defineConfig({ - test: { - include: ['./tests/**/*.test.ts'] - } -}); +// export default defineConfig({ +// test: { +// include: ['./tests/**/*.test.ts'] +// } +// }); + +export {}; diff --git a/yarn.lock b/yarn.lock index 311d506..f2c1f57 100644 --- a/yarn.lock +++ b/yarn.lock @@ -126,6 +126,13 @@ __metadata: languageName: node linkType: hard +"@ironm00n/nbt-ts@npm:^1.4.0": + version: 1.4.0 + resolution: "@ironm00n/nbt-ts@npm:1.4.0" + checksum: c518403b261668fe077b2e202acb6b9c597cdefc4453d5a13fee40dc90dadc1c8e651b47f7ac1e3036b317d7a1998428a69762552179815c57923175c538bbb1 + languageName: node + linkType: hard + "@mapbox/node-pre-gyp@npm:^1.0.0": version: 1.0.9 resolution: "@mapbox/node-pre-gyp@npm:1.0.9" @@ -1122,6 +1129,7 @@ __metadata: dependencies: "@discordjs/builders": ^0.15.0 "@discordjs/rest": ^0.5.0 + "@ironm00n/nbt-ts": ^1.4.0 "@notenoughupdates/discord.js-minesweeper": ^1.0.10 "@notenoughupdates/events-intercept": ^3.0.1 "@notenoughupdates/humanize-duration": ^4.0.1 -- cgit From 7bdeccaeb4976a997d0d483481b29000795a92a9 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 14 Jul 2022 11:17:52 -0400 Subject: this is very boring --- src/lib/common/util/Minecraft.ts | 140 +++++++++++++++++++++++---------------- 1 file changed, 84 insertions(+), 56 deletions(-) diff --git a/src/lib/common/util/Minecraft.ts b/src/lib/common/util/Minecraft.ts index fbacbf0..b4b013f 100644 --- a/src/lib/common/util/Minecraft.ts +++ b/src/lib/common/util/Minecraft.ts @@ -136,29 +136,28 @@ for (const path_ of items) { // const randomItem = items[Math.floor(Math.random() * items.length)]; // console.log(randomItem); const item = (await import(path.join(itemPath, /* randomItem */ path_), { assert: { type: 'json' } })).default as RawNeuItem; - if (item.displayname.includes('(Monster)') || item.displayname.includes('(NPC)')) continue; + if (/.*?((_MONSTER)|(_NPC)|(_ANIMAL)|(_MINIBOSS)|(_BOSS)|(_SC))$/.test(item.internalname)) continue; + if (!/.*?;[0-5]$/.test(item.internalname)) continue; /* console.log(path_); console.dir(item, { depth: Infinity }); */ /* console.log('==========='); */ - const nbt = /* fn( */ parse(item.nbttag /* .replaceAll(/([0-9]{1,3}:)(["{])/g, '$2'), { useMaps: true } */) as any; /*); */ + const nbt = parse(item.nbttag) as NbtTag; + + if (nbt?.SkullOwner?.Properties?.textures?.[0]?.Value) { + nbt.SkullOwner.Properties.textures[0].Value = parse( + Buffer.from(nbt.SkullOwner.Properties.textures[0].Value, 'base64').toString('utf-8') + ) as string; + } + + if (nbt.ExtraAttributes?.petInfo) { + nbt.ExtraAttributes.petInfo = JSON.parse(nbt.ExtraAttributes.petInfo as any as string); + } + + // delete nbt.display?.Lore; + console.dir(nbt, { depth: Infinity }); console.log('==========='); - // console.dir((nbt.(item.nbttag))); - - /* // eslint-disable-next-line no-inner-declarations - function fn(map: TagMap) { - const ret = {} as any; - map.forEach((val, key) => { - function fn2(val: any): any { - if (val instanceof Map) return fn(val); - else if (Array.isArray(val)) return val.map((v) => fn2(v)); - else return val.valueOf(); - } - ret[key] = fn2(val); - }); - return ret; - } */ /* if (nbt?.display && nbt.display.Name !== item.displayname) console.log(`${path_} display name mismatch: ${mcToAnsi(nbt.display.Name)} != ${mcToAnsi(item.displayname)}`); @@ -228,6 +227,7 @@ interface SkullOwner { interface NbtTagDisplay { Lore?: string[]; + color?: Int; Name?: string; } @@ -241,24 +241,86 @@ interface ExtraAttributes { enchantments?: { hardened_mana?: Int }; dungeon_item_level?: Int; runes?: { [key: RuneId]: Int }; + petInfo?: PetInfo; +} + +interface PetInfo { + type: 'ZOMBIE'; + active: boolean; + exp: number; + tier: 'COMMON' | 'UNCOMMON' | 'RARE' | 'EPIC' | 'LEGENDARY'; + hideInfo: boolean; + candyUsed: number; } type Origin = 'SHOP_PURCHASE'; +const neuConstantsPath = path.join(repo, 'constants'); +const neuPetsPath = path.join(neuConstantsPath, 'pets.json'); +const neuPets = (await import(neuPetsPath, { assert: { type: 'json' } })) as PetsConstants; +const neuPetNumsPath = path.join(neuConstantsPath, 'petnums.json'); +const neuPetNums = (await import(neuPetNumsPath, { assert: { type: 'json' } })) as PetNums; + +interface PetsConstants { + pet_rarity_offset: Record; + pet_levels: number[]; + custom_pet_leveling: Record; + pet_types: Record; +} + +interface PetNums { + [key: string]: { + [key: string]: { + '1': { + otherNums: number[]; + statNums: Record; + }; + '100': { + otherNums: number[]; + statNums: Record; + }; + 'stats_levelling_curve'?: `${number};${number};${number}`; + }; + }; +} + class NeuItem { - public itemId: string; + public itemId: McItemId; + public displayName: string; public nbtTag: NbtTag; + public internalName: SbItemId; + public lore: string[]; public constructor(raw: RawNeuItem) { this.itemId = raw.itemid; this.nbtTag = parse(raw.nbttag); - } + this.displayName = raw.displayname; + this.internalName = raw.internalname; + this.lore = raw.lore; - public get lore(): string { - return ''; + this.petLoreReplacements(); } - private pet() {} + private petLoreReplacements(level = -1) { + if (/.*?;[0-5]$/.test(this.internalName) && this.displayName.includes('LVL')) { + const maxLevel = neuPets?.custom_pet_leveling?.[this.internalName]?.max_level ?? 100; + this.displayName = this.displayName.replace('LVL', `1➡${maxLevel}`); + + const nums = neuPetNums[this.internalName]; + if (!nums) throw new Error(`Pet (${this.internalName}) has no pet nums.`); + + const teir = ['COMMON', 'UNCOMMON', 'RARE', 'EPIC', 'LEGENDARY', 'MYTHIC'][+this.internalName.at(-1)!]; + const petInfoTier = nums[teir]; + if (!petInfoTier) throw new Error(`Pet (${this.internalName}) has no pet nums for ${teir} rarity.`); + + const curve = petInfoTier?.stats_levelling_curve?.split(';'); + + const minStatsLevel = parseInt(curve?.[0] ?? '0'); + const maxStatsLevel = parseInt(curve?.[0] ?? '100'); + + const lore = ''; + } + } } function mcToAnsi(str: string) { @@ -267,37 +329,3 @@ function mcToAnsi(str: string) { } return `${str}\u001b[0m`; } - -const neuConstantsPath = path.join(repo, 'constants'); -const neuPetsPath = path.join(neuConstantsPath, 'pets.json'); -const neuPets = await import(neuPetsPath, { assert: { type: 'json' } }); - -// console.dir(await nbt.parse(buffer)); -/* console.dir( - await nbt.parse( - Buffer.from( - '{overrideMeta:1b,HideFlags:254,SkullOwner:{Id:"4173bc61-9e2f-3c84-8d31-4517e64062ab",Properties:{textures:[0:{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjNhYWY3YjFhNzc4OTQ5Njk2Y2I5OWQ0ZjA0YWQxYWE1MThjZWVlMjU2YzcyZTVlZDY1YmZhNWMyZDg4ZDllIn19fQ=="}]}},display:{Lore:[0:"§8Combat Pet",1:"",2:"§7Intelligence: §a{INTELLIGENCE}",3:"§7Strength: §a{STRENGTH}",4:"",5:"§6Rekindle",6:"§7§7Before death, become §eimmune",7:"§e§7and gain §c{0} §c❁ Strength",8:"§c§7for §a{1} §7seconds",9:"§83 minutes cooldown",10:"",11:"§6Fourth Flare",12:"§7§7On 4th melee strike, §6ignite",13:"§6§7mobs, dealing §c{4}x §7your",14:"§7§9☠ Crit Damage §7each second",15:"§7for §a{5} §7seconds",16:"",17:"§7§eRight-click to add this pet to",18:"§eyour pet menu!",19:"",20:"§5§lEPIC"],Name:"§f§f§7[Lvl {LVL}] §5Phoenix"},ExtraAttributes:{petInfo:"{\\"type\\":\\"PHOENIX\\",\\"active\\":false,\\"exp\\":0.0,\\"tier\\":\\"EPIC\\",\\"hideInfo\\":false}",id:"PHOENIX;3"},AttributeModifiers:[]}', - 'utf8' - ) - ) -); */ - -// import _ from 'lodash'; - -// const str = -// '{overrideMeta:1b,HideFlags:254,SkullOwner:{Id:"4173bc61-9e2f-3c84-8d31-4517e64062ab",Properties:{textures:[0:{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjNhYWY3YjFhNzc4OTQ5Njk2Y2I5OWQ0ZjA0YWQxYWE1MThjZWVlMjU2YzcyZTVlZDY1YmZhNWMyZDg4ZDllIn19fQ=="}]}},display:{Lore:[0:"§8Combat Pet",1:"",2:"§7Intelligence: §a{INTELLIGENCE}",3:"§7Strength: §a{STRENGTH}",4:"",5:"§6Rekindle",6:"§7§7Before death, become §eimmune",7:"§e§7and gain §c{0} §c❁ Strength",8:"§c§7for §a{1} §7seconds",9:"§83 minutes cooldown",10:"",11:"§6Fourth Flare",12:"§7§7On 4th melee strike, §6ignite",13:"§6§7mobs, dealing §c{4}x §7your",14:"§7§9☠ Crit Damage §7each second",15:"§7for §a{5} §7seconds",16:"",17:"§7§eRight-click to add this pet to",18:"§eyour pet menu!",19:"",20:"§5§lEPIC"],Name:"§f§f§7[Lvl {LVL}] §5Phoenix"},ExtraAttributes:{petInfo:"{\\"type\\":\\"PHOENIX\\",\\"active\\":false,\\"exp\\":0.0,\\"tier\\":\\"EPIC\\",\\"hideInfo\\":false}",id:"PHOENIX;3"},AttributeModifiers:[]}'.replaceAll( -// /([0-9]{1,3}:)(["{])/g, -// '$2' -// ); - -// console.log(str); - -// console.dir( -// _.chunk( -// str.split('').map((v, i) => [i, v]), -// 10 -// ).map((v) => [v[0][0], v.map((v) => v[1]).join('')]), -// { maxArrayLength: Infinity, compact: 100 } -// ); - -// console.dir(parse(str)); -- cgit From 9247fa8c65174eb35fbfe3cd9d4167f9cf9ce17a Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 15 Jul 2022 17:24:14 -0400 Subject: upgrade deps --- package.json | 16 +++---- src/bot.ts | 46 +++++++++----------- tsconfig.json | 30 ++++++------- yarn.lock | 134 +++++++++++++++++++++++++++++----------------------------- 4 files changed, 110 insertions(+), 116 deletions(-) diff --git a/package.json b/package.json index c1882bc..e858ae6 100644 --- a/package.json +++ b/package.json @@ -66,9 +66,9 @@ "@notenoughupdates/humanize-duration": "^4.0.1", "@notenoughupdates/simplify-number": "^1.0.1", "@notenoughupdates/wolfram-alpha-api": "^1.0.2", - "@sentry/integrations": "^7.5.1", - "@sentry/node": "^7.5.1", - "@sentry/tracing": "^7.5.1", + "@sentry/integrations": "^7.7.0", + "@sentry/node": "^7.7.0", + "@sentry/tracing": "^7.7.0", "canvas": "^2.9.3", "chalk": "^5.0.1", "deep-lock": "^1.0.0", @@ -88,18 +88,18 @@ "prettier": "^2.7.1", "pretty-bytes": "^6.0.0", "rimraf": "^3.0.2", - "sequelize": "6.21.2", + "sequelize": "6.21.3", "tinycolor2": "^1.4.2", "typescript": "^4.7.4", "vm2": "^3.9.10" }, "devDependencies": { "@sapphire/snowflake": "^3.2.2", - "@sentry/types": "^7.5.1", + "@sentry/types": "^7.7.0", "@types/eslint": "^8.4.5", "@types/express": "^4.17.13", "@types/lodash": "^4.14.182", - "@types/node": "^18.0.3", + "@types/node": "^18.0.4", "@types/numeral": "^2.0.2", "@types/pg": "^8.6.5", "@types/prettier": "^2.6.3", @@ -112,9 +112,9 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-deprecation": "^1.3.2", "eslint-plugin-import": "^2.26.0", - "node-fetch": "^3.2.6", + "node-fetch": "^3.2.8", "ts-essentials": "^9.2.0", - "vitest": "^0.17.1" + "vitest": "^0.18.0" }, "packageManager": "yarn@3.2.1" } diff --git a/src/bot.ts b/src/bot.ts index 640f2ab..038fbbb 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -1,29 +1,23 @@ -// import { init } from './lib/utils/BushLogger.js'; -// // creates proxies on console.log and console.warn -// // also starts a REPL session -// init(); +import { init } from './lib/utils/BushLogger.js'; +// creates proxies on console.log and console.warn +// also starts a REPL session +init(); -// eslint-disable-next-line no-constant-condition -if (false) { - // const { dirname } = await import('path'); - // const { fileURLToPath } = await import('url'); - // const { default: config } = await import('../config/options.js'); - // const { Sentry } = await import('./lib/common/Sentry.js'); - // const { BushClient } = await import('./lib/index.js'); - // - // const isDry = process.argv.includes('dry'); - // if (!isDry && config.credentials.sentryDsn !== null) - // new Sentry(dirname(fileURLToPath(import.meta.url)) || process.cwd(), config); - // BushClient.extendStructures(); - // const client = new BushClient(config); - // if (!isDry) await client.dbPreInit(); - // await client.init(); - // if (isDry) { - // await client.destroy(); - // process.exit(0); - // } else { - // await client.start(); - // } +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import { default as config } from '../config/options.js'; +import { Sentry } from './lib/common/Sentry.js'; +import { BushClient } from './lib/index.js'; + +const isDry = process.argv.includes('dry'); +if (!isDry && config.credentials.sentryDsn !== null) new Sentry(dirname(fileURLToPath(import.meta.url)) || process.cwd(), config); +BushClient.extendStructures(); +const client = new BushClient(config); +if (!isDry) await client.dbPreInit(); +await client.init(); +if (isDry) { + await client.destroy(); + process.exit(0); } else { - import('./lib/common/util/Minecraft.js'); + await client.start(); } diff --git a/tsconfig.json b/tsconfig.json index ed3f116..565346b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,23 +18,23 @@ "forceConsistentCasingInFileNames": true, "allowSyntheticDefaultImports": true, "preserveValueImports": true, - "removeComments": true - // "paths": { - // "#lib": ["./src/lib/index.ts"], - // "#constants": ["./src/lib/utils/BushConstants.ts"], - // "#args": ["./src/arguments/index.ts"], - // "#commands": ["./src/commands/index.ts"], - // "#tags": ["./src/lib/common/tags.js"] - // } + "removeComments": true, + "paths": { + "#lib": ["./src/lib/index.ts"], + "#constants": ["./src/lib/utils/BushConstants.ts"], + "#args": ["./src/arguments/index.ts"], + "#commands": ["./src/commands/index.ts"], + "#tags": ["./src/lib/common/tags.js"] + } }, "include": [ - // "src/**/*.ts", - // "src/**/*d.ts", - // "lib/**/*.ts", - // "ecosystem.config.cjs", - // ".eslintrc.cjs", - // "config/**/*.ts", - // "tests/**/*.ts", + "src/**/*.ts", + "src/**/*d.ts", + "lib/**/*.ts", + "ecosystem.config.cjs", + ".eslintrc.cjs", + "config/**/*.ts", + "tests/**/*.ts", "vite.config.ts", "src/bot.ts", "src/lib/common/util/Minecraft.ts" diff --git a/yarn.lock b/yarn.lock index f2c1f57..63b0c6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -255,83 +255,83 @@ __metadata: languageName: node linkType: hard -"@sentry/core@npm:7.5.1": - version: 7.5.1 - resolution: "@sentry/core@npm:7.5.1" +"@sentry/core@npm:7.7.0": + version: 7.7.0 + resolution: "@sentry/core@npm:7.7.0" dependencies: - "@sentry/hub": 7.5.1 - "@sentry/types": 7.5.1 - "@sentry/utils": 7.5.1 + "@sentry/hub": 7.7.0 + "@sentry/types": 7.7.0 + "@sentry/utils": 7.7.0 tslib: ^1.9.3 - checksum: 90613800c95bd17075b33ed8f76a2cf18a2fd03e9c1b244ee7a846f0e0b738b84a199bc7c085d62c8e9043913024169e45cb925a03b36cf77d064caf8e7e05fd + checksum: d3b9b5a92a9182bae7f39eef01502dd542d5be7365632ea9e26aa5247c90fd72e620856b20a393f4d3eeadb27f3b744bf25be93b1fdc4f7457a894e290c41fb0 languageName: node linkType: hard -"@sentry/hub@npm:7.5.1": - version: 7.5.1 - resolution: "@sentry/hub@npm:7.5.1" +"@sentry/hub@npm:7.7.0": + version: 7.7.0 + resolution: "@sentry/hub@npm:7.7.0" dependencies: - "@sentry/types": 7.5.1 - "@sentry/utils": 7.5.1 + "@sentry/types": 7.7.0 + "@sentry/utils": 7.7.0 tslib: ^1.9.3 - checksum: 6b00f2ef5fb12f94d5844f3abef9a84ec79d4f19d8347e8e8b8c06719c2d84d06963bb94e09305deb76640231ca1ed34dd4b2c63ff447fdb8fa16c22ac022484 + checksum: 0683ae6da7d961e6bbb90ad1fded3b33cd9fc76dc54a080902a83bd7769991294ce8017277f5e0d145fcf9f2ad53ae89d3b0c7619fa0586c8513f4b585f14f6d languageName: node linkType: hard -"@sentry/integrations@npm:^7.5.1": - version: 7.5.1 - resolution: "@sentry/integrations@npm:7.5.1" +"@sentry/integrations@npm:^7.7.0": + version: 7.7.0 + resolution: "@sentry/integrations@npm:7.7.0" dependencies: - "@sentry/types": 7.5.1 - "@sentry/utils": 7.5.1 + "@sentry/types": 7.7.0 + "@sentry/utils": 7.7.0 localforage: ^1.8.1 tslib: ^1.9.3 - checksum: 13b4cb068e09f5208fbb750aa569453956a7f5cc4093e4e3485a92bac74b0c77a056c39b51395a2bc307cbb02cbde3b989bb985aaa849d87eed6ee853bfd33b6 + checksum: cd24f34301c55069e8487adc6d9b3c61e9f4f7284a01d4e9954324695f15b74806303cf53bd2e88db325289c057d2b33546986ed240b022f6d170cada94a0cab languageName: node linkType: hard -"@sentry/node@npm:^7.5.1": - version: 7.5.1 - resolution: "@sentry/node@npm:7.5.1" +"@sentry/node@npm:^7.7.0": + version: 7.7.0 + resolution: "@sentry/node@npm:7.7.0" dependencies: - "@sentry/core": 7.5.1 - "@sentry/hub": 7.5.1 - "@sentry/types": 7.5.1 - "@sentry/utils": 7.5.1 + "@sentry/core": 7.7.0 + "@sentry/hub": 7.7.0 + "@sentry/types": 7.7.0 + "@sentry/utils": 7.7.0 cookie: ^0.4.1 https-proxy-agent: ^5.0.0 lru_map: ^0.3.3 tslib: ^1.9.3 - checksum: a8caa39edb923952a551a9609afb933c1753e5e6cf1a8eccb9b1f4adb6567356d3077d3319b266e502a3183f1cf402847ade0967217522a408f9c1640a220f02 + checksum: 554f4165f7cee16c70eca1e4e42d354330bcfcbf157bfbcdf4a17e89393f0c39f042cfaa07ba51ebb8391bbf2091d8dc6108a81650a60d39632d3b6a1edafe6f languageName: node linkType: hard -"@sentry/tracing@npm:^7.5.1": - version: 7.5.1 - resolution: "@sentry/tracing@npm:7.5.1" +"@sentry/tracing@npm:^7.7.0": + version: 7.7.0 + resolution: "@sentry/tracing@npm:7.7.0" dependencies: - "@sentry/hub": 7.5.1 - "@sentry/types": 7.5.1 - "@sentry/utils": 7.5.1 + "@sentry/hub": 7.7.0 + "@sentry/types": 7.7.0 + "@sentry/utils": 7.7.0 tslib: ^1.9.3 - checksum: cf70120946a1d4a337e05b2035ab7a2b00755f638006250d003dbf6badf1fba066f0abfc19689b60d4e6143e99616f4ada0d564376aec2d48a5171c6b9c871c8 + checksum: c3884c297e87284ab73f103338dfb2f8dc2d2fcf641981650ad72009f1d7a41292ded048a7283b57a66f730d8d7cb8932bb6ee64e8b512b33de08da8867a58fe languageName: node linkType: hard -"@sentry/types@npm:7.5.1, @sentry/types@npm:^7.5.1": - version: 7.5.1 - resolution: "@sentry/types@npm:7.5.1" - checksum: 2ff669f0e6c6ea5020c117a15012ec55147033faebbc0708c1a772aabf9cf6e283d69556903a9213e96b188b0a5f7030ded7006ad8805b2a89a6442d36202b21 +"@sentry/types@npm:7.7.0, @sentry/types@npm:^7.7.0": + version: 7.7.0 + resolution: "@sentry/types@npm:7.7.0" + checksum: 1f26c23617e9370cf32269ea5d5aa0f75fe86c34aede4fc07ae3bdae08803a788d628d0bba6f2e22c03d0430dcf63cc19453468ae086406448da07e13f36da70 languageName: node linkType: hard -"@sentry/utils@npm:7.5.1": - version: 7.5.1 - resolution: "@sentry/utils@npm:7.5.1" +"@sentry/utils@npm:7.7.0": + version: 7.7.0 + resolution: "@sentry/utils@npm:7.7.0" dependencies: - "@sentry/types": 7.5.1 + "@sentry/types": 7.7.0 tslib: ^1.9.3 - checksum: 567fdba09fdbfc62b0e50f5099d82b075f4e5ebd7dace67c4379a9f65c12e7191aad526fbc955ee681da757c8332807bda74a50880c4576c4c39d97c2c49e91d + checksum: 990224e0542015952a4f1fa83dd69c82a3a85894576457f10bc3c0c60620c675969424bdbfde9872a19a5db2b682dd1d51c67ec99f0c57acfc993e6f7c970aaf languageName: node linkType: hard @@ -536,10 +536,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^18.0.3": - version: 18.0.3 - resolution: "@types/node@npm:18.0.3" - checksum: 5dec59fbbc1186c808b53df1ca717dad034dbd6a901c75f5b052c845618b531b05f27217122c6254db99529a68618e4cfc534ae3dbf4e88754e9e572df80defa +"@types/node@npm:^18.0.4": + version: 18.0.4 + resolution: "@types/node@npm:18.0.4" + checksum: 981284fd57941f233f0e77038087c122f56e3c2b4fc4e090dfc7f0a93abfc526d5ccdd59eb3ef551d713245cf3943e37c7b957f12ba699209341a447c39fab59 languageName: node linkType: hard @@ -1136,14 +1136,14 @@ __metadata: "@notenoughupdates/simplify-number": ^1.0.1 "@notenoughupdates/wolfram-alpha-api": ^1.0.2 "@sapphire/snowflake": ^3.2.2 - "@sentry/integrations": ^7.5.1 - "@sentry/node": ^7.5.1 - "@sentry/tracing": ^7.5.1 - "@sentry/types": ^7.5.1 + "@sentry/integrations": ^7.7.0 + "@sentry/node": ^7.7.0 + "@sentry/tracing": ^7.7.0 + "@sentry/types": ^7.7.0 "@types/eslint": ^8.4.5 "@types/express": ^4.17.13 "@types/lodash": ^4.14.182 - "@types/node": ^18.0.3 + "@types/node": ^18.0.4 "@types/numeral": ^2.0.2 "@types/pg": ^8.6.5 "@types/prettier": ^2.6.3 @@ -1169,18 +1169,18 @@ __metadata: lodash: ^4.17.21 mathjs: ^10.6.4 nanoid: ^4.0.0 - node-fetch: ^3.2.6 + node-fetch: ^3.2.8 numeral: ^2.0.6 pg: ^8.7.3 pg-hstore: ^2.3.4 prettier: ^2.7.1 pretty-bytes: ^6.0.0 rimraf: ^3.0.2 - sequelize: 6.21.2 + sequelize: 6.21.3 tinycolor2: ^1.4.2 ts-essentials: ^9.2.0 typescript: ^4.7.4 - vitest: ^0.17.1 + vitest: ^0.18.0 vm2: ^3.9.10 languageName: unknown linkType: soft @@ -3679,14 +3679,14 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^3.2.6": - version: 3.2.6 - resolution: "node-fetch@npm:3.2.6" +"node-fetch@npm:^3.2.8": + version: 3.2.8 + resolution: "node-fetch@npm:3.2.8" dependencies: data-uri-to-buffer: ^4.0.0 fetch-blob: ^3.1.4 formdata-polyfill: ^4.0.10 - checksum: ece307ace3a3ff28638ccb0fa0545bb5c0cfd673a9d06fc314d937a73ae6a55917d5bacd7f080f9a9f1449ca20a5c01b1281d0e616acb20315e5ac315971da46 + checksum: 2f7fc3e59fbede43a273e988d2f2a3dd68160618114e32ad537477db253808b65221f1dbfd666b8fb33ff07bf1de9d6448035b0f8ada5ef876c5afec93b27318 languageName: node linkType: hard @@ -4444,9 +4444,9 @@ __metadata: languageName: node linkType: hard -"sequelize@npm:6.21.2": - version: 6.21.2 - resolution: "sequelize@npm:6.21.2" +"sequelize@npm:6.21.3": + version: 6.21.3 + resolution: "sequelize@npm:6.21.3" dependencies: "@types/debug": ^4.1.7 "@types/validator": ^13.7.1 @@ -4481,7 +4481,7 @@ __metadata: optional: true tedious: optional: true - checksum: 5486ec15e80cf51e49d819c2495a05a17b5a0102866ca0af054dbc4a625d2dc6200e36189261e50234625fcf4da5cbc973eb9900591a5b9e9f63c67955196f56 + checksum: 85a57cdde00edc5e1634585aacda874eeab9cc0d6d296e5ae90be3d861cba682bacde427009600d331fec82396520621a16a27d1958c689dd197d9d88051cf7e languageName: node linkType: hard @@ -5060,9 +5060,9 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^0.17.1": - version: 0.17.1 - resolution: "vitest@npm:0.17.1" +"vitest@npm:^0.18.0": + version: 0.18.0 + resolution: "vitest@npm:0.18.0" dependencies: "@types/chai": ^4.3.1 "@types/chai-subset": ^1.3.3 @@ -5092,7 +5092,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: eae2d024d97a46ba08f3cc7e0703a330c92dc0a6f4c7a9bc20ec8a5129bf787d8ebabd14bf31ae810897c1813e29178af59f63ec8b24b5944cfa62e225cd207c + checksum: 20e76b0de9f02dd09a412b11e5898d1ec7c5c9f9287da40a79fde98f6bd100db6f777fb5f1370496a2c153277cc5eb6738e176435101332fce1c87a565e62d5f languageName: node linkType: hard -- cgit From e4206aaa9211e792660b4015551519d633409355 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 20:10:42 -0400 Subject: random stuff --- .eslintrc.cjs | 9 +- package.json | 21 +- src/commands/info/inviteInfo.ts | 6 +- src/commands/utilities/highlight-!.ts | 5 +- src/lib/utils/BushLogger.ts | 58 ++- src/tasks/cache/updateNeuItemCache.ts | 4 +- yarn.lock | 800 ++++++++++++++++++++++++++++------ 7 files changed, 718 insertions(+), 185 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 9a6837f..e2d7435 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -115,17 +115,20 @@ const globals = [ 'btoa', 'createImageBitmap', 'fetch', 'queueMicrotask', 'sessionStorage', 'addEventListener', 'removeEventListener' ] +/** + * @type {import('eslint').Linter.Config} + */ module.exports = { env: { - es2021: true, + es2022: true, node: true }, extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], parser: '@typescript-eslint/parser', parserOptions: { - ecmaVersion: 12, + ecmaVersion: 'latest', sourceType: 'module', - project: './tsconfig.json' + project: './tsconfig.eslint.json' }, plugins: ['@typescript-eslint', 'deprecation', 'import'], ignorePatterns: ['dist'], diff --git a/package.json b/package.json index e858ae6..faa2706 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "license": "CC-BY-NC-SA-4.0", "scripts": { "build:esbuild": "yarn rimraf dist && yarn esbuild --sourcemap=inline --outdir=dist --platform=node --target=es2020 --format=esm --log-level=warning src/**/*.ts", - "build:tsc": "yarn rimraf dist && yarn tsc", + "build:tsc": "yarn tsc", "build:tsc:no-emit": "yarn tsc --noEmit", "start:raw": "node --enable-source-maps --experimental-json-modules --no-warnings dist/src/bot.js", "start:esbuild": "yarn build:esbuild && yarn start:raw", @@ -58,8 +58,8 @@ } }, "dependencies": { - "@discordjs/builders": "^0.15.0", - "@discordjs/rest": "^0.5.0", + "@discordjs/builders": "^1.0.0", + "@discordjs/rest": "^1.0.0", "@ironm00n/nbt-ts": "^1.4.0", "@notenoughupdates/discord.js-minesweeper": "^1.0.10", "@notenoughupdates/events-intercept": "^3.0.1", @@ -73,7 +73,7 @@ "chalk": "^5.0.1", "deep-lock": "^1.0.0", "discord-akairo": "npm:@notenoughupdates/discord-akairo@dev", - "discord-api-types": "0.34.0", + "discord-api-types": "0.36.2", "discord.js": "npm:@notenoughupdates/discord.js@dev", "fuse.js": "^6.6.2", "gif-to-apng": "^0.1.2", @@ -99,22 +99,23 @@ "@types/eslint": "^8.4.5", "@types/express": "^4.17.13", "@types/lodash": "^4.14.182", - "@types/node": "^18.0.4", + "@types/node": "^18.0.6", "@types/numeral": "^2.0.2", "@types/pg": "^8.6.5", "@types/prettier": "^2.6.3", "@types/rimraf": "^3.0.2", "@types/tinycolor2": "^1.4.3", "@types/validator": "^13.7.4", - "@typescript-eslint/eslint-plugin": "^5.30.5", - "@typescript-eslint/parser": "^5.30.5", - "eslint": "^8.19.0", + "@typescript-eslint/eslint-plugin": "^5.30.7", + "@typescript-eslint/parser": "^5.30.7", + "electron": "latest", + "eslint": "^8.20.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-deprecation": "^1.3.2", "eslint-plugin-import": "^2.26.0", - "node-fetch": "^3.2.8", + "node-fetch": "^3.2.9", "ts-essentials": "^9.2.0", - "vitest": "^0.18.0" + "vitest": "^0.18.1" }, "packageManager": "yarn@3.2.1" } diff --git a/src/commands/info/inviteInfo.ts b/src/commands/info/inviteInfo.ts index bfe7eae..5df86ad 100644 --- a/src/commands/info/inviteInfo.ts +++ b/src/commands/info/inviteInfo.ts @@ -28,15 +28,15 @@ export default class InviteInfoCommand extends BushCommand { public override async exec(message: CommandMessage | SlashMessage, args: { invite: ArgType<'invite' | 'string'> }) { const invite = message.util.isSlashMessage(message) ? ((await Arg.cast('invite', message, args.invite as string)) as ArgType<'invite'>) - : args.invite; + : (args.invite as Invite); - const inviteInfoEmbed = new EmbedBuilder().setTitle(`Invite to ${invite.guild.name}`).setColor(colors.default); + const inviteInfoEmbed = new EmbedBuilder().setTitle(`Invite to ${invite.guild!.name}`).setColor(colors.default); this.generateAboutField(inviteInfoEmbed, invite); } private generateAboutField(embed: EmbedBuilder, invite: Invite) { - const about = [`**code:** ${invite.code}`, `**channel:** ${}`]; + const about = [`**code:** ${invite.code}`, `**channel:** ${invite.channel!.name}`]; embed.addFields({ name: '» About', value: about.join('\n') }); } diff --git a/src/commands/utilities/highlight-!.ts b/src/commands/utilities/highlight-!.ts index b93f59a..f2ee259 100644 --- a/src/commands/utilities/highlight-!.ts +++ b/src/commands/utilities/highlight-!.ts @@ -186,10 +186,7 @@ export default class HighlightCommand extends BushCommand { throw new Error('This command is not meant to be executed directly.'); } - public override async execSlash( - message: SlashMessage, - args: { subcommand: keyof typeof highlightSubcommands; subcommandGroup?: string } - ) { + public override async execSlash(message: SlashMessage, args: { subcommand: string; subcommandGroup?: string }) { // manual `Flag.continue` const subcommand = this.handler.modules.get(`highlight-${args.subcommandGroup ?? args.subcommand}`)!; return subcommand.exec(message, args); diff --git a/src/lib/utils/BushLogger.ts b/src/lib/utils/BushLogger.ts index 5c98760..995dd82 100644 --- a/src/lib/utils/BushLogger.ts +++ b/src/lib/utils/BushLogger.ts @@ -1,6 +1,7 @@ import chalk from 'chalk'; // eslint-disable-next-line @typescript-eslint/no-unused-vars -import { Client, EmbedBuilder, escapeMarkdown, PartialTextBasedChannelFields, type Message } from 'discord.js'; +import { Client, EmbedBuilder, escapeMarkdown, Formatters, PartialTextBasedChannelFields, type Message } from 'discord.js'; +import { stripVTControlCharacters as stripColor } from 'node:util'; import repl, { REPLServer, REPL_MODE_STRICT } from 'repl'; import { WriteStream } from 'tty'; import { type SendMessageType } from '../extensions/discord-akairo/BushClient.js'; @@ -72,16 +73,16 @@ function parseFormatting( discordFormat = false ): string | typeof content { if (typeof content !== 'string') return content; - const newContent: Array = content.split(/<<|>>/); - const tempParsedArray: Array = []; - newContent.forEach((value, index) => { - if (index % 2 !== 0) { - tempParsedArray.push(discordFormat ? `**${escapeMarkdown(value)}**` : color ? chalk[color](value) : value); - } else { - tempParsedArray.push(discordFormat ? escapeMarkdown(value) : value); - } - }); - return tempParsedArray.join(''); + return content + .split(/<<|>>/) + .map((value, index) => { + if (discordFormat) { + return index % 2 === 0 ? escapeMarkdown(value) : Formatters.bold(escapeMarkdown(value)); + } else { + return index % 2 === 0 || !color ? value : chalk[color](value); + } + }) + .join(''); } /** @@ -98,34 +99,25 @@ function inspectContent(content: any, depth = 2, colors = true): string { return content; } -/** - * Strips ANSI color codes from a string. - * @param text The string to strip color codes from. - * @returns A string without ANSI color codes. - */ -function stripColor(text: string): string { - return text.replace( - // eslint-disable-next-line no-control-regex - /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, - '' - ); -} - /** * Generates a formatted timestamp for logging. * @returns The formatted timestamp. */ function getTimeStamp(): string { const now = new Date(); - const hours = now.getHours(); - const minute = now.getMinutes(); - let hour = hours; - let amOrPm: 'AM' | 'PM' = 'AM'; - if (hour > 12) { - amOrPm = 'PM'; - hour = hour - 12; - } - return `${hour >= 10 ? hour : `0${hour}`}:${minute >= 10 ? minute : `0${minute}`} ${amOrPm}`; + const minute = pad(now.getMinutes()); + const hour = pad(now.getHours() % 12); + const meridiem = now.getHours() > 12 ? 'PM' : 'AM'; + const year = now.getFullYear().toString().slice(2).padStart(2, '0'); + const date = `${pad(now.getMonth() + 1)}/${pad(now.getDay())}/${year}`; + return `${date} ${hour}:${minute} ${meridiem}`; +} + +/** + * Pad a two-digit number. + */ +function pad(num: number) { + return num.toString().padStart(2, '0'); } /** diff --git a/src/tasks/cache/updateNeuItemCache.ts b/src/tasks/cache/updateNeuItemCache.ts index fff9e08..14c107b 100644 --- a/src/tasks/cache/updateNeuItemCache.ts +++ b/src/tasks/cache/updateNeuItemCache.ts @@ -1,8 +1,8 @@ import { BushTask, Time } from '#lib'; -export default class UpdatePriceItemCache extends BushTask { +export default class UpdateNeuItemCache extends BushTask { public constructor() { - super('updatePriceItemCache', { + super('updateNeuItemCache', { delay: 1 * Time.Hour, runOnStart: true }); diff --git a/yarn.lock b/yarn.lock index 63b0c6d..0e266d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,20 +14,6 @@ __metadata: languageName: node linkType: hard -"@discordjs/builders@npm:^0.15.0": - version: 0.15.0 - resolution: "@discordjs/builders@npm:0.15.0" - dependencies: - "@sapphire/shapeshift": ^3.1.0 - "@sindresorhus/is": ^4.6.0 - discord-api-types: ^0.33.3 - fast-deep-equal: ^3.1.3 - ts-mixer: ^6.0.1 - tslib: ^2.4.0 - checksum: 1a8a4ffe048243ebb9fbbc76a113e4994c68904a5b3d256a6b10c0123f1d0fb58b45809d134ba993293fb2190c9f3506663ddfb5068a86ec6b9c53b5db61f6a6 - languageName: node - linkType: hard - "@discordjs/builders@npm:^0.16.0-dev": version: 0.16.0-dev.1655510999-2681929 resolution: "@discordjs/builders@npm:0.16.0-dev.1655510999-2681929" @@ -42,10 +28,16 @@ __metadata: languageName: node linkType: hard -"@discordjs/collection@npm:^0.7.0": - version: 0.7.0 - resolution: "@discordjs/collection@npm:0.7.0" - checksum: 141aa35a5433bacba3617b533557b4948388c7b59cdaecee51ccd721c1b9242e50d95bdef53ee2491535a017095f5072ace3c3e9e594193f67a1c5a8a4b7db93 +"@discordjs/builders@npm:^1.0.0": + version: 1.0.0 + resolution: "@discordjs/builders@npm:1.0.0" + dependencies: + "@sapphire/shapeshift": ^3.5.1 + discord-api-types: ^0.36.2 + fast-deep-equal: ^3.1.3 + ts-mixer: ^6.0.1 + tslib: ^2.4.0 + checksum: eeb627c772a2bd1fea1bddd58d46d391c30d0e2411cc3976386b7efc2048724e6bfd204ba848724ebd6d04791b358637c3a9eee878f924ef525c4920bfbfa2de languageName: node linkType: hard @@ -56,17 +48,10 @@ __metadata: languageName: node linkType: hard -"@discordjs/rest@npm:^0.5.0": - version: 0.5.0 - resolution: "@discordjs/rest@npm:0.5.0" - dependencies: - "@discordjs/collection": ^0.7.0 - "@sapphire/async-queue": ^1.3.1 - "@sapphire/snowflake": ^3.2.2 - discord-api-types: ^0.33.3 - tslib: ^2.4.0 - undici: ^5.4.0 - checksum: 36427fd77ff11285da4400e9960fccb71aafa657e43c3de4fe4772d1497f20c3d84754c844ad44d2c6f68fed45303ace790191fd811c94414312fde20d0346c2 +"@discordjs/collection@npm:^1.0.0": + version: 1.0.0 + resolution: "@discordjs/collection@npm:1.0.0" + checksum: d8eafd35e782a6a2ee83a22c31679958bc827fce8cd5ffc7e5942cf681c96fd9543334b48c743ecda45179fcefa8d7be7a13f771d7f14effaec8a8ca25077031 languageName: node linkType: hard @@ -84,6 +69,43 @@ __metadata: languageName: node linkType: hard +"@discordjs/rest@npm:^1.0.0": + version: 1.0.0 + resolution: "@discordjs/rest@npm:1.0.0" + dependencies: + "@discordjs/collection": ^1.0.0 + "@sapphire/async-queue": ^1.3.2 + "@sapphire/snowflake": ^3.2.2 + discord-api-types: ^0.36.2 + file-type: ^17.1.2 + tslib: ^2.4.0 + undici: ^5.7.0 + checksum: dfe4348ce3d9cd7e91b1ee090b4b7c9eaf9f0b5a2acb4e2a1e71cb9a08afa260393190db5461e5873663d7d3bd29fbeda1ebec1bd74dcce87577371cf887cbbe + languageName: node + linkType: hard + +"@electron/get@npm:^1.14.1": + version: 1.14.1 + resolution: "@electron/get@npm:1.14.1" + dependencies: + debug: ^4.1.1 + env-paths: ^2.2.0 + fs-extra: ^8.1.0 + global-agent: ^3.0.0 + global-tunnel-ng: ^2.7.1 + got: ^9.6.0 + progress: ^2.0.3 + semver: ^6.2.0 + sumchecker: ^3.0.1 + dependenciesMeta: + global-agent: + optional: true + global-tunnel-ng: + optional: true + checksum: 21fec5e82bbee8f9fa183b46e05675b137c3130c7999d3b2b34a0047d1a06ec3c76347b9bbdb9911ba9b2123697804e360a15dda9db614c0226d5d4dcc4d6d15 + languageName: node + linkType: hard + "@eslint/eslintrc@npm:^1.3.0": version: 1.3.0 resolution: "@eslint/eslintrc@npm:1.3.0" @@ -241,6 +263,13 @@ __metadata: languageName: node linkType: hard +"@sapphire/async-queue@npm:^1.3.2": + version: 1.3.2 + resolution: "@sapphire/async-queue@npm:1.3.2" + checksum: 348f35a278bff68cb6d5e2c2219b03ce66243162522003bb14426e5fdad251300bea8ef3883043eb034c181dddd52296a519e9f377075a5b31074807fe163e76 + languageName: node + linkType: hard + "@sapphire/shapeshift@npm:^3.1.0": version: 3.2.0 resolution: "@sapphire/shapeshift@npm:3.2.0" @@ -248,6 +277,16 @@ __metadata: languageName: node linkType: hard +"@sapphire/shapeshift@npm:^3.5.1": + version: 3.5.1 + resolution: "@sapphire/shapeshift@npm:3.5.1" + dependencies: + fast-deep-equal: ^3.1.3 + lodash.uniqwith: ^4.5.0 + checksum: caecfef844c9e43e921a5051da888fae7da8980bfd9f9bb4f7fee85931d40929ffb9b6dfae464c0dccee61e56f7698f998e4d9a54d25f35fad39a51ba1a4f391 + languageName: node + linkType: hard + "@sapphire/snowflake@npm:^3.2.2": version: 3.2.2 resolution: "@sapphire/snowflake@npm:3.2.2" @@ -335,6 +374,13 @@ __metadata: languageName: node linkType: hard +"@sindresorhus/is@npm:^0.14.0": + version: 0.14.0 + resolution: "@sindresorhus/is@npm:0.14.0" + checksum: 971e0441dd44ba3909b467219a5e242da0fc584048db5324cfb8048148fa8dcc9d44d71e3948972c4f6121d24e5da402ef191420d1266a95f713bb6d6e59c98a + languageName: node + linkType: hard + "@sindresorhus/is@npm:^4.6.0": version: 4.6.0 resolution: "@sindresorhus/is@npm:4.6.0" @@ -342,6 +388,15 @@ __metadata: languageName: node linkType: hard +"@szmarczak/http-timer@npm:^1.1.2": + version: 1.1.2 + resolution: "@szmarczak/http-timer@npm:1.1.2" + dependencies: + defer-to-connect: ^1.0.1 + checksum: 4d9158061c5f397c57b4988cde33a163244e4f02df16364f103971957a32886beb104d6180902cbe8b38cb940e234d9f98a4e486200deca621923f62f50a06fe + languageName: node + linkType: hard + "@szmarczak/http-timer@npm:^5.0.1": version: 5.0.1 resolution: "@szmarczak/http-timer@npm:5.0.1" @@ -351,6 +406,13 @@ __metadata: languageName: node linkType: hard +"@tokenizer/token@npm:^0.3.0": + version: 0.3.0 + resolution: "@tokenizer/token@npm:0.3.0" + checksum: 1d575d02d2a9f0c5a4ca5180635ebd2ad59e0f18b42a65f3d04844148b49b3db35cf00b6012a1af2d59c2ab3caca59451c5689f747ba8667ee586ad717ee58e1 + languageName: node + linkType: hard + "@tootallnate/once@npm:2": version: 2.0.0 resolution: "@tootallnate/once@npm:2.0.0" @@ -492,7 +554,7 @@ __metadata: languageName: node linkType: hard -"@types/keyv@npm:*": +"@types/keyv@npm:*, @types/keyv@npm:^3.1.1": version: 3.1.4 resolution: "@types/keyv@npm:3.1.4" dependencies: @@ -536,10 +598,17 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^18.0.4": - version: 18.0.4 - resolution: "@types/node@npm:18.0.4" - checksum: 981284fd57941f233f0e77038087c122f56e3c2b4fc4e090dfc7f0a93abfc526d5ccdd59eb3ef551d713245cf3943e37c7b957f12ba699209341a447c39fab59 +"@types/node@npm:^16.11.26": + version: 16.11.45 + resolution: "@types/node@npm:16.11.45" + checksum: 57d61c951024f66d796e71e4a972faef266007398cd4e93a195822fea2d5deb41d0615f394a99ece89772b145ff057321d138c7e3442455dc7d785ff67cebde3 + languageName: node + linkType: hard + +"@types/node@npm:^18.0.6": + version: 18.0.6 + resolution: "@types/node@npm:18.0.6" + checksum: 780f8885a6b6eb12f4c0246617747fdc37a451931b3c01ce8148d356c0903b705dcb16cc6a914de63d48b0dc1b002c7a3dfae681f580e1761aa551d3cd996813 languageName: node linkType: hard @@ -641,13 +710,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/eslint-plugin@npm:5.30.5" +"@typescript-eslint/eslint-plugin@npm:^5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/eslint-plugin@npm:5.30.7" dependencies: - "@typescript-eslint/scope-manager": 5.30.5 - "@typescript-eslint/type-utils": 5.30.5 - "@typescript-eslint/utils": 5.30.5 + "@typescript-eslint/scope-manager": 5.30.7 + "@typescript-eslint/type-utils": 5.30.7 + "@typescript-eslint/utils": 5.30.7 debug: ^4.3.4 functional-red-black-tree: ^1.0.1 ignore: ^5.2.0 @@ -660,7 +729,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: cf763fb091dcdfd6c25843251a220b654ca83968b17266e0f343771f489085c6afc4e41fcf2187b4c72c4d12a787070c64b5e5367069460f95a8174573f48905 + checksum: d42af514f5817732646b5601030699687b4ef619ba7983754a4173bf908f6c6030324038e3733b88342ec6ace07af61aa946d677da6a6266931275bd2afc9fc2 languageName: node linkType: hard @@ -675,20 +744,20 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/parser@npm:5.30.5" +"@typescript-eslint/parser@npm:^5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/parser@npm:5.30.7" dependencies: - "@typescript-eslint/scope-manager": 5.30.5 - "@typescript-eslint/types": 5.30.5 - "@typescript-eslint/typescript-estree": 5.30.5 + "@typescript-eslint/scope-manager": 5.30.7 + "@typescript-eslint/types": 5.30.7 + "@typescript-eslint/typescript-estree": 5.30.7 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 6c16821e122b891420a538f200f6e576ad1167855a67e87f9a7d3a08c0513fe26006f6411b8ba6f4662a81526bd0339ae37c47dd88fa5943e6f27ff70da9f989 + checksum: f0b2da3cfd047d241f0bd3065a36afe008214aa9e8cd05e9f92d8b0e4b9ec19d3651d0e4a3995b8cb34b553cccb4b0d02d18c0cfbe11f53acd85923dd68366d5 languageName: node linkType: hard @@ -702,21 +771,21 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/scope-manager@npm:5.30.5" +"@typescript-eslint/scope-manager@npm:5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/scope-manager@npm:5.30.7" dependencies: - "@typescript-eslint/types": 5.30.5 - "@typescript-eslint/visitor-keys": 5.30.5 - checksum: 509bee6d62cca1716e8f4792d9180c189974992ba13d8103ca04423a64006cf184c4b2c606d55c776305458140c798a3a9a414d07a60790b83dd714f56c457b0 + "@typescript-eslint/types": 5.30.7 + "@typescript-eslint/visitor-keys": 5.30.7 + checksum: 434ce7a13a8f3bffae2af2b7fe19bab6e490c78114584212519f50cd1b91fbdcddc8ad93bdb3cacdc8cecca5a8c5d2eb606557e66bd3fcd9d3040846846c22ff languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/type-utils@npm:5.30.5" +"@typescript-eslint/type-utils@npm:5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/type-utils@npm:5.30.7" dependencies: - "@typescript-eslint/utils": 5.30.5 + "@typescript-eslint/utils": 5.30.7 debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: @@ -724,7 +793,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 080cc1231729c34b778395658374e32d034474056f9b777dbc89d20d15eb93d93d0959328ad47c2a6623d40c6552364ababadce439842a944bce001f55b731b3 + checksum: e7a8d4ec973355c0fe5bad4c317a55940e41d24b1c33b0bf40e8bb268d784f6584a8048fc84ebdb7287849a2c70e2b36365067cba7815de849cd41a1d7653167 languageName: node linkType: hard @@ -735,10 +804,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/types@npm:5.30.5" - checksum: c70420618cb875d4e964a20a3fa4cf40cb97a8ad3123e24860e3d829edf3b081c77fa1fe25644700499d27e44aee5783abc7765deee61e2ef59a928db96b2175 +"@typescript-eslint/types@npm:5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/types@npm:5.30.7" + checksum: 2f6345bf0e2e9f392c1f62a5f96c630d4565574230a000508d923444229e51c1a05e07cef042935ca30f4f35755dbf3871b8b9da808911f578d63e6a4b897b79 languageName: node linkType: hard @@ -760,12 +829,12 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/typescript-estree@npm:5.30.5" +"@typescript-eslint/typescript-estree@npm:5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/typescript-estree@npm:5.30.7" dependencies: - "@typescript-eslint/types": 5.30.5 - "@typescript-eslint/visitor-keys": 5.30.5 + "@typescript-eslint/types": 5.30.7 + "@typescript-eslint/visitor-keys": 5.30.7 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 @@ -774,7 +843,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 19dce426c826cddd4aadf2fa15be943c6ad7d2038685cc2665749486a5f44a47819aab5d260b54f8a4babf6acf2500e9f62e709d61fce337b12d5468ff285277 + checksum: 7cff83a9b9c91a89bcbb677d539b7122b2a423a66f575364858b4635d7e53a25b9329cd20a5adfb732758a41d1c6801d4bfa3eb798a192f351aafb11eedc58b6 languageName: node linkType: hard @@ -794,19 +863,19 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/utils@npm:5.30.5" +"@typescript-eslint/utils@npm:5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/utils@npm:5.30.7" dependencies: "@types/json-schema": ^7.0.9 - "@typescript-eslint/scope-manager": 5.30.5 - "@typescript-eslint/types": 5.30.5 - "@typescript-eslint/typescript-estree": 5.30.5 + "@typescript-eslint/scope-manager": 5.30.7 + "@typescript-eslint/types": 5.30.7 + "@typescript-eslint/typescript-estree": 5.30.7 eslint-scope: ^5.1.1 eslint-utils: ^3.0.0 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 12f68cb34a150d39708f4e09a54964360f29589885cd50f119a2061660011752ec72eff3d90111f0e597575d32aae7250a6e2c730a84963e5e30352759d5f1f4 + checksum: 77b0baf069f70290214294d74fdf7c46a7ddeab322ef53f65766b0c8e59f0e6f8074beb19233be34faca5beb390ac1b932dd1c983337355674c4437b4b1e2b44 languageName: node linkType: hard @@ -820,13 +889,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/visitor-keys@npm:5.30.5" +"@typescript-eslint/visitor-keys@npm:5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/visitor-keys@npm:5.30.7" dependencies: - "@typescript-eslint/types": 5.30.5 + "@typescript-eslint/types": 5.30.7 eslint-visitor-keys: ^3.3.0 - checksum: c0de9ae48378eec2682b860a059518bed213ea29575aad538d8d2f8137875e7279e375a7f23d38c1c183466fdd9cf1ca1db4ed5a1d374968f9460d83e48b2437 + checksum: f322972aeda3143d4c24826436357937131f7fbad102d48cfa6dfca70ac245f93b20cf7beb5f1809bda4fe8f454676a6cabf8f73e39af6724076f2b2c213ee80 languageName: node linkType: hard @@ -1040,6 +1109,13 @@ __metadata: languageName: node linkType: hard +"boolean@npm:^3.0.1": + version: 3.2.0 + resolution: "boolean@npm:3.2.0" + checksum: fb29535b8bf710ef45279677a86d14f5185d604557204abd2ca5fa3fb2a5c80e04d695c8dbf13ab269991977a79bb6c04b048220a6b2a3849853faa94f4a7d77 + languageName: node + linkType: hard + "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -1106,6 +1182,13 @@ __metadata: languageName: node linkType: hard +"buffer-from@npm:^1.0.0": + version: 1.1.2 + resolution: "buffer-from@npm:1.1.2" + checksum: 0448524a562b37d4d7ed9efd91685a5b77a50672c556ea254ac9a6d30e3403a517d8981f10e565db24e8339413b43c97ca2951f10e399c6125a0d8911f5679bb + languageName: node + linkType: hard + "buffer-writer@npm:2.0.0": version: 2.0.0 resolution: "buffer-writer@npm:2.0.0" @@ -1127,8 +1210,8 @@ __metadata: version: 0.0.0-use.local resolution: "bush-bot@workspace:." dependencies: - "@discordjs/builders": ^0.15.0 - "@discordjs/rest": ^0.5.0 + "@discordjs/builders": ^1.0.0 + "@discordjs/rest": ^1.0.0 "@ironm00n/nbt-ts": ^1.4.0 "@notenoughupdates/discord.js-minesweeper": ^1.0.10 "@notenoughupdates/events-intercept": ^3.0.1 @@ -1143,22 +1226,23 @@ __metadata: "@types/eslint": ^8.4.5 "@types/express": ^4.17.13 "@types/lodash": ^4.14.182 - "@types/node": ^18.0.4 + "@types/node": ^18.0.6 "@types/numeral": ^2.0.2 "@types/pg": ^8.6.5 "@types/prettier": ^2.6.3 "@types/rimraf": ^3.0.2 "@types/tinycolor2": ^1.4.3 "@types/validator": ^13.7.4 - "@typescript-eslint/eslint-plugin": ^5.30.5 - "@typescript-eslint/parser": ^5.30.5 + "@typescript-eslint/eslint-plugin": ^5.30.7 + "@typescript-eslint/parser": ^5.30.7 canvas: ^2.9.3 chalk: ^5.0.1 deep-lock: ^1.0.0 discord-akairo: "npm:@notenoughupdates/discord-akairo@dev" - discord-api-types: 0.34.0 + discord-api-types: 0.36.2 discord.js: "npm:@notenoughupdates/discord.js@dev" - eslint: ^8.19.0 + electron: latest + eslint: ^8.20.0 eslint-config-prettier: ^8.5.0 eslint-plugin-deprecation: ^1.3.2 eslint-plugin-import: ^2.26.0 @@ -1169,7 +1253,7 @@ __metadata: lodash: ^4.17.21 mathjs: ^10.6.4 nanoid: ^4.0.0 - node-fetch: ^3.2.8 + node-fetch: ^3.2.9 numeral: ^2.0.6 pg: ^8.7.3 pg-hstore: ^2.3.4 @@ -1180,7 +1264,7 @@ __metadata: tinycolor2: ^1.4.2 ts-essentials: ^9.2.0 typescript: ^4.7.4 - vitest: ^0.18.0 + vitest: ^0.18.1 vm2: ^3.9.10 languageName: unknown linkType: soft @@ -1218,6 +1302,21 @@ __metadata: languageName: node linkType: hard +"cacheable-request@npm:^6.0.0": + version: 6.1.0 + resolution: "cacheable-request@npm:6.1.0" + dependencies: + clone-response: ^1.0.2 + get-stream: ^5.1.0 + http-cache-semantics: ^4.0.0 + keyv: ^3.0.0 + lowercase-keys: ^2.0.0 + normalize-url: ^4.1.0 + responselike: ^1.0.2 + checksum: b510b237b18d17e89942e9ee2d2a077cb38db03f12167fd100932dfa8fc963424bfae0bfa1598df4ae16c944a5484e43e03df8f32105b04395ee9495e9e4e9f1 + languageName: node + linkType: hard + "cacheable-request@npm:^7.0.2": version: 7.0.2 resolution: "cacheable-request@npm:7.0.2" @@ -1380,6 +1479,28 @@ __metadata: languageName: node linkType: hard +"concat-stream@npm:^1.6.2": + version: 1.6.2 + resolution: "concat-stream@npm:1.6.2" + dependencies: + buffer-from: ^1.0.0 + inherits: ^2.0.3 + readable-stream: ^2.2.2 + typedarray: ^0.0.6 + checksum: 1ef77032cb4459dcd5187bd710d6fc962b067b64ec6a505810de3d2b8cc0605638551b42f8ec91edf6fcd26141b32ef19ad749239b58fae3aba99187adc32285 + languageName: node + linkType: hard + +"config-chain@npm:^1.1.11": + version: 1.1.13 + resolution: "config-chain@npm:1.1.13" + dependencies: + ini: ^1.3.4 + proto-list: ~1.2.1 + checksum: 828137a28e7c2fc4b7fb229bd0cd6c1397bcf83434de54347e608154008f411749041ee392cbe42fab6307e02de4c12480260bf769b7d44b778fdea3839eafab + languageName: node + linkType: hard + "console-control-strings@npm:^1.0.0, console-control-strings@npm:^1.1.0": version: 1.1.0 resolution: "console-control-strings@npm:1.1.0" @@ -1467,6 +1588,15 @@ __metadata: languageName: node linkType: hard +"decompress-response@npm:^3.3.0": + version: 3.3.0 + resolution: "decompress-response@npm:3.3.0" + dependencies: + mimic-response: ^1.0.0 + checksum: 952552ac3bd7de2fc18015086b09468645c9638d98a551305e485230ada278c039c91116e946d07894b39ee53c0f0d5b6473f25a224029344354513b412d7380 + languageName: node + linkType: hard + "decompress-response@npm:^4.2.0": version: 4.2.1 resolution: "decompress-response@npm:4.2.1" @@ -1571,6 +1701,13 @@ __metadata: languageName: node linkType: hard +"defer-to-connect@npm:^1.0.1": + version: 1.1.3 + resolution: "defer-to-connect@npm:1.1.3" + checksum: 9491b301dcfa04956f989481ba7a43c2231044206269eb4ab64a52d6639ee15b1252262a789eb4239fb46ab63e44d4e408641bae8e0793d640aee55398cb3930 + languageName: node + linkType: hard + "defer-to-connect@npm:^2.0.1": version: 2.0.1 resolution: "defer-to-connect@npm:2.0.1" @@ -1609,6 +1746,13 @@ __metadata: languageName: node linkType: hard +"detect-node@npm:^2.0.4": + version: 2.1.0 + resolution: "detect-node@npm:2.1.0" + checksum: 832184ec458353e41533ac9c622f16c19f7c02d8b10c303dfd3a756f56be93e903616c0bb2d4226183c9351c15fc0b3dba41a17a2308262afabcfa3776e6ae6e + languageName: node + linkType: hard + "dir-glob@npm:^3.0.1": version: 3.0.1 resolution: "dir-glob@npm:3.0.1" @@ -1625,14 +1769,14 @@ __metadata: languageName: node linkType: hard -"discord-api-types@npm:0.34.0": - version: 0.34.0 - resolution: "discord-api-types@npm:0.34.0" - checksum: 16ef4a7e82c442808447d2062adb907c050f1c0b10b0dd7ffd459b5cbc2ae8e5ba46d17c645e401500a0263ee661c651d29ab5b41bd2af15a72281d03cba90dc +"discord-api-types@npm:0.36.2, discord-api-types@npm:^0.36.2": + version: 0.36.2 + resolution: "discord-api-types@npm:0.36.2" + checksum: 0275ac9db1bb8354ed3fedb37d7fa66d02b63aa6dc749add1e9ed52b428e94cb8b5111bd60e781cf0c2c5cdb0e948c4e83d00b74f500f1b0ac90ddc38a822798 languageName: node linkType: hard -"discord-api-types@npm:^0.33.3, discord-api-types@npm:^0.33.5": +"discord-api-types@npm:^0.33.5": version: 0.33.5 resolution: "discord-api-types@npm:0.33.5" checksum: 6dcaad640c5693a69c9a4f5e444e739dde11ba835164ae6fd3dd5a1ab7b4d7f96cd022ed653eeaff2c8051ead0d998a5d502a2915cfacdde596364b82d9e3b3f @@ -1683,6 +1827,13 @@ __metadata: languageName: node linkType: hard +"duplexer3@npm:^0.1.4": + version: 0.1.5 + resolution: "duplexer3@npm:0.1.5" + checksum: e677cb4c48f031ca728601d6a20bf6aed4c629d69ef9643cb89c67583d673c4ec9317cc6427501f38bd8c368d3a18f173987cc02bd99d8cf8fe3d94259a22a20 + languageName: node + linkType: hard + "ecdsa-sig-formatter@npm:1.0.11, ecdsa-sig-formatter@npm:^1.0.11": version: 1.0.11 resolution: "ecdsa-sig-formatter@npm:1.0.11" @@ -1692,6 +1843,19 @@ __metadata: languageName: node linkType: hard +"electron@npm:latest": + version: 19.0.9 + resolution: "electron@npm:19.0.9" + dependencies: + "@electron/get": ^1.14.1 + "@types/node": ^16.11.26 + extract-zip: ^1.0.3 + bin: + electron: cli.js + checksum: 662e63216c2802340cd1d2f28664818ec30fade0e1cb9da3a1afb2b13b2c6d920d1506b2c62442ea0118ba8965edee3f1e7c365b8cd1d4060f9a250db1161d47 + languageName: node + linkType: hard + "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -1699,6 +1863,13 @@ __metadata: languageName: node linkType: hard +"encodeurl@npm:^1.0.2": + version: 1.0.2 + resolution: "encodeurl@npm:1.0.2" + checksum: e50e3d508cdd9c4565ba72d2012e65038e5d71bdc9198cb125beb6237b5b1ade6c0d343998da9e170fb2eae52c1bed37d4d6d98a46ea423a0cddbed5ac3f780c + languageName: node + linkType: hard + "encoding@npm:^0.1.13": version: 0.1.13 resolution: "encoding@npm:0.1.13" @@ -1782,6 +1953,13 @@ __metadata: languageName: node linkType: hard +"es6-error@npm:^4.1.1": + version: 4.1.1 + resolution: "es6-error@npm:4.1.1" + checksum: ae41332a51ec1323da6bbc5d75b7803ccdeddfae17c41b6166ebbafc8e8beb7a7b80b884b7fab1cc80df485860ac3c59d78605e860bb4f8cd816b3d6ade0d010 + languageName: node + linkType: hard + "esbuild-android-64@npm:0.14.48": version: 0.14.48 resolution: "esbuild-android-64@npm:0.14.48" @@ -2120,9 +2298,9 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.19.0": - version: 8.19.0 - resolution: "eslint@npm:8.19.0" +"eslint@npm:^8.20.0": + version: 8.20.0 + resolution: "eslint@npm:8.20.0" dependencies: "@eslint/eslintrc": ^1.3.0 "@humanwhocodes/config-array": ^0.9.2 @@ -2161,7 +2339,7 @@ __metadata: v8-compile-cache: ^2.0.3 bin: eslint: bin/eslint.js - checksum: 0bc9df1a3a09dcd5a781ec728f280aa8af3ab19c2d1f14e2668b5ee5b8b1fb0e72dde5c3acf738e7f4281685fb24ec149b6154255470b06cf41de76350bca7a4 + checksum: a31adf390d71d916925586bc8467b48f620e93dd0416bc1e897d99265af88b48d4eba3985b5ff4653ae5cc46311a360d373574002277e159bb38a4363abf9228 languageName: node linkType: hard @@ -2244,6 +2422,20 @@ __metadata: languageName: node linkType: hard +"extract-zip@npm:^1.0.3": + version: 1.7.0 + resolution: "extract-zip@npm:1.7.0" + dependencies: + concat-stream: ^1.6.2 + debug: ^2.6.9 + mkdirp: ^0.5.4 + yauzl: ^2.10.0 + bin: + extract-zip: cli.js + checksum: 011bab660d738614555773d381a6ba4815d98c1cfcdcdf027e154ebcc9fc8c9ef637b3ea5c9b2144013100071ee41722ed041fc9aacc60f6198ef747cac0c073 + languageName: node + linkType: hard + "fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": version: 3.1.3 resolution: "fast-deep-equal@npm:3.1.3" @@ -2322,6 +2514,17 @@ __metadata: languageName: node linkType: hard +"file-type@npm:^17.1.2": + version: 17.1.2 + resolution: "file-type@npm:17.1.2" + dependencies: + readable-web-to-node-stream: ^3.0.2 + strtok3: ^7.0.0-alpha.7 + token-types: ^5.0.0-alpha.2 + checksum: 22103084b47d1fdc82e84b979512a2e9e488643f975b04cfd39acb2a9ab212438274a4f06039061631ca01be030f174c387c4a3ab9fe3417a1a199cb59079cb8 + languageName: node + linkType: hard + "file-type@npm:^3.8.0": version: 3.9.0 resolution: "file-type@npm:3.9.0" @@ -2408,6 +2611,17 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:^8.1.0": + version: 8.1.0 + resolution: "fs-extra@npm:8.1.0" + dependencies: + graceful-fs: ^4.2.0 + jsonfile: ^4.0.0 + universalify: ^0.1.0 + checksum: bf44f0e6cea59d5ce071bba4c43ca76d216f89e402dc6285c128abc0902e9b8525135aa808adad72c9d5d218e9f4bcc63962815529ff2f684ad532172a284880 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -2587,6 +2801,15 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:^4.1.0": + version: 4.1.0 + resolution: "get-stream@npm:4.1.0" + dependencies: + pump: ^3.0.0 + checksum: 443e1914170c15bd52ff8ea6eff6dfc6d712b031303e36302d2778e3de2506af9ee964d6124010f7818736dcfde05c04ba7ca6cc26883106e084357a17ae7d73 + languageName: node + linkType: hard + "get-stream@npm:^5.1.0": version: 5.2.0 resolution: "get-stream@npm:5.2.0" @@ -2668,6 +2891,32 @@ __metadata: languageName: node linkType: hard +"global-agent@npm:^3.0.0": + version: 3.0.0 + resolution: "global-agent@npm:3.0.0" + dependencies: + boolean: ^3.0.1 + es6-error: ^4.1.1 + matcher: ^3.0.0 + roarr: ^2.15.3 + semver: ^7.3.2 + serialize-error: ^7.0.1 + checksum: 75074d80733b4bd5386c47f5df028e798018025beac0ab310e9908c72bf5639e408203e7bca0130d5ee01b5f4abc6d34385d96a9f950ea5fe1979bb431c808f7 + languageName: node + linkType: hard + +"global-tunnel-ng@npm:^2.7.1": + version: 2.7.1 + resolution: "global-tunnel-ng@npm:2.7.1" + dependencies: + encodeurl: ^1.0.2 + lodash: ^4.17.10 + npm-conf: ^1.1.3 + tunnel: ^0.0.6 + checksum: b7e016093eab6058b5fdd8caea31c22dc1a607f0f0b41c001ade5e0227c5d74efe9ce9bae56316d794bc1cedd461a187b8b7e8f0a3eb4d194972cdfb9d860af2 + languageName: node + linkType: hard + "globals@npm:^13.15.0": version: 13.15.0 resolution: "globals@npm:13.15.0" @@ -2677,6 +2926,15 @@ __metadata: languageName: node linkType: hard +"globalthis@npm:^1.0.1": + version: 1.0.3 + resolution: "globalthis@npm:1.0.3" + dependencies: + define-properties: ^1.1.3 + checksum: fbd7d760dc464c886d0196166d92e5ffb4c84d0730846d6621a39fbbc068aeeb9c8d1421ad330e94b7bca4bb4ea092f5f21f3d36077812af5d098b4dc006c998 + languageName: node + linkType: hard + "globby@npm:^11.1.0": version: 11.1.0 resolution: "globby@npm:11.1.0" @@ -2764,7 +3022,26 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.1.10, graceful-fs@npm:^4.2.6": +"got@npm:^9.6.0": + version: 9.6.0 + resolution: "got@npm:9.6.0" + dependencies: + "@sindresorhus/is": ^0.14.0 + "@szmarczak/http-timer": ^1.1.2 + cacheable-request: ^6.0.0 + decompress-response: ^3.3.0 + duplexer3: ^0.1.4 + get-stream: ^4.1.0 + lowercase-keys: ^1.0.1 + mimic-response: ^1.0.1 + p-cancelable: ^1.0.0 + to-readable-stream: ^1.0.0 + url-parse-lax: ^3.0.0 + checksum: 941807bd9704bacf5eb401f0cc1212ffa1f67c6642f2d028fd75900471c221b1da2b8527f4553d2558f3faeda62ea1cf31665f8b002c6137f5de8732f07370b0 + languageName: node + linkType: hard + +"graceful-fs@npm:^4.1.10, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.6": version: 4.2.10 resolution: "graceful-fs@npm:4.2.10" checksum: 3f109d70ae123951905d85032ebeae3c2a5a7a997430df00ea30df0e3a6c60cf6689b109654d6fdacd28810a053348c4d14642da1d075049e6be1ba5216218da @@ -2893,7 +3170,7 @@ __metadata: languageName: node linkType: hard -"ieee754@npm:^1.1.13": +"ieee754@npm:^1.1.13, ieee754@npm:^1.2.1": version: 1.2.1 resolution: "ieee754@npm:1.2.1" checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e @@ -2969,6 +3246,13 @@ __metadata: languageName: node linkType: hard +"ini@npm:^1.3.4": + version: 1.3.8 + resolution: "ini@npm:1.3.8" + checksum: dfd98b0ca3a4fc1e323e38a6c8eb8936e31a97a918d3b377649ea15bdb15d481207a0dda1021efbd86b464cae29a0d33c1d7dcaf6c5672bee17fa849bc50a1b3 + languageName: node + linkType: hard + "internal-slot@npm:^1.0.3": version: 1.0.3 resolution: "internal-slot@npm:1.0.3" @@ -3192,6 +3476,13 @@ __metadata: languageName: node linkType: hard +"json-buffer@npm:3.0.0": + version: 3.0.0 + resolution: "json-buffer@npm:3.0.0" + checksum: 0cecacb8025370686a916069a2ff81f7d55167421b6aa7270ee74e244012650dd6bce22b0852202ea7ff8624fce50ff0ec1bdf95914ccb4553426e290d5a63fa + languageName: node + linkType: hard + "json-buffer@npm:3.0.1, json-buffer@npm:~3.0.1": version: 3.0.1 resolution: "json-buffer@npm:3.0.1" @@ -3213,6 +3504,13 @@ __metadata: languageName: node linkType: hard +"json-stringify-safe@npm:^5.0.1": + version: 5.0.1 + resolution: "json-stringify-safe@npm:5.0.1" + checksum: 48ec0adad5280b8a96bb93f4563aa1667fd7a36334f79149abd42446d0989f2ddc58274b479f4819f1f00617957e6344c886c55d05a4e15ebb4ab931e4a6a8ee + languageName: node + linkType: hard + "json5@npm:^1.0.1": version: 1.0.1 resolution: "json5@npm:1.0.1" @@ -3224,6 +3522,18 @@ __metadata: languageName: node linkType: hard +"jsonfile@npm:^4.0.0": + version: 4.0.0 + resolution: "jsonfile@npm:4.0.0" + dependencies: + graceful-fs: ^4.1.6 + dependenciesMeta: + graceful-fs: + optional: true + checksum: 6447d6224f0d31623eef9b51185af03ac328a7553efcee30fa423d98a9e276ca08db87d71e17f2310b0263fd3ffa6c2a90a6308367f661dc21580f9469897c9e + languageName: node + linkType: hard + "jwa@npm:^2.0.0": version: 2.0.0 resolution: "jwa@npm:2.0.0" @@ -3245,6 +3555,15 @@ __metadata: languageName: node linkType: hard +"keyv@npm:^3.0.0": + version: 3.1.0 + resolution: "keyv@npm:3.1.0" + dependencies: + json-buffer: 3.0.0 + checksum: bb7e8f3acffdbafbc2dd5b63f377fe6ec4c0e2c44fc82720449ef8ab54f4a7ce3802671ed94c0f475ae0a8549703353a2124561fcf3317010c141b32ca1ce903 + languageName: node + linkType: hard + "keyv@npm:^4.0.0": version: 4.3.0 resolution: "keyv@npm:4.3.0" @@ -3274,10 +3593,10 @@ __metadata: languageName: node linkType: hard -"local-pkg@npm:^0.4.1": - version: 0.4.1 - resolution: "local-pkg@npm:0.4.1" - checksum: 4ab3b4853ffbc3b292a3ae2e22618dbc348418a2ebf60ada55fdcc5a8583f9167c89fc7977194ffa39d0a4c5078f9c421d246afdd252fea7a840f7a8f3b5f96b +"local-pkg@npm:^0.4.2": + version: 0.4.2 + resolution: "local-pkg@npm:0.4.2" + checksum: 22be451353c25c4411b552bf01880ebc9e995b93574b2facc7757968d888356df59199cacada14162ab53bbc9da055bb692c907b4171f008dbce45a2afc777c1 languageName: node linkType: hard @@ -3314,7 +3633,14 @@ __metadata: languageName: node linkType: hard -"lodash@npm:^4.17.21": +"lodash.uniqwith@npm:^4.5.0": + version: 4.5.0 + resolution: "lodash.uniqwith@npm:4.5.0" + checksum: d49a4565ed64efd86674127d321622673c29cde3e060baebc0f30372f22886c61b2ead44709db8c890053db1b9660e8ed689689812c1a485eb5703caa94d1150 + languageName: node + linkType: hard + +"lodash@npm:^4.17.10, lodash@npm:^4.17.21": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 @@ -3330,6 +3656,13 @@ __metadata: languageName: node linkType: hard +"lowercase-keys@npm:^1.0.0, lowercase-keys@npm:^1.0.1": + version: 1.0.1 + resolution: "lowercase-keys@npm:1.0.1" + checksum: 4d045026595936e09953e3867722e309415ff2c80d7701d067546d75ef698dac218a4f53c6d1d0e7368b47e45fd7529df47e6cb56fbb90523ba599f898b3d147 + languageName: node + linkType: hard + "lowercase-keys@npm:^2.0.0": version: 2.0.0 resolution: "lowercase-keys@npm:2.0.0" @@ -3419,6 +3752,15 @@ __metadata: languageName: node linkType: hard +"matcher@npm:^3.0.0": + version: 3.0.0 + resolution: "matcher@npm:3.0.0" + dependencies: + escape-string-regexp: ^4.0.0 + checksum: 8bee1a7ab7609c2c21d9c9254b6785fa708eadf289032b556d57a34e98fcd4c537659a004dafee6ce80ab157099e645c199dc52678dff1e7fb0a6684e0da4dbe + languageName: node + linkType: hard + "mathjs@npm:^10.6.4": version: 10.6.4 resolution: "mathjs@npm:10.6.4" @@ -3455,7 +3797,7 @@ __metadata: languageName: node linkType: hard -"mimic-response@npm:^1.0.0": +"mimic-response@npm:^1.0.0, mimic-response@npm:^1.0.1": version: 1.0.1 resolution: "mimic-response@npm:1.0.1" checksum: 034c78753b0e622bc03c983663b1cdf66d03861050e0c8606563d149bc2b02d63f62ce4d32be4ab50d0553ae0ffe647fc34d1f5281184c6e1e8cf4d85e8d9823 @@ -3571,6 +3913,17 @@ __metadata: languageName: node linkType: hard +"mkdirp@npm:^0.5.4": + version: 0.5.6 + resolution: "mkdirp@npm:0.5.6" + dependencies: + minimist: ^1.2.6 + bin: + mkdirp: bin/cmd.js + checksum: 0c91b721bb12c3f9af4b77ebf73604baf350e64d80df91754dc509491ae93bf238581e59c7188360cec7cb62fc4100959245a42cfe01834efedc5e9d068376c2 + languageName: node + linkType: hard + "mkdirp@npm:^1.0.3, mkdirp@npm:^1.0.4": version: 1.0.4 resolution: "mkdirp@npm:1.0.4" @@ -3679,14 +4032,14 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^3.2.8": - version: 3.2.8 - resolution: "node-fetch@npm:3.2.8" +"node-fetch@npm:^3.2.9": + version: 3.2.9 + resolution: "node-fetch@npm:3.2.9" dependencies: data-uri-to-buffer: ^4.0.0 fetch-blob: ^3.1.4 formdata-polyfill: ^4.0.10 - checksum: 2f7fc3e59fbede43a273e988d2f2a3dd68160618114e32ad537477db253808b65221f1dbfd666b8fb33ff07bf1de9d6448035b0f8ada5ef876c5afec93b27318 + checksum: ba421350b2dbab67d8068f9d24f30ef8b9a37a3f83388d2efaf79628de754c85df81829c009579ea5562a2b11d9f07ecd21d27b5b8bed0cb393b92abe4817a75 languageName: node linkType: hard @@ -3728,6 +4081,13 @@ __metadata: languageName: node linkType: hard +"normalize-url@npm:^4.1.0": + version: 4.5.1 + resolution: "normalize-url@npm:4.5.1" + checksum: 9a9dee01df02ad23e171171893e56e22d752f7cff86fb96aafeae074819b572ea655b60f8302e2d85dbb834dc885c972cc1c573892fea24df46b2765065dd05a + languageName: node + linkType: hard + "normalize-url@npm:^6.0.1": version: 6.1.0 resolution: "normalize-url@npm:6.1.0" @@ -3735,6 +4095,16 @@ __metadata: languageName: node linkType: hard +"npm-conf@npm:^1.1.3": + version: 1.1.3 + resolution: "npm-conf@npm:1.1.3" + dependencies: + config-chain: ^1.1.11 + pify: ^3.0.0 + checksum: 2d4e933b657623d98183ec408d17318547296b1cd17c4d3587e2920c554675f24f829d8f5f7f84db3a020516678fdcd01952ebaaf0e7fa8a17f6c39be4154bef + languageName: node + linkType: hard + "npm-run-path@npm:^2.0.0": version: 2.0.2 resolution: "npm-run-path@npm:2.0.2" @@ -3842,6 +4212,13 @@ __metadata: languageName: node linkType: hard +"p-cancelable@npm:^1.0.0": + version: 1.1.0 + resolution: "p-cancelable@npm:1.1.0" + checksum: 2db3814fef6d9025787f30afaee4496a8857a28be3c5706432cbad76c688a6db1874308f48e364a42f5317f5e41e8e7b4f2ff5c8ff2256dbb6264bc361704ece + languageName: node + linkType: hard + "p-cancelable@npm:^3.0.0": version: 3.0.0 resolution: "p-cancelable@npm:3.0.0" @@ -3955,6 +4332,13 @@ __metadata: languageName: node linkType: hard +"peek-readable@npm:^5.0.0-alpha.5": + version: 5.0.0-alpha.5 + resolution: "peek-readable@npm:5.0.0-alpha.5" + checksum: cab949ed457dac95ae191dd412c6a0ba05e8db4842fd51704ccf2c8c16d6f3ceeefc997e8caea584a0395f229e468c0203a38a8d0ec68cfef8bacc157a006dcb + languageName: node + linkType: hard + "pend@npm:~1.2.0": version: 1.2.0 resolution: "pend@npm:1.2.0" @@ -4135,6 +4519,13 @@ __metadata: languageName: node linkType: hard +"prepend-http@npm:^2.0.0": + version: 2.0.0 + resolution: "prepend-http@npm:2.0.0" + checksum: 7694a9525405447662c1ffd352fcb41b6410c705b739b6f4e3a3e21cf5fdede8377890088e8934436b8b17ba55365a615f153960f30877bf0d0392f9e93503ea + languageName: node + linkType: hard + "prettier@npm:^2.7.1": version: 2.7.1 resolution: "prettier@npm:2.7.1" @@ -4158,6 +4549,13 @@ __metadata: languageName: node linkType: hard +"progress@npm:^2.0.3": + version: 2.0.3 + resolution: "progress@npm:2.0.3" + checksum: f67403fe7b34912148d9252cb7481266a354bd99ce82c835f79070643bb3c6583d10dbcfda4d41e04bbc1d8437e9af0fb1e1f2135727878f5308682a579429b7 + languageName: node + linkType: hard + "promise-inflight@npm:^1.0.1": version: 1.0.1 resolution: "promise-inflight@npm:1.0.1" @@ -4175,6 +4573,13 @@ __metadata: languageName: node linkType: hard +"proto-list@npm:~1.2.1": + version: 1.2.4 + resolution: "proto-list@npm:1.2.4" + checksum: 4d4826e1713cbfa0f15124ab0ae494c91b597a3c458670c9714c36e8baddf5a6aad22842776f2f5b137f259c8533e741771445eb8df82e861eea37a6eaba03f7 + languageName: node + linkType: hard + "pseudomap@npm:^1.0.2": version: 1.0.2 resolution: "pseudomap@npm:1.0.2" @@ -4222,7 +4627,7 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^2.3.0, readable-stream@npm:^2.3.5": +"readable-stream@npm:^2.2.2, readable-stream@npm:^2.3.0, readable-stream@npm:^2.3.5": version: 2.3.7 resolution: "readable-stream@npm:2.3.7" dependencies: @@ -4248,6 +4653,15 @@ __metadata: languageName: node linkType: hard +"readable-web-to-node-stream@npm:^3.0.2": + version: 3.0.2 + resolution: "readable-web-to-node-stream@npm:3.0.2" + dependencies: + readable-stream: ^3.6.0 + checksum: 8c56cc62c68513425ddfa721954875b382768f83fa20e6b31e365ee00cbe7a3d6296f66f7f1107b16cd3416d33aa9f1680475376400d62a081a88f81f0ea7f9c + languageName: node + linkType: hard + "regenerator-runtime@npm:^0.13.4": version: 0.13.9 resolution: "regenerator-runtime@npm:0.13.9" @@ -4313,6 +4727,15 @@ __metadata: languageName: node linkType: hard +"responselike@npm:^1.0.2": + version: 1.0.2 + resolution: "responselike@npm:1.0.2" + dependencies: + lowercase-keys: ^1.0.0 + checksum: 2e9e70f1dcca3da621a80ce71f2f9a9cad12c047145c6ece20df22f0743f051cf7c73505e109814915f23f9e34fb0d358e22827723ee3d56b623533cab8eafcd + languageName: node + linkType: hard + "responselike@npm:^2.0.0": version: 2.0.0 resolution: "responselike@npm:2.0.0" @@ -4354,6 +4777,20 @@ __metadata: languageName: node linkType: hard +"roarr@npm:^2.15.3": + version: 2.15.4 + resolution: "roarr@npm:2.15.4" + dependencies: + boolean: ^3.0.1 + detect-node: ^2.0.4 + globalthis: ^1.0.1 + json-stringify-safe: ^5.0.1 + semver-compare: ^1.0.0 + sprintf-js: ^1.1.2 + checksum: 682e28d5491e3ae99728a35ba188f4f0ccb6347dbd492f95dc9f4bfdfe8ee63d8203ad234766ee2db88c8d7a300714304976eb095ce5c9366fe586c03a21586c + languageName: node + linkType: hard + "rollup@npm:^2.75.6": version: 2.76.0 resolution: "rollup@npm:2.76.0" @@ -4417,7 +4854,14 @@ __metadata: languageName: node linkType: hard -"semver@npm:^6.0.0": +"semver-compare@npm:^1.0.0": + version: 1.0.0 + resolution: "semver-compare@npm:1.0.0" + checksum: dd1d7e2909744cf2cf71864ac718efc990297f9de2913b68e41a214319e70174b1d1793ac16e31183b128c2b9812541300cb324db8168e6cf6b570703b171c68 + languageName: node + linkType: hard + +"semver@npm:^6.0.0, semver@npm:^6.2.0": version: 6.3.0 resolution: "semver@npm:6.3.0" bin: @@ -4426,7 +4870,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.5, semver@npm:^7.3.7": +"semver@npm:^7.3.2, semver@npm:^7.3.5, semver@npm:^7.3.7": version: 7.3.7 resolution: "semver@npm:7.3.7" dependencies: @@ -4485,6 +4929,15 @@ __metadata: languageName: node linkType: hard +"serialize-error@npm:^7.0.1": + version: 7.0.1 + resolution: "serialize-error@npm:7.0.1" + dependencies: + type-fest: ^0.13.1 + checksum: e0aba4dca2fc9fe74ae1baf38dbd99190e1945445a241ba646290f2176cdb2032281a76443b02ccf0caf30da5657d510746506368889a593b9835a497fc0732e + languageName: node + linkType: hard + "set-blocking@npm:^2.0.0": version: 2.0.0 resolution: "set-blocking@npm:2.0.0" @@ -4609,6 +5062,13 @@ __metadata: languageName: node linkType: hard +"sprintf-js@npm:^1.1.2": + version: 1.1.2 + resolution: "sprintf-js@npm:1.1.2" + checksum: d4bb46464632b335e5faed381bd331157e0af64915a98ede833452663bc672823db49d7531c32d58798e85236581fb7342fd0270531ffc8f914e186187bf1c90 + languageName: node + linkType: hard + "ssri@npm:^9.0.0": version: 9.0.1 resolution: "ssri@npm:9.0.1" @@ -4708,6 +5168,25 @@ __metadata: languageName: node linkType: hard +"strtok3@npm:^7.0.0-alpha.7": + version: 7.0.0-alpha.8 + resolution: "strtok3@npm:7.0.0-alpha.8" + dependencies: + "@tokenizer/token": ^0.3.0 + peek-readable: ^5.0.0-alpha.5 + checksum: 00e5c9ed0c5de537839cf443d5628f0ae88d2956ca1fdcbd45cd97372045d7179a40ec99f6d06b02c59ec2141e362142ad0a87c59506d401dbd3bd1ee242abaa + languageName: node + linkType: hard + +"sumchecker@npm:^3.0.1": + version: 3.0.1 + resolution: "sumchecker@npm:3.0.1" + dependencies: + debug: ^4.1.0 + checksum: 31ba7a62c889236b5b07f75b5c250d481158a1ca061b8f234fca0457bdbe48a20e5011c12c715343dc577e111463dc3d9e721b98015a445a2a88c35e0c9f0f91 + languageName: node + linkType: hard + "supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" @@ -4781,17 +5260,17 @@ __metadata: languageName: node linkType: hard -"tinypool@npm:^0.2.1": - version: 0.2.2 - resolution: "tinypool@npm:0.2.2" - checksum: 2ce12dd4f28ed7182095981b29e6cf8170b3efea7016c99c1d059da7b4929124565a35e89fe1b69a9a0d2d9aa58143c32a9f7f793f3160c4f453da8febede98a +"tinypool@npm:^0.2.4": + version: 0.2.4 + resolution: "tinypool@npm:0.2.4" + checksum: f050bd36c89529a2a0d3f9c1fdbba3f317114e3ee6eb5d5ba72c51e887d45ef3ef8d8533fb2ca2eba7189d19d2231712b81b3a75e099248532f5563369929c33 languageName: node linkType: hard -"tinyspy@npm:^0.3.3": - version: 0.3.3 - resolution: "tinyspy@npm:0.3.3" - checksum: 1beb8f04c100d9ac769ff85266594f07d6f08f41cfb95c4bef9da3e59988b42e8d4e66c2ec455d3ecad80027347920e87d7a7098c5a2a28637f9fee25e11a8f1 +"tinyspy@npm:^1.0.0": + version: 1.0.0 + resolution: "tinyspy@npm:1.0.0" + checksum: f9a7cea406db9b0f99a4ef162eb0a45d88fc36facbc309702c8d568283baa363ab3c4138d8402fbfdef7a8d3157ff7cfae3e99ec6c75d8f684bd7b23485b5ec5 languageName: node linkType: hard @@ -4802,6 +5281,13 @@ __metadata: languageName: node linkType: hard +"to-readable-stream@npm:^1.0.0": + version: 1.0.0 + resolution: "to-readable-stream@npm:1.0.0" + checksum: 2bd7778490b6214a2c40276065dd88949f4cf7037ce3964c76838b8cb212893aeb9cceaaf4352a4c486e3336214c350270f3263e1ce7a0c38863a715a4d9aeb5 + languageName: node + linkType: hard + "to-regex-range@npm:^5.0.1": version: 5.0.1 resolution: "to-regex-range@npm:5.0.1" @@ -4811,6 +5297,16 @@ __metadata: languageName: node linkType: hard +"token-types@npm:^5.0.0-alpha.2": + version: 5.0.0-alpha.2 + resolution: "token-types@npm:5.0.0-alpha.2" + dependencies: + "@tokenizer/token": ^0.3.0 + ieee754: ^1.2.1 + checksum: ee23eeed6f383b1072d99781d62fc7840f1296a96d47e636e36fca757debd7eb4274d31fcd2d56997606eede00b12b1e61a64610fe0ed7807d6b1c4dcf5ccc6b + languageName: node + linkType: hard + "toposort-class@npm:^1.0.1": version: 1.0.1 resolution: "toposort-class@npm:1.0.1" @@ -4878,6 +5374,13 @@ __metadata: languageName: node linkType: hard +"tunnel@npm:^0.0.6": + version: 0.0.6 + resolution: "tunnel@npm:0.0.6" + checksum: c362948df9ad34b649b5585e54ce2838fa583aa3037091aaed66793c65b423a264e5229f0d7e9a95513a795ac2bd4cb72cda7e89a74313f182c1e9ae0b0994fa + languageName: node + linkType: hard + "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -4894,6 +5397,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^0.13.1": + version: 0.13.1 + resolution: "type-fest@npm:0.13.1" + checksum: e6bf2e3c449f27d4ef5d56faf8b86feafbc3aec3025fc9a5fbe2db0a2587c44714521f9c30d8516a833c8c506d6263f5cc11267522b10c6ccdb6cc55b0a9d1c4 + languageName: node + linkType: hard + "type-fest@npm:^0.20.2": version: 0.20.2 resolution: "type-fest@npm:0.20.2" @@ -4908,6 +5418,13 @@ __metadata: languageName: node linkType: hard +"typedarray@npm:^0.0.6": + version: 0.0.6 + resolution: "typedarray@npm:0.0.6" + checksum: 33b39f3d0e8463985eeaeeacc3cb2e28bc3dfaf2a5ed219628c0b629d5d7b810b0eb2165f9f607c34871d5daa92ba1dc69f49051cf7d578b4cbd26c340b9d1b1 + languageName: node + linkType: hard + "typescript@npm:^4.7.4": version: 4.7.4 resolution: "typescript@npm:4.7.4" @@ -4964,6 +5481,13 @@ __metadata: languageName: node linkType: hard +"undici@npm:^5.7.0": + version: 5.8.0 + resolution: "undici@npm:5.8.0" + checksum: 7b486ad064da00628d3906e140b86223023cd3494c811da8d7aa1375c2392fe6a6ac421af236c056fd3d3136bba3a91b99e0505dde071dd946070946eb0718b8 + languageName: node + linkType: hard + "unique-filename@npm:^1.1.1": version: 1.1.1 resolution: "unique-filename@npm:1.1.1" @@ -4982,6 +5506,13 @@ __metadata: languageName: node linkType: hard +"universalify@npm:^0.1.0": + version: 0.1.2 + resolution: "universalify@npm:0.1.2" + checksum: 40cdc60f6e61070fe658ca36016a8f4ec216b29bf04a55dce14e3710cc84c7448538ef4dad3728d0bfe29975ccd7bfb5f414c45e7b78883567fb31b246f02dff + languageName: node + linkType: hard + "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" @@ -4991,6 +5522,15 @@ __metadata: languageName: node linkType: hard +"url-parse-lax@npm:^3.0.0": + version: 3.0.0 + resolution: "url-parse-lax@npm:3.0.0" + dependencies: + prepend-http: ^2.0.0 + checksum: 1040e357750451173132228036aff1fd04abbd43eac1fb3e4fca7495a078bcb8d33cb765fe71ad7e473d9c94d98fd67adca63bd2716c815a2da066198dd37217 + languageName: node + linkType: hard + "url-template@npm:^2.0.8": version: 2.0.8 resolution: "url-template@npm:2.0.8" @@ -5060,18 +5600,18 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^0.18.0": - version: 0.18.0 - resolution: "vitest@npm:0.18.0" +"vitest@npm:^0.18.1": + version: 0.18.1 + resolution: "vitest@npm:0.18.1" dependencies: "@types/chai": ^4.3.1 "@types/chai-subset": ^1.3.3 "@types/node": "*" chai: ^4.3.6 debug: ^4.3.4 - local-pkg: ^0.4.1 - tinypool: ^0.2.1 - tinyspy: ^0.3.3 + local-pkg: ^0.4.2 + tinypool: ^0.2.4 + tinyspy: ^1.0.0 vite: ^2.9.12 || ^3.0.0-0 peerDependencies: "@edge-runtime/vm": "*" @@ -5092,7 +5632,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: 20e76b0de9f02dd09a412b11e5898d1ec7c5c9f9287da40a79fde98f6bd100db6f777fb5f1370496a2c153277cc5eb6738e176435101332fce1c87a565e62d5f + checksum: 0d3a77625eb542bae27715cb24c91b7f4379d1084ce154ff54c991ab669fe0977a927121d232e6659e97b71b852060ca85c0b1825612f2e092b436e24cca276c languageName: node linkType: hard @@ -5235,7 +5775,7 @@ __metadata: languageName: node linkType: hard -"yauzl@npm:^2.4.2": +"yauzl@npm:^2.10.0, yauzl@npm:^2.4.2": version: 2.10.0 resolution: "yauzl@npm:2.10.0" dependencies: -- cgit From 18ba8b2743c3cad7e89b70d0e1dcacacc007f6d6 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 20:11:08 -0400 Subject: wip tickets --- src/commands/tickets/ticket-!.ts | 63 +++++++++++++++++++++++++++++++++++ src/commands/tickets/ticket-create.ts | 0 2 files changed, 63 insertions(+) create mode 100644 src/commands/tickets/ticket-create.ts diff --git a/src/commands/tickets/ticket-!.ts b/src/commands/tickets/ticket-!.ts index e69de29..7751df1 100644 --- a/src/commands/tickets/ticket-!.ts +++ b/src/commands/tickets/ticket-!.ts @@ -0,0 +1,63 @@ +import { BushCommand, clientSendAndPermCheck, deepWriteable, type SlashMessage } from '#lib'; +import { Flag, type ArgumentGeneratorReturn, type SlashOption } from 'discord-akairo'; +import { ApplicationCommandOptionType } from 'discord.js'; + +export const ticketSubcommands = deepWriteable({ + create: { + description: 'Create a ticket.', + type: ApplicationCommandOptionType.Subcommand, + options: [ + { + name: 'word', + description: 'What word do you want to highlight?', + retry: '{error} Enter a valid word.', + type: ApplicationCommandOptionType.String, + required: true + } + ] + } +} as const); + +export default class TicketCommand extends BushCommand { + public constructor() { + super('ticket', { + aliases: ['ticket'], + category: 'ticket', + description: 'Manage tickets.', + usage: ['ticket create '], + examples: ['ticket creates very cool ticket'], + slashOptions: Object.entries(ticketSubcommands).map( + ([subcommand, options]) => ({ name: subcommand, ...options } as SlashOption) + ), + slash: true, + channel: 'guild', + clientPermissions: (m) => clientSendAndPermCheck(m), + userPermissions: [] + }); + } + + public override *args(): ArgumentGeneratorReturn { + const subcommand: keyof typeof ticketSubcommands = yield { + id: 'subcommand', + type: Object.keys(ticketSubcommands), + prompt: { + start: 'What sub command would you like to use?', + retry: `{error} Valid subcommands are: ${Object.keys(ticketSubcommands) + .map((s) => `\`${s}\``) + .join()}.` + } + }; + + return Flag.continue(`ticket-${subcommand}`); + } + + public override async exec() { + throw new Error('This command is not meant to be executed directly.'); + } + + public override async execSlash(message: SlashMessage, args: { subcommand: string; subcommandGroup?: string }) { + // manual `Flag.continue` + const subcommand = this.handler.modules.get(`ticket-${args.subcommandGroup ?? args.subcommand}`)!; + return subcommand.exec(message, args); + } +} diff --git a/src/commands/tickets/ticket-create.ts b/src/commands/tickets/ticket-create.ts new file mode 100644 index 0000000..e69de29 -- cgit From 2ec1de170091178263e53ecfce744c7a0710a409 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 20:11:45 -0400 Subject: wip tooltip rendering --- .eslintignore | 5 + assets/minecraft_font.ttf | Bin 0 -> 15700 bytes src/commands/moulberry-bush/neuRepo.ts | 153 +++++++++++++- src/lib/common/util/Minecraft.ts | 234 +++++++++++---------- src/lib/common/util/Minecraft_Test.ts | 86 ++++++++ test.js | 365 +++++++++++++++++++++++++++++++++ test.png | Bin 0 -> 41015 bytes tooltips.nnb | 118 +++++++++++ tsconfig.eslint.json | 15 ++ tsconfig.json | 13 +- 10 files changed, 865 insertions(+), 124 deletions(-) create mode 100644 .eslintignore create mode 100644 assets/minecraft_font.ttf create mode 100644 src/lib/common/util/Minecraft_Test.ts create mode 100644 test.js create mode 100644 test.png create mode 100644 tooltips.nnb create mode 100644 tsconfig.eslint.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..c531fde --- /dev/null +++ b/.eslintignore @@ -0,0 +1,5 @@ +dist +.yarn +node_modules +*.nnb +tooltips* \ No newline at end of file diff --git a/assets/minecraft_font.ttf b/assets/minecraft_font.ttf new file mode 100644 index 0000000..61b4610 Binary files /dev/null and b/assets/minecraft_font.ttf differ diff --git a/src/commands/moulberry-bush/neuRepo.ts b/src/commands/moulberry-bush/neuRepo.ts index 24f83ad..9d76810 100644 --- a/src/commands/moulberry-bush/neuRepo.ts +++ b/src/commands/moulberry-bush/neuRepo.ts @@ -1,5 +1,16 @@ import { BushCommand, clientSendAndPermCheck, type ArgType, type CommandMessage, type SlashMessage } from '#lib'; -import { ApplicationCommandOptionType, AutocompleteInteraction, CacheType, PermissionFlagsBits } from 'discord.js'; +import canvas from 'canvas'; +import { + ApplicationCommandOptionType, + AttachmentBuilder, + AutocompleteInteraction, + CacheType, + PermissionFlagsBits +} from 'discord.js'; +import { dirname, join } from 'path'; +import tinycolor from 'tinycolor2'; +import { fileURLToPath } from 'url'; +import { formattingInfo, RawNeuItem } from '../../lib/common/util/Minecraft.js'; export default class NeuRepoCommand extends BushCommand { public static items: { name: string; id: string }[] = []; @@ -34,14 +45,148 @@ export default class NeuRepoCommand extends BushCommand { ], slash: true, clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true), - userPermissions: [] + userPermissions: [], + ownerOnly: true }); } public override async exec( message: CommandMessage | SlashMessage, args: { item: ArgType<'string'> /* dangerous: ArgType<'flag'> */ } - ) {} + ) { + const itemPath = join(import.meta.url, '..', '..', '..', '..', '..', 'neu-item-repo-dangerous', 'items', `${args.item}.json`); + const item = (await import(itemPath, { assert: { type: 'json' } })).default as RawNeuItem; - public override async autocomplete(interaction: AutocompleteInteraction) {} + const toolTip = this.toolTip(item); + + return message.util.reply({ + files: [new AttachmentBuilder(toolTip, { name: `${item.internalname}.png`, description: item.displayname })] + }); + } + + public toolTip(item: RawNeuItem): Buffer { + canvas.registerFont(join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..', '..', 'assets', 'Faithful.ttf'), { + family: 'Faithful' + }); + + const background = '#100010'; + + const width = 250; + const height = 250; + const scale = 10; + + const itemRender = canvas.createCanvas(width, height), + ctx = itemRender.getContext('2d'); + + ctx.globalAlpha = 0.94; + ctx.fillStyle = background; + + // top outside + ctx.fillRect(scale, 0, width - 2 * scale, scale); + + // bottom outside + ctx.fillRect(scale, height - scale, width - 2 * scale, scale); + + // left outside + ctx.fillRect(0, scale, scale, height - 2 * scale); + + // right outside + ctx.fillRect(width - scale, scale, scale, height - 2 * scale); + + // middle + ctx.fillRect(2 * scale, 2 * scale, width - 4 * scale, height - 4 * scale); + + ctx.globalAlpha = 0.78; + + const borderColorStart = parseInt(new tinycolor(this.getPrimaryColour(item.displayname)).toHex(), 16); + const borderColorEnd = ((borderColorStart & 0xfefefe) >> 1) | (borderColorStart & 0xff000000); + + const borderColorStartStr = `#${borderColorStart.toString(16)}`; + const borderColorEndStr = `#${borderColorEnd.toString(16)}`; + + ctx.fillStyle = borderColorStartStr; + + // top highlight + ctx.fillRect(scale, scale, width - 2 * scale, scale); + + // left highlight + ctx.fillRect(scale, 2 * scale, scale, height - 3 * scale); + + // bottom highlight + { + const x = 2 * scale, + y = height - 2 * scale, + w = width - 3 * scale, + h = scale; + const gradient = ctx.createLinearGradient(x, y, x + w, y + h); + gradient.addColorStop(0, borderColorStartStr); + gradient.addColorStop(1, borderColorEndStr); + ctx.fillStyle = gradient; + + ctx.fillRect(x, y, w, h); + } + + // right highlight + { + const x = width - 2 * scale, + y = 2 * scale, + w = scale, + h = height - 4 * scale; + const gradient = ctx.createLinearGradient(x, y, x + w, y + h); + gradient.addColorStop(0, borderColorStartStr); + gradient.addColorStop(1, borderColorEndStr); + ctx.fillStyle = gradient; + + ctx.fillRect(x, y, w, h); + } + + item.displayname.split(''); + + return itemRender.toBuffer(); + } + + // stolen from NEU and modified + public getPrimaryColourCode(displayname: string): code { + let lastColourCode = -99; + let currentColour = 0; + const mostCommon = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + for (let i = 0; i < displayname.length; i++) { + const c = displayname.charAt(i); + if (c === '\u00A7') { + lastColourCode = i; + } else if (lastColourCode === i - 1) { + const colIndex = '0123456789abcdef'.indexOf(c); + if (colIndex >= 0) { + currentColour = colIndex; + } else { + currentColour = 0; + } + } else if ('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.indexOf(c) >= 0) { + if (currentColour > 0) { + mostCommon[currentColour] = mostCommon[currentColour]++; + } + } + } + let mostCommonCount = 0; + for (let index = 0; index < mostCommon.length; index++) { + if (mostCommon[index] > mostCommonCount) { + mostCommonCount = mostCommon[index]; + currentColour = index; + } + } + + return '0123456789abcdef'.charAt(currentColour); + } + + // stolen from NEU and modified + public getPrimaryColour(displayname: string) { + const code = this.getPrimaryColourCode(displayname); + return formattingInfo[`§${code}`].foregroundDarker; + } + + public override async autocomplete(interaction: AutocompleteInteraction) { + return interaction.respond([{ name: 'Blazetekk™ Ham Radio', value: 'BLAZETEKK_HAM_RADIO' }]); + } } + +type code = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f'; diff --git a/src/lib/common/util/Minecraft.ts b/src/lib/common/util/Minecraft.ts index b4b013f..a12ebf2 100644 --- a/src/lib/common/util/Minecraft.ts +++ b/src/lib/common/util/Minecraft.ts @@ -1,6 +1,5 @@ import { Byte, Int, parse } from '@ironm00n/nbt-ts'; import { BitField } from 'discord.js'; -import fs from 'fs/promises'; import path from 'path'; import { fileURLToPath } from 'url'; @@ -34,22 +33,118 @@ export enum FormattingCodes { // https://minecraft.fandom.com/wiki/Formatting_codes export const formattingInfo = { - [FormattingCodes.Black]: { foreground: '#000000', background: '#000000', ansi: '\u001b[0;30m' }, - [FormattingCodes.DarkBlue]: { foreground: '#0000AA', background: '#00002A', ansi: '\u001b[0;34m' }, - [FormattingCodes.DarkGreen]: { foreground: '#00AA00', background: '#002A00', ansi: '\u001b[0;32m' }, - [FormattingCodes.DarkAqua]: { foreground: '#00AAAA', background: '#002A2A', ansi: '\u001b[0;36m' }, - [FormattingCodes.DarkRed]: { foreground: '#AA0000', background: '#2A0000', ansi: '\u001b[0;31m' }, - [FormattingCodes.DarkPurple]: { foreground: '#AA00AA', background: '#2A002A', ansi: '\u001b[0;35m' }, - [FormattingCodes.Gold]: { foreground: '#FFAA00', background: '#2A2A00', ansi: '\u001b[0;33m' }, - [FormattingCodes.Gray]: { foreground: '#AAAAAA', background: '#2A2A2A', ansi: '\u001b[0;37m' }, - [FormattingCodes.DarkGray]: { foreground: '#555555', background: '#151515', ansi: '\u001b[0;90m' }, - [FormattingCodes.Blue]: { foreground: '#5555FF', background: '#15153F', ansi: '\u001b[0;94m' }, - [FormattingCodes.Green]: { foreground: '#55FF55', background: '#153F15', ansi: '\u001b[0;92m' }, - [FormattingCodes.Aqua]: { foreground: '#55FFFF', background: '#153F3F', ansi: '\u001b[0;96m' }, - [FormattingCodes.Red]: { foreground: '#FF5555', background: '#3F1515', ansi: '\u001b[0;91m' }, - [FormattingCodes.LightPurple]: { foreground: '#FF55FF', background: '#3F153F', ansi: '\u001b[0;95m' }, - [FormattingCodes.Yellow]: { foreground: '#FFFF55', background: '#3F3F15', ansi: '\u001b[0;93m' }, - [FormattingCodes.White]: { foreground: '#FFFFFF', background: '#3F3F3F', ansi: '\u001b[0;97m' }, + [FormattingCodes.Black]: { + foreground: 'rgb(0, 0, 0)', + foregroundDarker: 'rgb(0, 0, 0)', + background: 'rgb(0, 0, 0)', + backgroundDarker: 'rgb(0, 0, 0)', + ansi: '\u001b[0;30m' + }, + [FormattingCodes.DarkBlue]: { + foreground: 'rgb(0, 0, 170)', + foregroundDarker: 'rgb(0, 0, 118)', + background: 'rgb(0, 0, 42)', + backgroundDarker: 'rgb(0, 0, 29)', + ansi: '\u001b[0;34m' + }, + [FormattingCodes.DarkGreen]: { + foreground: 'rgb(0, 170, 0)', + foregroundDarker: 'rgb(0, 118, 0)', + background: 'rgb(0, 42, 0)', + backgroundDarker: 'rgb(0, 29, 0)', + ansi: '\u001b[0;32m' + }, + [FormattingCodes.DarkAqua]: { + foreground: 'rgb(0, 170, 170)', + foregroundDarker: 'rgb(0, 118, 118)', + background: 'rgb(0, 42, 42)', + backgroundDarker: 'rgb(0, 29, 29)', + ansi: '\u001b[0;36m' + }, + [FormattingCodes.DarkRed]: { + foreground: 'rgb(170, 0, 0)', + foregroundDarker: 'rgb(118, 0, 0)', + background: 'rgb(42, 0, 0)', + backgroundDarker: 'rgb(29, 0, 0)', + ansi: '\u001b[0;31m' + }, + [FormattingCodes.DarkPurple]: { + foreground: 'rgb(170, 0, 170)', + foregroundDarker: 'rgb(118, 0, 118)', + background: 'rgb(42, 0, 42)', + backgroundDarker: 'rgb(29, 0, 29)', + ansi: '\u001b[0;35m' + }, + [FormattingCodes.Gold]: { + foreground: 'rgb(255, 170, 0)', + foregroundDarker: 'rgb(178, 118, 0)', + background: 'rgb(42, 42, 0)', + backgroundDarker: 'rgb(29, 29, 0)', + ansi: '\u001b[0;33m' + }, + [FormattingCodes.Gray]: { + foreground: 'rgb(170, 170, 170)', + foregroundDarker: 'rgb(118, 118, 118)', + background: 'rgb(42, 42, 42)', + backgroundDarker: 'rgb(29, 29, 29)', + ansi: '\u001b[0;37m' + }, + [FormattingCodes.DarkGray]: { + foreground: 'rgb(85, 85, 85)', + foregroundDarker: 'rgb(59, 59, 59)', + background: 'rgb(21, 21, 21)', + backgroundDarker: 'rgb(14, 14, 14)', + ansi: '\u001b[0;90m' + }, + [FormattingCodes.Blue]: { + foreground: 'rgb(85, 85, 255)', + foregroundDarker: 'rgb(59, 59, 178)', + background: 'rgb(21, 21, 63)', + backgroundDarker: 'rgb(14, 14, 44)', + ansi: '\u001b[0;94m' + }, + [FormattingCodes.Green]: { + foreground: 'rgb(85, 255, 85)', + foregroundDarker: 'rgb(59, 178, 59)', + background: 'rgb(21, 63, 21)', + backgroundDarker: 'rgb(14, 44, 14)', + ansi: '\u001b[0;92m' + }, + [FormattingCodes.Aqua]: { + foreground: 'rgb(85, 255, 255)', + foregroundDarker: 'rgb(59, 178, 178)', + background: 'rgb(21, 63, 63)', + backgroundDarker: 'rgb(14, 44, 44)', + ansi: '\u001b[0;96m' + }, + [FormattingCodes.Red]: { + foreground: 'rgb(255, 85, 85)', + foregroundDarker: 'rgb(178, 59, 59)', + background: 'rgb(63, 21, 21)', + backgroundDarker: 'rgb(44, 14, 14)', + ansi: '\u001b[0;91m' + }, + [FormattingCodes.LightPurple]: { + foreground: 'rgb(255, 85, 255)', + foregroundDarker: 'rgb(178, 59, 178)', + background: 'rgb(63, 21, 63)', + backgroundDarker: 'rgb(44, 14, 44)', + ansi: '\u001b[0;95m' + }, + [FormattingCodes.Yellow]: { + foreground: 'rgb(255, 255, 85)', + foregroundDarker: 'rgb(178, 178, 59)', + background: 'rgb(63, 63, 21)', + backgroundDarker: 'rgb(44, 44, 14)', + ansi: '\u001b[0;93m' + }, + [FormattingCodes.White]: { + foreground: 'rgb(255, 255, 255)', + foregroundDarker: 'rgb(178, 178, 178)', + background: 'rgb(63, 63, 63)', + backgroundDarker: 'rgb(44, 44, 44)', + ansi: '\u001b[0;97m' + }, [FormattingCodes.Obfuscated]: { ansi: '\u001b[8m' }, [FormattingCodes.Bold]: { ansi: '\u001b[1m' }, @@ -68,7 +163,7 @@ export type SbRecipe = { }; export type InfoType = 'WIKI_URL' | ''; -type Slayer = `${'WOLF' | 'BLAZE' | 'EMAN'}_${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`; +export type Slayer = `${'WOLF' | 'BLAZE' | 'EMAN'}_${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`; export interface RawNeuItem { itemid: McItemId; @@ -128,87 +223,8 @@ export function removeMCFormatting(str: string) { } const repo = path.join(__dirname, '..', '..', '..', '..', '..', 'neu-item-repo-dangerous'); -const itemPath = path.join(repo, 'items'); -const items = await fs.readdir(itemPath); - -// for (let i = 0; i < 5; i++) { -for (const path_ of items) { - // const randomItem = items[Math.floor(Math.random() * items.length)]; - // console.log(randomItem); - const item = (await import(path.join(itemPath, /* randomItem */ path_), { assert: { type: 'json' } })).default as RawNeuItem; - if (/.*?((_MONSTER)|(_NPC)|(_ANIMAL)|(_MINIBOSS)|(_BOSS)|(_SC))$/.test(item.internalname)) continue; - if (!/.*?;[0-5]$/.test(item.internalname)) continue; - /* console.log(path_); - console.dir(item, { depth: Infinity }); */ - - /* console.log('==========='); */ - const nbt = parse(item.nbttag) as NbtTag; - - if (nbt?.SkullOwner?.Properties?.textures?.[0]?.Value) { - nbt.SkullOwner.Properties.textures[0].Value = parse( - Buffer.from(nbt.SkullOwner.Properties.textures[0].Value, 'base64').toString('utf-8') - ) as string; - } - - if (nbt.ExtraAttributes?.petInfo) { - nbt.ExtraAttributes.petInfo = JSON.parse(nbt.ExtraAttributes.petInfo as any as string); - } - // delete nbt.display?.Lore; - - console.dir(nbt, { depth: Infinity }); - console.log('==========='); - - /* if (nbt?.display && nbt.display.Name !== item.displayname) - console.log(`${path_} display name mismatch: ${mcToAnsi(nbt.display.Name)} != ${mcToAnsi(item.displayname)}`); - - if (nbt?.ExtraAttributes && nbt?.ExtraAttributes.id !== item.internalname) - console.log(`${path_} internal name mismatch: ${mcToAnsi(nbt?.ExtraAttributes.id)} != ${mcToAnsi(item.internalname)}`); */ - - /* console.log('==========='); - - console.log(mcToAnsi(item.displayname)); - console.log(item.lore.map((l) => mcToAnsi(l)).join('\n')); */ - - /* const keys = [ - 'itemid', - 'displayname', - 'nbttag', - 'damage', - 'lore', - 'recipe', - 'internalname', - 'modver', - 'infoType', - 'info', - 'crafttext', - 'vanilla', - 'useneucraft', - 'slayer_req', - 'clickcommand', - 'x', - 'y', - 'z', - 'island', - 'recipes', - 'parent', - 'noseal' - ]; - - Object.keys(item).forEach((k) => { - if (!keys.includes(k)) throw new Error(`Unknown key: ${k}`); - }); - - if ( - 'slayer_req' in item && - !new Array(10).flatMap((_, i) => ['WOLF', 'BLAZE', 'EMAN'].map((e) => e + (i + 1)).includes(item.slayer_req!)) - ) - throw new Error(`Unknown slayer req: ${item.slayer_req!}`); */ - - /* console.log('=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-'); */ -} - -interface NbtTag { +export interface NbtTag { overrideMeta?: Byte; Unbreakable?: Int; ench?: string[]; @@ -218,22 +234,22 @@ interface NbtTag { ExtraAttributes?: ExtraAttributes; } -interface SkullOwner { +export interface SkullOwner { Id?: string; Properties?: { textures?: { Value?: string }[]; }; } -interface NbtTagDisplay { +export interface NbtTagDisplay { Lore?: string[]; color?: Int; Name?: string; } -type RuneId = string; +export type RuneId = string; -interface ExtraAttributes { +export interface ExtraAttributes { originTag?: Origin; id?: string; generator_tier?: Int; @@ -244,7 +260,7 @@ interface ExtraAttributes { petInfo?: PetInfo; } -interface PetInfo { +export interface PetInfo { type: 'ZOMBIE'; active: boolean; exp: number; @@ -253,7 +269,7 @@ interface PetInfo { candyUsed: number; } -type Origin = 'SHOP_PURCHASE'; +export type Origin = 'SHOP_PURCHASE'; const neuConstantsPath = path.join(repo, 'constants'); const neuPetsPath = path.join(neuConstantsPath, 'pets.json'); @@ -261,14 +277,14 @@ const neuPets = (await import(neuPetsPath, { assert: { type: 'json' } })) as Pet const neuPetNumsPath = path.join(neuConstantsPath, 'petnums.json'); const neuPetNums = (await import(neuPetNumsPath, { assert: { type: 'json' } })) as PetNums; -interface PetsConstants { +export interface PetsConstants { pet_rarity_offset: Record; pet_levels: number[]; custom_pet_leveling: Record; pet_types: Record; } -interface PetNums { +export interface PetNums { [key: string]: { [key: string]: { '1': { @@ -284,7 +300,7 @@ interface PetNums { }; } -class NeuItem { +export class NeuItem { public itemId: McItemId; public displayName: string; public nbtTag: NbtTag; @@ -315,6 +331,8 @@ class NeuItem { const curve = petInfoTier?.stats_levelling_curve?.split(';'); + // todo: finish copying from neu + const minStatsLevel = parseInt(curve?.[0] ?? '0'); const maxStatsLevel = parseInt(curve?.[0] ?? '100'); @@ -323,7 +341,7 @@ class NeuItem { } } -function mcToAnsi(str: string) { +export function mcToAnsi(str: string) { for (const format in formattingInfo) { str = str.replaceAll(format, formattingInfo[format as keyof typeof formattingInfo].ansi); } diff --git a/src/lib/common/util/Minecraft_Test.ts b/src/lib/common/util/Minecraft_Test.ts new file mode 100644 index 0000000..26ca648 --- /dev/null +++ b/src/lib/common/util/Minecraft_Test.ts @@ -0,0 +1,86 @@ +import fs from 'fs/promises'; +import path from 'path'; +import { fileURLToPath } from 'url'; +import { mcToAnsi, RawNeuItem } from './Minecraft.js'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const repo = path.join(__dirname, '..', '..', '..', '..', '..', 'neu-item-repo-dangerous'); +const itemPath = path.join(repo, 'items'); +const items = await fs.readdir(itemPath); + +// for (let i = 0; i < 5; i++) { +for (const path_ of items) { + // const randomItem = items[Math.floor(Math.random() * items.length)]; + // console.log(randomItem); + const item = (await import(path.join(itemPath, /* randomItem */ path_), { assert: { type: 'json' } })).default as RawNeuItem; + if (/.*?((_MONSTER)|(_NPC)|(_ANIMAL)|(_MINIBOSS)|(_BOSS)|(_SC))$/.test(item.internalname)) continue; + if (!/.*?;[0-5]$/.test(item.internalname)) continue; + /* console.log(path_); + console.dir(item, { depth: Infinity }); */ + + /* console.log('==========='); */ + // const nbt = parse(item.nbttag) as NbtTag; + + // if (nbt?.SkullOwner?.Properties?.textures?.[0]?.Value) { + // nbt.SkullOwner.Properties.textures[0].Value = parse( + // Buffer.from(nbt.SkullOwner.Properties.textures[0].Value, 'base64').toString('utf-8') + // ) as string; + // } + + // if (nbt.ExtraAttributes?.petInfo) { + // nbt.ExtraAttributes.petInfo = JSON.parse(nbt.ExtraAttributes.petInfo as any as string); + // } + + // delete nbt.display?.Lore; + + // console.dir(nbt, { depth: Infinity }); + // console.log('==========='); + + /* if (nbt?.display && nbt.display.Name !== item.displayname) + console.log(`${path_} display name mismatch: ${mcToAnsi(nbt.display.Name)} != ${mcToAnsi(item.displayname)}`); + + if (nbt?.ExtraAttributes && nbt?.ExtraAttributes.id !== item.internalname) + console.log(`${path_} internal name mismatch: ${mcToAnsi(nbt?.ExtraAttributes.id)} != ${mcToAnsi(item.internalname)}`); */ + + // console.log('==========='); + + console.log(mcToAnsi(item.displayname)); + console.log(item.lore.map((l) => mcToAnsi(l)).join('\n')); + + /* const keys = [ + 'itemid', + 'displayname', + 'nbttag', + 'damage', + 'lore', + 'recipe', + 'internalname', + 'modver', + 'infoType', + 'info', + 'crafttext', + 'vanilla', + 'useneucraft', + 'slayer_req', + 'clickcommand', + 'x', + 'y', + 'z', + 'island', + 'recipes', + 'parent', + 'noseal' + ]; + + Object.keys(item).forEach((k) => { + if (!keys.includes(k)) throw new Error(`Unknown key: ${k}`); + }); + + if ( + 'slayer_req' in item && + !new Array(10).flatMap((_, i) => ['WOLF', 'BLAZE', 'EMAN'].map((e) => e + (i + 1)).includes(item.slayer_req!)) + ) + throw new Error(`Unknown slayer req: ${item.slayer_req!}`); */ + + /* console.log('=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-'); */ +} diff --git a/test.js b/test.js new file mode 100644 index 0000000..d0840ec --- /dev/null +++ b/test.js @@ -0,0 +1,365 @@ +/* eslint-disable */ +// @ts-check + +import { createCanvas, registerFont } from 'canvas'; +import fs from 'fs/promises'; +import path, { dirname, join } from 'path'; +import tinycolor from 'tinycolor2'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +registerFont(join(__dirname, 'assets', 'Faithful.ttf'), { family: 'ComplianceSans' }); +registerFont(join(dirname(fileURLToPath(import.meta.url)), 'assets', 'Roboto-Regular.ttf'), { family: 'Roboto' }); + +/** @typedef {string} McItemId */ +/** @typedef {string} SbItemId */ +/** @typedef {string} MojangJson */ +/** @typedef {`${SbItemId}:${number}` | ''} SbRecipeItem */ +/** @typedef {{[Location in `${'A' | 'B' | 'C'}${1 | 2 | 3}`]: SbRecipeItem;}} SbRecipe */ +/** @typedef {'WIKI_URL' | ''} InfoType */ +/** @typedef {`${'WOLF' | 'BLAZE' | 'EMAN'}_${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`} Slayer */ +/** @typedef {'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'|'a'|'b'|'c'|'d'|'e'|'f'} code */ +/** + * @typedef RawNeuItem + * @property {McItemId} itemid + * @property {string} displayname + * @property {MojangJson} nbttag + * @property {number} damage + * @property {string[]} lore + * @property {SbRecipe} [recipe] + * @property {SbItemId} internalname + * @property {InfoType} infoType + * @property {string[]} [info] + * @property {string} crafttext + * @property {boolean} [vanilla] + * @property {boolean} [useneucraft] + * @property {Slayer} [slayer_req] + * @property {string} [clickcommand] + * @property {number} [x] + * @property {number} [y] + * @property {number} [z] + * @property {string} [island] + * @property {{ type: string; cost: any[]; result: SbItemId }[]} [recipes] + * @property {SbItemId} [parent] + * @property {boolean} [noseal] + */ + +const FormattingCodes = { + Black: '§0', + DarkBlue: '§1', + DarkGreen: '§2', + DarkAqua: '§3', + DarkRed: '§4', + DarkPurple: '§5', + Gold: '§6', + Gray: '§7', + DarkGray: '§8', + Blue: '§9', + Green: '§a', + Aqua: '§b', + Red: '§c', + LightPurple: '§d', + Yellow: '§e', + White: '§f', + + Obfuscated: '§k', + Bold: '§l', + Strikethrough: '§m', + Underline: '§n', + Italic: '§o', + Reset: '§r' +}; + +const formattingInfo = { + [FormattingCodes.Black]: { + foreground: 'rgb(0, 0, 0)', + foregroundDarker: 'rgb(0, 0, 0)', + background: 'rgb(0, 0, 0)', + backgroundDarker: 'rgb(0, 0, 0)', + ansi: '\u001b[0;30m' + }, + [FormattingCodes.DarkBlue]: { + foreground: 'rgb(0, 0, 170)', + foregroundDarker: 'rgb(0, 0, 118)', + background: 'rgb(0, 0, 42)', + backgroundDarker: 'rgb(0, 0, 29)', + ansi: '\u001b[0;34m' + }, + [FormattingCodes.DarkGreen]: { + foreground: 'rgb(0, 170, 0)', + foregroundDarker: 'rgb(0, 118, 0)', + background: 'rgb(0, 42, 0)', + backgroundDarker: 'rgb(0, 29, 0)', + ansi: '\u001b[0;32m' + }, + [FormattingCodes.DarkAqua]: { + foreground: 'rgb(0, 170, 170)', + foregroundDarker: 'rgb(0, 118, 118)', + background: 'rgb(0, 42, 42)', + backgroundDarker: 'rgb(0, 29, 29)', + ansi: '\u001b[0;36m' + }, + [FormattingCodes.DarkRed]: { + foreground: 'rgb(170, 0, 0)', + foregroundDarker: 'rgb(118, 0, 0)', + background: 'rgb(42, 0, 0)', + backgroundDarker: 'rgb(29, 0, 0)', + ansi: '\u001b[0;31m' + }, + [FormattingCodes.DarkPurple]: { + foreground: 'rgb(170, 0, 170)', + foregroundDarker: 'rgb(118, 0, 118)', + background: 'rgb(42, 0, 42)', + backgroundDarker: 'rgb(29, 0, 29)', + ansi: '\u001b[0;35m' + }, + [FormattingCodes.Gold]: { + foreground: 'rgb(255, 170, 0)', + foregroundDarker: 'rgb(178, 118, 0)', + background: 'rgb(42, 42, 0)', + backgroundDarker: 'rgb(29, 29, 0)', + ansi: '\u001b[0;33m' + }, + [FormattingCodes.Gray]: { + foreground: 'rgb(170, 170, 170)', + foregroundDarker: 'rgb(118, 118, 118)', + background: 'rgb(42, 42, 42)', + backgroundDarker: 'rgb(29, 29, 29)', + ansi: '\u001b[0;37m' + }, + [FormattingCodes.DarkGray]: { + foreground: 'rgb(85, 85, 85)', + foregroundDarker: 'rgb(59, 59, 59)', + background: 'rgb(21, 21, 21)', + backgroundDarker: 'rgb(14, 14, 14)', + ansi: '\u001b[0;90m' + }, + [FormattingCodes.Blue]: { + foreground: 'rgb(85, 85, 255)', + foregroundDarker: 'rgb(59, 59, 178)', + background: 'rgb(21, 21, 63)', + backgroundDarker: 'rgb(14, 14, 44)', + ansi: '\u001b[0;94m' + }, + [FormattingCodes.Green]: { + foreground: 'rgb(85, 255, 85)', + foregroundDarker: 'rgb(59, 178, 59)', + background: 'rgb(21, 63, 21)', + backgroundDarker: 'rgb(14, 44, 14)', + ansi: '\u001b[0;92m' + }, + [FormattingCodes.Aqua]: { + foreground: 'rgb(85, 255, 255)', + foregroundDarker: 'rgb(59, 178, 178)', + background: 'rgb(21, 63, 63)', + backgroundDarker: 'rgb(14, 44, 44)', + ansi: '\u001b[0;96m' + }, + [FormattingCodes.Red]: { + foreground: 'rgb(255, 85, 85)', + foregroundDarker: 'rgb(178, 59, 59)', + background: 'rgb(63, 21, 21)', + backgroundDarker: 'rgb(44, 14, 14)', + ansi: '\u001b[0;91m' + }, + [FormattingCodes.LightPurple]: { + foreground: 'rgb(255, 85, 255)', + foregroundDarker: 'rgb(178, 59, 178)', + background: 'rgb(63, 21, 63)', + backgroundDarker: 'rgb(44, 14, 44)', + ansi: '\u001b[0;95m' + }, + [FormattingCodes.Yellow]: { + foreground: 'rgb(255, 255, 85)', + foregroundDarker: 'rgb(178, 178, 59)', + background: 'rgb(63, 63, 21)', + backgroundDarker: 'rgb(44, 44, 14)', + ansi: '\u001b[0;93m' + }, + [FormattingCodes.White]: { + foreground: 'rgb(255, 255, 255)', + foregroundDarker: 'rgb(178, 178, 178)', + background: 'rgb(63, 63, 63)', + backgroundDarker: 'rgb(44, 44, 44)', + ansi: '\u001b[0;97m' + }, + + [FormattingCodes.Obfuscated]: { ansi: '\u001b[8m' }, + [FormattingCodes.Bold]: { ansi: '\u001b[1m' }, + [FormattingCodes.Strikethrough]: { ansi: '\u001b[9m' }, + [FormattingCodes.Underline]: { ansi: '\u001b[4m' }, + [FormattingCodes.Italic]: { ansi: '\u001b[3m' }, + [FormattingCodes.Reset]: { ansi: '\u001b[0m' } +}; + +/** + * stolen from NEU + * @param {string} displayname + * @returns {code} + */ +function getPrimaryColourCode(displayname) { + let lastColourCode = -99; + let currentColour = 0; + const mostCommon = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + for (let i = 0; i < displayname.length; i++) { + const c = displayname.charAt(i); + if (c === '\u00A7') { + lastColourCode = i; + } else if (lastColourCode === i - 1) { + const colIndex = '0123456789abcdef'.indexOf(c); + if (colIndex >= 0) { + currentColour = colIndex; + } else { + currentColour = 0; + } + } else if ('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.indexOf(c) >= 0) { + if (currentColour > 0) { + mostCommon[currentColour] = mostCommon[currentColour]++; + } + } + } + let mostCommonCount = 0; + for (let index = 0; index < mostCommon.length; index++) { + if (mostCommon[index] > mostCommonCount) { + mostCommonCount = mostCommon[index]; + currentColour = index; + } + } + + /** @type {code} */ + // @ts-ignore + const code = '0123456789abcdef'.charAt(currentColour); + return code; +} + +/** + * @param {number} decimal + */ +function decimalToHex(decimal) { + return decimal.toString(16).padStart(6, '0'); +} + +/** + * @param {RawNeuItem} item + * @returns {Buffer} + */ +function tooltip(item) { + const background = '#100010'; + + const width = 1920; + const height = 1080; + const scale = 10; + + const itemRender = createCanvas(width, height), + ctx = itemRender.getContext('2d'); + + // ctx.fillStyle = '#000'; + // ctx.fillRect(0, 0, width, height); + + // ctx.globalAlpha = 0.94; + ctx.fillStyle = background; + + // top outside + ctx.fillRect(scale, 0, width - 2 * scale, scale); + + // bottom outside + ctx.fillRect(scale, height - scale, width - 2 * scale, scale); + + // left outside + ctx.fillRect(0, scale, scale, height - 2 * scale); + + // right outside + ctx.fillRect(width - scale, scale, scale, height - 2 * scale); + + // middle + ctx.fillRect(2 * scale, 2 * scale, width - 4 * scale, height - 4 * scale); + + // ctx.globalAlpha = 0.78; + + const borderColorStart = parseInt(new tinycolor(getPrimaryColour(item.displayname)).toHex(), 16); + const borderColorEnd = ((borderColorStart & 0xfefefe) >> 1) | (borderColorStart & 0xff000000); + + const borderColorStartStr = `#${decimalToHex(borderColorStart)}`; + const borderColorEndStr = `#${decimalToHex(borderColorEnd)}`; + + console.log(borderColorStartStr, borderColorEndStr); + + ctx.fillStyle = borderColorStartStr; + + // top highlight + ctx.fillRect(scale, scale, width - 2 * scale, scale); + + // left highlight + ctx.fillRect(scale, 2 * scale, scale, height - 3 * scale); + + // bottom highlight + { + const x = 2 * scale, + y = height - 2 * scale, + w = width - 3 * scale, + h = scale; + const gradient = ctx.createLinearGradient(x, y, x + w, y + h); + gradient.addColorStop(0, borderColorStartStr); + gradient.addColorStop(1, borderColorEndStr); + ctx.fillStyle = gradient; + + ctx.fillRect(x, y, w, h); + } + + // right highlight + { + const x = width - 2 * scale, + y = 2 * scale, + w = scale, + h = height - 4 * scale; + const gradient = ctx.createLinearGradient(x, y, x + w, y + h); + gradient.addColorStop(0, borderColorStartStr); + gradient.addColorStop(1, borderColorEndStr); + ctx.fillStyle = gradient; + + ctx.fillRect(x, y, w, h); + } + + ctx.font = `50px ComplianceSans`; + ctx.fillText(stripCodes(item.displayname), scale * 4, scale * 7); + + for (let i = 0; i < item.lore.length; i++) { + const line = item.lore[i]; + + ctx.fillStyle = `#${decimalToHex(parseInt(new tinycolor(getPrimaryColour(line)).toHex(), 16))}`; + ctx.fillText(stripCodes(line), scale * 4, scale * (7 + (i + 1) * 5)); + } + + return itemRender.toBuffer('image/png'); +} + +/** + * @param {string} displayname + */ +function getPrimaryColour(displayname) { + const code = getPrimaryColourCode(displayname); + return formattingInfo[`§${code}`].foregroundDarker; +} + +/** + * @param {string} str + * @returns {string} + */ +function stripCodes(str) { + for (const format in formattingInfo) { + // @ts-ignore + str = str.replaceAll(new RegExp(format, 'ig'), ''); + } + return str; +} + +const repo = path.join(__dirname, 'neu-item-repo-dangerous'); +const itemPath = path.join(repo, 'items'); +const items = await fs.readdir(itemPath); + +const randomItem = items[Math.floor(Math.random() * items.length)]; +/** @type {RawNeuItem} */ +const item = (await import(path.join(itemPath, randomItem), { assert: { type: 'json' } })).default; + +console.log(randomItem); +fs.writeFile('./test.png', tooltip(item)); diff --git a/test.png b/test.png new file mode 100644 index 0000000..942a85e Binary files /dev/null and b/test.png differ diff --git a/tooltips.nnb b/tooltips.nnb new file mode 100644 index 0000000..6e36999 --- /dev/null +++ b/tooltips.nnb @@ -0,0 +1,118 @@ +{ + "cells": [ + { + "language": "markdown", + "source": [ + "# Thingy" + ], + "outputs": [] + }, + { + "language": "typescript", + "source": [ + "function drawGradientRect(\n\tzLevel: number,\n\tleft: number,\n\ttop: number,\n\tright: number,\n\tbottom: number,\n\tstartColor: number,\n\tendColor: number\n) {\n\tconst startAlpha = ((startColor >> 24) & 255) / 255.0;\n\tconst startRed = ((startColor >> 16) & 255) / 255.0;\n\tconst startGreen = ((startColor >> 8) & 255) / 255.0;\n\tconst startBlue = (startColor & 255) / 255.0;\n\tconst endAlpha = ((endColor >> 24) & 255) / 255.0;\n\tconst endRed = ((endColor >> 16) & 255) / 255.0;\n\tconst endGreen = ((endColor >> 8) & 255) / 255.0;\n\tconst endBlue = (endColor & 255) / 255.0;\n\n\tconsole.dir({ startAlpha, startRed, startGreen, startBlue, endAlpha, endRed, endGreen, endBlue });\n\tconsole.dir({\n\t\tstartAlpha: color(startAlpha),\n\t\tstartRed: color(startRed),\n\t\tstartGreen: color(startGreen),\n\t\tstartBlue: color(startBlue),\n\t\tendAlpha: color(endAlpha),\n\t\tendRed: color(endRed),\n\t\tendGreen: color(endGreen),\n\t\tendBlue: color(endBlue)\n\t});\n}\n\nfunction color(num: number) {\n\treturn Math.floor(num * 255);\n}\n\nconst zLevel = 300;\nconst backgroundColor = 0xF0100010;\ndrawGradientRect(\n zLevel,\n 0,\n 0,\n 0,\n 0,\n backgroundColor,\n backgroundColor\n);" + ], + "outputs": [ + { + "items": [ + { + "mime": "application/vnd.code.notebook.stdout", + "value": [ + "{", + " startAlpha: 0.9411764705882353,", + " startRed: 0.06274509803921569,", + " startGreen: 0,", + " startBlue: 0.06274509803921569,", + " endAlpha: 0.9411764705882353,", + " endRed: 0.06274509803921569,", + " endGreen: 0,", + " endBlue: 0.06274509803921569", + "}", + "{", + " startAlpha: 240,", + " startRed: 16,", + " startGreen: 0,", + " startBlue: 16,", + " endAlpha: 240,", + " endRed: 16,", + " endGreen: 0,", + " endBlue: 16", + "}", + "" + ] + } + ] + } + ] + }, + { + "language": "markdown", + "source": [ + "# Thingy 2" + ], + "outputs": [] + }, + { + "language": "typescript", + "source": [ + "enum FormattingCodes {\n\tBlack = '§0',\n\tDarkBlue = '§1',\n\tDarkGreen = '§2',\n\tDarkAqua = '§3',\n\tDarkRed = '§4',\n\tDarkPurple = '§5',\n\tGold = '§6',\n\tGray = '§7',\n\tDarkGray = '§8',\n\tBlue = '§9',\n\tGreen = '§a',\n\tAqua = '§b',\n\tRed = '§c',\n\tLightPurple = '§d',\n\tYellow = '§e',\n\tWhite = '§f',\n\n\tObfuscated = '§k',\n\tBold = '§l',\n\tStrikethrough = '§m',\n\tUnderline = '§n',\n\tItalic = '§o',\n\tReset = '§r'\n}\n\nconst formattingInfo = {\n\t[FormattingCodes.Black]: {\n\t\tforeground: 'rgb(0, 0, 0)',\n\t\tforegroundDarker: 'rgb(0, 0, 0)',\n\t\tbackground: 'rgb(0, 0, 0)',\n\t\tbackgroundDarker: 'rgb(0, 0, 0)',\n\t\tansi: '\\u001b[0;30m'\n\t},\n\t[FormattingCodes.DarkBlue]: {\n\t\tforeground: 'rgb(0, 0, 170)',\n\t\tforegroundDarker: 'rgb(0, 0, 118)',\n\t\tbackground: 'rgb(0, 0, 42)',\n\t\tbackgroundDarker: 'rgb(0, 0, 29)',\n\t\tansi: '\\u001b[0;34m'\n\t},\n\t[FormattingCodes.DarkGreen]: {\n\t\tforeground: 'rgb(0, 170, 0)',\n\t\tforegroundDarker: 'rgb(0, 118, 0)',\n\t\tbackground: 'rgb(0, 42, 0)',\n\t\tbackgroundDarker: 'rgb(0, 29, 0)',\n\t\tansi: '\\u001b[0;32m'\n\t},\n\t[FormattingCodes.DarkAqua]: {\n\t\tforeground: 'rgb(0, 170, 170)',\n\t\tforegroundDarker: 'rgb(0, 118, 118)',\n\t\tbackground: 'rgb(0, 42, 42)',\n\t\tbackgroundDarker: 'rgb(0, 29, 29)',\n\t\tansi: '\\u001b[0;36m'\n\t},\n\t[FormattingCodes.DarkRed]: {\n\t\tforeground: 'rgb(170, 0, 0)',\n\t\tforegroundDarker: 'rgb(118, 0, 0)',\n\t\tbackground: 'rgb(42, 0, 0)',\n\t\tbackgroundDarker: 'rgb(29, 0, 0)',\n\t\tansi: '\\u001b[0;31m'\n\t},\n\t[FormattingCodes.DarkPurple]: {\n\t\tforeground: 'rgb(170, 0, 170)',\n\t\tforegroundDarker: 'rgb(118, 0, 118)',\n\t\tbackground: 'rgb(42, 0, 42)',\n\t\tbackgroundDarker: 'rgb(29, 0, 29)',\n\t\tansi: '\\u001b[0;35m'\n\t},\n\t[FormattingCodes.Gold]: {\n\t\tforeground: 'rgb(255, 170, 0)',\n\t\tforegroundDarker: 'rgb(178, 118, 0)',\n\t\tbackground: 'rgb(42, 42, 0)',\n\t\tbackgroundDarker: 'rgb(29, 29, 0)',\n\t\tansi: '\\u001b[0;33m'\n\t},\n\t[FormattingCodes.Gray]: {\n\t\tforeground: 'rgb(170, 170, 170)',\n\t\tforegroundDarker: 'rgb(118, 118, 118)',\n\t\tbackground: 'rgb(42, 42, 42)',\n\t\tbackgroundDarker: 'rgb(29, 29, 29)',\n\t\tansi: '\\u001b[0;37m'\n\t},\n\t[FormattingCodes.DarkGray]: {\n\t\tforeground: 'rgb(85, 85, 85)',\n\t\tforegroundDarker: 'rgb(59, 59, 59)',\n\t\tbackground: 'rgb(21, 21, 21)',\n\t\tbackgroundDarker: 'rgb(14, 14, 14)',\n\t\tansi: '\\u001b[0;90m'\n\t},\n\t[FormattingCodes.Blue]: {\n\t\tforeground: 'rgb(85, 85, 255)',\n\t\tforegroundDarker: 'rgb(59, 59, 178)',\n\t\tbackground: 'rgb(21, 21, 63)',\n\t\tbackgroundDarker: 'rgb(14, 14, 44)',\n\t\tansi: '\\u001b[0;94m'\n\t},\n\t[FormattingCodes.Green]: {\n\t\tforeground: 'rgb(85, 255, 85)',\n\t\tforegroundDarker: 'rgb(59, 178, 59)',\n\t\tbackground: 'rgb(21, 63, 21)',\n\t\tbackgroundDarker: 'rgb(14, 44, 14)',\n\t\tansi: '\\u001b[0;92m'\n\t},\n\t[FormattingCodes.Aqua]: {\n\t\tforeground: 'rgb(85, 255, 255)',\n\t\tforegroundDarker: 'rgb(59, 178, 178)',\n\t\tbackground: 'rgb(21, 63, 63)',\n\t\tbackgroundDarker: 'rgb(14, 44, 44)',\n\t\tansi: '\\u001b[0;96m'\n\t},\n\t[FormattingCodes.Red]: {\n\t\tforeground: 'rgb(255, 85, 85)',\n\t\tforegroundDarker: 'rgb(178, 59, 59)',\n\t\tbackground: 'rgb(63, 21, 21)',\n\t\tbackgroundDarker: 'rgb(44, 14, 14)',\n\t\tansi: '\\u001b[0;91m'\n\t},\n\t[FormattingCodes.LightPurple]: {\n\t\tforeground: 'rgb(255, 85, 255)',\n\t\tforegroundDarker: 'rgb(178, 59, 178)',\n\t\tbackground: 'rgb(63, 21, 63)',\n\t\tbackgroundDarker: 'rgb(44, 14, 44)',\n\t\tansi: '\\u001b[0;95m'\n\t},\n\t[FormattingCodes.Yellow]: {\n\t\tforeground: 'rgb(255, 255, 85)',\n\t\tforegroundDarker: 'rgb(178, 178, 59)',\n\t\tbackground: 'rgb(63, 63, 21)',\n\t\tbackgroundDarker: 'rgb(44, 44, 14)',\n\t\tansi: '\\u001b[0;93m'\n\t},\n\t[FormattingCodes.White]: {\n\t\tforeground: 'rgb(255, 255, 255)',\n\t\tforegroundDarker: 'rgb(178, 178, 178)',\n\t\tbackground: 'rgb(63, 63, 63)',\n\t\tbackgroundDarker: 'rgb(44, 44, 44)',\n\t\tansi: '\\u001b[0;97m'\n\t},\n\n\t[FormattingCodes.Obfuscated]: { ansi: '\\u001b[8m' },\n\t[FormattingCodes.Bold]: { ansi: '\\u001b[1m' },\n\t[FormattingCodes.Strikethrough]: { ansi: '\\u001b[9m' },\n\t[FormattingCodes.Underline]: { ansi: '\\u001b[4m' },\n\t[FormattingCodes.Italic]: { ansi: '\\u001b[3m' },\n\t[FormattingCodes.Reset]: { ansi: '\\u001b[0m' }\n} as const;" + ], + "outputs": [] + }, + { + "language": "markdown", + "source": [ + "# Thingy 3" + ], + "outputs": [] + }, + { + "language": "typescript", + "source": [ + "type code = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f';\n\n// stolen from NEU\nfunction getPrimaryColourCode(displayname: string): code {\n\tlet lastColourCode = -99;\n\tlet currentColour = 0;\n\tconst mostCommon = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n\tfor (let i = 0; i < displayname.length; i++) {\n\t\tconst c = displayname.charAt(i);\n\t\tif (c === '\\u00A7') {\n\t\t\tlastColourCode = i;\n\t\t} else if (lastColourCode === i - 1) {\n\t\t\tconst colIndex = '0123456789abcdef'.indexOf(c);\n\t\t\tif (colIndex >= 0) {\n\t\t\t\tcurrentColour = colIndex;\n\t\t\t} else {\n\t\t\t\tcurrentColour = 0;\n\t\t\t}\n\t\t} else if ('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.indexOf(c) >= 0) {\n\t\t\tif (currentColour > 0) {\n\t\t\t\tmostCommon[currentColour] = mostCommon[currentColour]++;\n\t\t\t}\n\t\t}\n\t}\n\tlet mostCommonCount = 0;\n\tfor (let index = 0; index < mostCommon.length; index++) {\n\t\tif (mostCommon[index] > mostCommonCount) {\n\t\t\tmostCommonCount = mostCommon[index];\n\t\t\tcurrentColour = index;\n\t\t}\n\t}\n\n\treturn '0123456789abcdef'.charAt(currentColour);\n}\n\nfunction getPrimaryColour(displayname: string) {\n\tconst code = getPrimaryColourCode(displayname);\n\treturn formattingInfo[`§${code}`].foregroundDarker;\n}\n\nfunction stripCodes(str: string) {\n\tfor (const format in formattingInfo) {\n\t\tstr = str.replaceAll(format, '');\n\t}\n\treturn str;\n}\n" + ], + "outputs": [] + }, + { + "language": "markdown", + "source": [ + "# Thingy 4" + ], + "outputs": [] + }, + { + "language": "typescript", + "source": [ + "import tinycolor from 'tinycolor2';\nimport canvas from 'canvas';\nimport path from 'path';\n\ntype McItemId = Lowercase;\ntype SbItemId = Uppercase;\ntype MojangJson = string;\ntype SbRecipeItem = `${SbItemId}:${number}` | '';\ntype SbRecipe = {\n\t[Location in `${'A' | 'B' | 'C'}${1 | 2 | 3}`]: SbRecipeItem;\n};\ntype InfoType = 'WIKI_URL' | '';\ntype Slayer = `${'WOLF' | 'BLAZE' | 'EMAN'}_${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`;\ninterface RawNeuItem {\n\titemid: McItemId;\n\tdisplayname: string;\n\tnbttag: MojangJson;\n\tdamage: number;\n\tlore: string[];\n\trecipe?: SbRecipe;\n\tinternalname: SbItemId;\n\tmodver: string;\n\tinfoType: InfoType;\n\tinfo?: string[];\n\tcrafttext: string;\n\tvanilla?: boolean;\n\tuseneucraft?: boolean;\n\tslayer_req?: Slayer;\n\tclickcommand?: string;\n\tx?: number;\n\ty?: number;\n\tz?: number;\n\tisland?: string;\n\trecipes?: { type: string; cost: any[]; result: SbItemId }[];\n\t/** @deprecated */\n\tparent?: SbItemId;\n\tnoseal?: boolean;\n}\n\nfunction tooltip(item: RawNeuItem) {\n\tconst background = '#100010';\n\n\tconst width = 1000;\n\tconst height = 250;\n\tconst scale = 10;\n\n\tcanvas.registerFont(path.join(__dirname, 'assets', 'Faithful.ttf'), { family: 'Compliance Sans' });\n\tcanvas.registerFont(path.join(__dirname, 'assets', 'Roboto-Regular.ttf'), { family: 'Roboto' });\n\n\tconst itemRender = canvas.createCanvas(width, height),\n\t\tctx = itemRender.getContext('2d');\n\n\tctx.globalAlpha = 0.94;\n\tctx.fillStyle = background;\n\n\t// top outside\n\tctx.fillRect(scale, 0, width - 2 * scale, scale);\n\n\t// bottom outside\n\tctx.fillRect(scale, height - scale, width - 2 * scale, scale);\n\n\t// left outside\n\tctx.fillRect(0, scale, scale, height - 2 * scale);\n\n\t// right outside\n\tctx.fillRect(width - scale, scale, scale, height - 2 * scale);\n\n\t// middle\n\tctx.fillRect(2 * scale, 2 * scale, width - 4 * scale, height - 4 * scale);\n\n\tctx.globalAlpha = 0.78;\n\n\tconst borderColorStart = parseInt(new tinycolor(getPrimaryColour(item.displayname)).toHex(), 16);\n\tconst borderColorEnd = ((borderColorStart & 0xfefefe) >> 1) | (borderColorStart & 0xff000000);\n\n\tconst borderColorStartStr = `#${borderColorStart.toString(16)}`;\n\tconst borderColorEndStr = `#${borderColorEnd.toString(16)}`;\n\n\tctx.fillStyle = borderColorStartStr;\n\n\t// top highlight\n\tctx.fillRect(scale, scale, width - 2 * scale, scale);\n\n\t// left highlight\n\tctx.fillRect(scale, 2 * scale, scale, height - 3 * scale);\n\n\t// bottom highlight\n\t{\n\t\tconst x = 2 * scale,\n\t\t\ty = height - 2 * scale,\n\t\t\tw = width - 3 * scale,\n\t\t\th = scale;\n\t\tconst gradient = ctx.createLinearGradient(x, y, x + w, y + h);\n\t\tgradient.addColorStop(0, borderColorStartStr);\n\t\tgradient.addColorStop(1, borderColorEndStr);\n\t\tctx.fillStyle = gradient;\n\n\t\tctx.fillRect(x, y, w, h);\n\t}\n\n\t// right highlight\n\t{\n\t\tconst x = width - 2 * scale,\n\t\t\ty = 2 * scale,\n\t\t\tw = scale,\n\t\t\th = height - 4 * scale;\n\t\tconst gradient = ctx.createLinearGradient(x, y, x + w, y + h);\n\t\tgradient.addColorStop(0, borderColorStartStr);\n\t\tgradient.addColorStop(1, borderColorEndStr);\n\t\tctx.fillStyle = gradient;\n\n\t\tctx.fillRect(x, y, w, h);\n\t}\n\n\tctx.font = `48px Roboto`;\n\tctx.fillText(stripCodes(item.displayname), scale * 4, scale * 7);\n\n\tconst buf = itemRender.toBuffer();\n\treturn buf;\n}\n" + ], + "outputs": [] + }, + { + "language": "typescript", + "source": [ + "import fs from 'fs/promises';\nimport path from 'path';\n\nconst repo = path.join(__dirname, 'neu-item-repo-dangerous');\nconst itemPath = path.join(repo, 'items');\nconst items = await fs.readdir(itemPath);\n\nconst randomItem = items[Math.floor(Math.random() * items.length)];\nconst item = (await import(path.join(itemPath, randomItem), { assert: { type: 'json' } })).default as RawNeuItem;\n\nconsole.log(stripCodes(item.displayname));\ntooltip(item);\n" + ], + "outputs": [ + { + "items": [ + { + "mime": "application/vnd.code.notebook.stdout", + "value": [ + "Enderman Minion IV", + "" + ] + } + ] + }, + { + "items": [ + { + "mime": "image/png", + "value": "data:image/png;base64,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" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 0000000..59f6ecc --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "include": [ + "src/**/*.ts", + "src/**/*d.ts", + "lib/**/*.ts", + "ecosystem.config.cjs", + ".eslintrc.cjs", + "config/**/*.ts", + "tests/**/*.ts", + "vite.config.ts", + "tooltips*", + "test*" + ] +} diff --git a/tsconfig.json b/tsconfig.json index 565346b..6d24566 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,17 +27,6 @@ "#tags": ["./src/lib/common/tags.js"] } }, - "include": [ - "src/**/*.ts", - "src/**/*d.ts", - "lib/**/*.ts", - "ecosystem.config.cjs", - ".eslintrc.cjs", - "config/**/*.ts", - "tests/**/*.ts", - "vite.config.ts", - "src/bot.ts", - "src/lib/common/util/Minecraft.ts" - ], + "include": ["src/**/*.ts", "src/**/*d.ts", "lib/**/*.ts", "test.js"], "exclude": ["dist", "node_modules"] } -- cgit From 7824c911806e368f6a1bea7f6b55d1f470b755d1 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 20:14:49 -0400 Subject: hide incomplete commands --- src/commands/moulberry-bush/neuRepo.ts | 5 +++-- src/commands/tickets/ticket-!.ts | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/commands/moulberry-bush/neuRepo.ts b/src/commands/moulberry-bush/neuRepo.ts index 9d76810..d07ba53 100644 --- a/src/commands/moulberry-bush/neuRepo.ts +++ b/src/commands/moulberry-bush/neuRepo.ts @@ -43,10 +43,11 @@ export default class NeuRepoCommand extends BushCommand { slashType: ApplicationCommandOptionType.Boolean } */ ], - slash: true, + slash: false, clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true), userPermissions: [], - ownerOnly: true + ownerOnly: true, + hidden: true }); } diff --git a/src/commands/tickets/ticket-!.ts b/src/commands/tickets/ticket-!.ts index 7751df1..6ec4093 100644 --- a/src/commands/tickets/ticket-!.ts +++ b/src/commands/tickets/ticket-!.ts @@ -29,10 +29,12 @@ export default class TicketCommand extends BushCommand { slashOptions: Object.entries(ticketSubcommands).map( ([subcommand, options]) => ({ name: subcommand, ...options } as SlashOption) ), - slash: true, + slash: false, channel: 'guild', clientPermissions: (m) => clientSendAndPermCheck(m), - userPermissions: [] + userPermissions: [], + ownerOnly: true, + hidden: true }); } -- cgit From 7894d181d4863e3031c3f7721c345077cc5bc613 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 22:56:44 -0400 Subject: add more mappings --- src/arguments/abbreviatedNumber.ts | 2 +- src/arguments/tinyColor.ts | 2 +- src/commands/info/userInfo.ts | 6 +++--- src/commands/moulberry-bush/giveawayPing.ts | 6 +++--- src/commands/moulberry-bush/moulHammer.ts | 14 +++++++++++--- src/commands/moulberry-bush/report.ts | 4 +++- src/commands/moulberry-bush/rule.ts | 5 +++-- src/lib/utils/BushConstants.ts | 21 ++++++++++++++++----- src/listeners/bush/appealListener.ts | 2 +- src/listeners/bush/joinAutoBan.ts | 2 +- src/listeners/bush/supportThread.ts | 6 +++--- src/listeners/bush/userUpdateAutoBan.ts | 2 +- src/listeners/message/quoteCreate.ts | 4 ++-- 13 files changed, 49 insertions(+), 27 deletions(-) diff --git a/src/arguments/abbreviatedNumber.ts b/src/arguments/abbreviatedNumber.ts index eba9214..a7d8ce5 100644 --- a/src/arguments/abbreviatedNumber.ts +++ b/src/arguments/abbreviatedNumber.ts @@ -1,5 +1,5 @@ import type { BushArgumentTypeCaster } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import numeral from 'numeral'; assert(typeof numeral === 'function'); diff --git a/src/arguments/tinyColor.ts b/src/arguments/tinyColor.ts index 8d01928..148c078 100644 --- a/src/arguments/tinyColor.ts +++ b/src/arguments/tinyColor.ts @@ -1,5 +1,5 @@ import type { BushArgumentTypeCaster } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import tinycolorModule from 'tinycolor2'; assert(tinycolorModule); diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index 3479ea3..7b67816 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -162,11 +162,11 @@ export default class UserInfoCommand extends BushCommand { ); if (member.premiumSince) serverUserInfo.push(`**Booster Since:** ${timestampAndDelta(member.premiumSince, 'd')}`); if (member.displayHexColor) serverUserInfo.push(`**Display Color:** ${member.displayHexColor}`); - if (member.user.id == '322862723090219008' && member.guild?.id == mappings.guilds.bush) + if (member.user.id == mappings.users['IRONM00N'] && member.guild?.id == mappings.guilds["Moulberry's Bush"]) serverUserInfo.push(`**General Deletions:** 1⅓`); if ( - (['384620942577369088', '496409778822709251'] as const).includes(member.user.id) && - member.guild.id == mappings.guilds.bush + ([mappings.users['nopo'], mappings.users['Bestower']] as const).includes(member.user.id) && + member.guild.id == mappings.guilds["Moulberry's Bush"] ) serverUserInfo.push(`**General Deletions:** ⅓`); if (member?.nickname) serverUserInfo.push(`**Nickname:** ${escapeMarkdown(member?.nickname)}`); diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts index d93e0c9..6803c0c 100644 --- a/src/commands/moulberry-bush/giveawayPing.ts +++ b/src/commands/moulberry-bush/giveawayPing.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, clientSendAndPermCheck, emojis, type CommandMessage } from '#lib'; +import { AllowedMentions, BushCommand, clientSendAndPermCheck, emojis, mappings, type CommandMessage } from '#lib'; import assert from 'assert'; import { PermissionFlagsBits } from 'discord.js'; @@ -24,8 +24,8 @@ export default class GiveawayPingCommand extends BushCommand { cooldown: 1.44e7, //4 hours ratelimit: 1, editable: false, - restrictedGuilds: ['516977525906341928'], - restrictedChannels: ['767782084981817344', '833855738501267456'] + restrictedGuilds: [mappings.guilds["Moulberry's Bush"]], + restrictedChannels: [mappings.channels['giveaways']] }); } diff --git a/src/commands/moulberry-bush/moulHammer.ts b/src/commands/moulberry-bush/moulHammer.ts index 0eeb769..277f051 100644 --- a/src/commands/moulberry-bush/moulHammer.ts +++ b/src/commands/moulberry-bush/moulHammer.ts @@ -1,4 +1,12 @@ -import { BushCommand, clientSendAndPermCheck, colors, type ArgType, type CommandMessage, type SlashMessage } from '#lib'; +import { + BushCommand, + clientSendAndPermCheck, + colors, + mappings, + type ArgType, + type CommandMessage, + type SlashMessage +} from '#lib'; import assert from 'assert'; import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js'; @@ -22,8 +30,8 @@ export default class MoulHammerCommand extends BushCommand { ], slash: true, channel: 'guild', - slashGuilds: ['516977525906341928'], - restrictedGuilds: ['516977525906341928'], + slashGuilds: [mappings.guilds["Moulberry's Bush"]], + restrictedGuilds: [mappings.guilds["Moulberry's Bush"]], clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true), userPermissions: [] }); diff --git a/src/commands/moulberry-bush/report.ts b/src/commands/moulberry-bush/report.ts index 13ef2b6..6d1203c 100644 --- a/src/commands/moulberry-bush/report.ts +++ b/src/commands/moulberry-bush/report.ts @@ -4,6 +4,7 @@ import { clientSendAndPermCheck, colors, emojis, + mappings, timestampAndDelta, type ArgType, type CommandMessage @@ -54,11 +55,12 @@ export default class ReportCommand extends BushCommand { return await message.util.reply(`${emojis.error} This command can only be used in servers where reporting is enabled.`); if (!member) return await message.util.reply(`${emojis.error} Choose someone to report`); - if (member.user.id === '322862723090219008') + if (member.user.id === mappings.users['IRONM00N']) return await message.util.reply({ content: `Thank you for your report! We take these allegations very seriously and have reported <@${member.user.id}> to the FBI!`, allowedMentions: AllowedMentions.none() }); + if (member.user.bot) return await message.util.reply(`${emojis.error} You cannot report a bot <:WeirdChamp:756283321301860382>.`); diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts index d58b78e..25a3ef0 100644 --- a/src/commands/moulberry-bush/rule.ts +++ b/src/commands/moulberry-bush/rule.ts @@ -3,6 +3,7 @@ import { Arg, BushCommand, clientSendAndPermCheck, + mappings, type CommandMessage, type OptArgType, type SlashMessage @@ -98,11 +99,11 @@ export default class RuleCommand extends BushCommand { } ], slash: true, - slashGuilds: ['516977525906341928'], + slashGuilds: [mappings.guilds["Moulberry's Bush"]], channel: 'guild', clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true), userPermissions: [], - restrictedGuilds: ['516977525906341928'] + restrictedGuilds: [mappings.guilds["Moulberry's Bush"]] }); } diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts index 67723e3..8a7bf03 100644 --- a/src/lib/utils/BushConstants.ts +++ b/src/lib/utils/BushConstants.ts @@ -200,11 +200,22 @@ export const pronounMapping = Object.freeze({ */ export const mappings = deepLock({ guilds: { - bush: '516977525906341928', - tree: '767448775450820639', - staff: '784597260465995796', - space_ship: '717176538717749358', - sbr: '839287012409999391' + "Moulberry's Bush": '516977525906341928', + "Moulberry's Tree": '767448775450820639', + 'MB Staff': '784597260465995796', + "IRONM00N's Space Ship": '717176538717749358' + }, + + channels: { + 'neu-support': '714332750156660756', + 'giveaways': '767782084981817344' + }, + + users: { + IRONM00N: '322862723090219008', + Moulberry: '211288288055525376', + nopo: '384620942577369088', + Bestower: '496409778822709251' }, permissions: { diff --git a/src/listeners/bush/appealListener.ts b/src/listeners/bush/appealListener.ts index 424ee48..bbcb9d8 100644 --- a/src/listeners/bush/appealListener.ts +++ b/src/listeners/bush/appealListener.ts @@ -14,7 +14,7 @@ export default class AppealListener extends BushListener { } public async exec(...[message]: BushClientEvents['messageCreate']): Promise { - if (!this.client.config.isProduction || !message.inGuild() || message.guildId !== mappings.guilds.bush) return; + if (!this.client.config.isProduction || !message.inGuild() || message.guildId !== mappings.guilds["Moulberry's Bush"]) return; if (message.author.id !== '855446927688335370' || message.embeds.length < 1) return; const userId = message.embeds[0].fields?.find?.((f) => f.name === 'What is your discord ID?')?.value; diff --git a/src/listeners/bush/joinAutoBan.ts b/src/listeners/bush/joinAutoBan.ts index 082a925..4370e86 100644 --- a/src/listeners/bush/joinAutoBan.ts +++ b/src/listeners/bush/joinAutoBan.ts @@ -12,7 +12,7 @@ export default class JoinAutoBanListener extends BushListener { public async exec(...[member]: BushClientEvents['guildMemberAdd']): Promise { if (!this.client.config.isProduction) return; - if (member.guild.id !== mappings.guilds.bush) return; + if (member.guild.id !== mappings.guilds["Moulberry's Bush"]) return; const guild = member.guild; // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/src/listeners/bush/supportThread.ts b/src/listeners/bush/supportThread.ts index 1dadecb..32eae02 100644 --- a/src/listeners/bush/supportThread.ts +++ b/src/listeners/bush/supportThread.ts @@ -1,4 +1,4 @@ -import { BushListener, colors, type BushClientEvents } from '#lib'; +import { BushListener, colors, mappings, type BushClientEvents } from '#lib'; import { stripIndent } from '#tags'; import assert from 'assert'; import { EmbedBuilder, MessageType, PermissionFlagsBits, TextChannel } from 'discord.js'; @@ -19,8 +19,8 @@ export default class SupportThreadListener extends BushListener { if (message.author.bot && (message.author.id !== '444871677176709141' || !message.content.includes('uploaded a log,'))) return; - if (message.guild.id !== '516977525906341928') return; // mb - if (message.channel.id !== '714332750156660756') return; // neu-support + if (message.guild.id !== mappings.guilds["Moulberry's Bush"]) return; // mb + if (message.channel.id !== mappings.channels['neu-support']) return; if ( [await message.guild.getSetting('prefix'), `<@!${this.client.user!.id}>`, `<@${this.client.user!.id}>`].some((v) => diff --git a/src/listeners/bush/userUpdateAutoBan.ts b/src/listeners/bush/userUpdateAutoBan.ts index 54051b2..adfb80c 100644 --- a/src/listeners/bush/userUpdateAutoBan.ts +++ b/src/listeners/bush/userUpdateAutoBan.ts @@ -19,7 +19,7 @@ export default class UserUpdateAutoBanListener extends BushListener { if (!code) return; if (eval(code)) { const member = await this.client.guilds.cache - .get(mappings.guilds.bush) + .get(mappings.guilds["Moulberry's Bush"]) ?.members.fetch(newUser.id) .catch(() => undefined); if (!member || !(member instanceof GuildMember)) return; diff --git a/src/listeners/message/quoteCreate.ts b/src/listeners/message/quoteCreate.ts index 0478bcf..166bbb7 100644 --- a/src/listeners/message/quoteCreate.ts +++ b/src/listeners/message/quoteCreate.ts @@ -1,4 +1,4 @@ -import { BushListener, type BushClientEvents } from '#lib'; +import { BushListener, mappings, type BushClientEvents } from '#lib'; export default class QuoteCreateListener extends BushListener { public constructor() { @@ -10,7 +10,7 @@ export default class QuoteCreateListener extends BushListener { } public async exec(...[message]: BushClientEvents['messageCreate']) { - if (message.author.id !== '322862723090219008' || !this.client.config.isProduction) return; + if (message.author.id !== mappings.users['IRONM00N'] || !this.client.config.isProduction) return; if (!message.inGuild()) return; const messages = await this.client.utils.resolveMessagesFromLinks(message.content); -- cgit From 2bb1b04aa883c0e55e27668af44bb5edd5bf08a7 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 22:57:11 -0400 Subject: upgrade deps --- package.json | 36 ++-- yarn.lock | 585 ++++++++++++++++++++++++++++++++++------------------------- 2 files changed, 351 insertions(+), 270 deletions(-) diff --git a/package.json b/package.json index faa2706..06cf329 100644 --- a/package.json +++ b/package.json @@ -58,29 +58,29 @@ } }, "dependencies": { - "@discordjs/builders": "^1.0.0", - "@discordjs/rest": "^1.0.0", + "@discordjs/builders": "^1.1.0", + "@discordjs/rest": "^1.0.1", "@ironm00n/nbt-ts": "^1.4.0", "@notenoughupdates/discord.js-minesweeper": "^1.0.10", "@notenoughupdates/events-intercept": "^3.0.1", "@notenoughupdates/humanize-duration": "^4.0.1", "@notenoughupdates/simplify-number": "^1.0.1", "@notenoughupdates/wolfram-alpha-api": "^1.0.2", - "@sentry/integrations": "^7.7.0", - "@sentry/node": "^7.7.0", - "@sentry/tracing": "^7.7.0", + "@sentry/integrations": "^7.9.0", + "@sentry/node": "^7.9.0", + "@sentry/tracing": "^7.9.0", "canvas": "^2.9.3", "chalk": "^5.0.1", "deep-lock": "^1.0.0", "discord-akairo": "npm:@notenoughupdates/discord-akairo@dev", - "discord-api-types": "0.36.2", + "discord-api-types": "0.37.1", "discord.js": "npm:@notenoughupdates/discord.js@dev", "fuse.js": "^6.6.2", "gif-to-apng": "^0.1.2", "googleapis": "^105.0.0", - "got": "^12.1.0", + "got": "^12.3.0", "lodash": "^4.17.21", - "mathjs": "^10.6.4", + "mathjs": "^11.0.1", "nanoid": "^4.0.0", "numeral": "^2.0.6", "pg": "^8.7.3", @@ -95,27 +95,27 @@ }, "devDependencies": { "@sapphire/snowflake": "^3.2.2", - "@sentry/types": "^7.7.0", + "@sentry/types": "^7.9.0", "@types/eslint": "^8.4.5", "@types/express": "^4.17.13", "@types/lodash": "^4.14.182", - "@types/node": "^18.0.6", + "@types/node": "^18.6.4", "@types/numeral": "^2.0.2", "@types/pg": "^8.6.5", - "@types/prettier": "^2.6.3", + "@types/prettier": "^2.7.0", "@types/rimraf": "^3.0.2", "@types/tinycolor2": "^1.4.3", - "@types/validator": "^13.7.4", - "@typescript-eslint/eslint-plugin": "^5.30.7", - "@typescript-eslint/parser": "^5.30.7", - "electron": "latest", - "eslint": "^8.20.0", + "@types/validator": "^13.7.5", + "@typescript-eslint/eslint-plugin": "^5.32.0", + "@typescript-eslint/parser": "^5.32.0", + "electron": "^20.0.1", + "eslint": "^8.21.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-deprecation": "^1.3.2", "eslint-plugin-import": "^2.26.0", - "node-fetch": "^3.2.9", + "node-fetch": "^3.2.10", "ts-essentials": "^9.2.0", - "vitest": "^0.18.1" + "vitest": "^0.21.0" }, "packageManager": "yarn@3.2.1" } diff --git a/yarn.lock b/yarn.lock index 0e266d3..f7972f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,12 +5,12 @@ __metadata: version: 6 cacheKey: 8 -"@babel/runtime@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/runtime@npm:7.18.6" +"@babel/runtime@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/runtime@npm:7.18.9" dependencies: regenerator-runtime: ^0.13.4 - checksum: 8b707b64ae0524db617d0c49933b258b96376a38307dc0be8fb42db5697608bcc1eba459acce541e376cff5ed5c5287d24db5780bd776b7c75ba2c2e26ff8a2c + checksum: 36dd736baba7164e82b3cc9d43e081f0cb2d05ff867ad39cac515d99546cee75b7f782018b02a3dcf5f2ef3d27f319faa68965fdfec49d4912c60c6002353a2e languageName: node linkType: hard @@ -28,16 +28,16 @@ __metadata: languageName: node linkType: hard -"@discordjs/builders@npm:^1.0.0": - version: 1.0.0 - resolution: "@discordjs/builders@npm:1.0.0" +"@discordjs/builders@npm:^1.1.0": + version: 1.1.0 + resolution: "@discordjs/builders@npm:1.1.0" dependencies: "@sapphire/shapeshift": ^3.5.1 - discord-api-types: ^0.36.2 + discord-api-types: ^0.36.3 fast-deep-equal: ^3.1.3 ts-mixer: ^6.0.1 tslib: ^2.4.0 - checksum: eeb627c772a2bd1fea1bddd58d46d391c30d0e2411cc3976386b7efc2048724e6bfd204ba848724ebd6d04791b358637c3a9eee878f924ef525c4920bfbfa2de + checksum: 95a30b151447bfb625f3f325dc06476a58a050930b07cd0e9d6f66f62cee49e3d68cea137b436bf64559d47add7900574b732ba15e707cdda68a320020988c49 languageName: node linkType: hard @@ -48,10 +48,10 @@ __metadata: languageName: node linkType: hard -"@discordjs/collection@npm:^1.0.0": - version: 1.0.0 - resolution: "@discordjs/collection@npm:1.0.0" - checksum: d8eafd35e782a6a2ee83a22c31679958bc827fce8cd5ffc7e5942cf681c96fd9543334b48c743ecda45179fcefa8d7be7a13f771d7f14effaec8a8ca25077031 +"@discordjs/collection@npm:^1.0.1": + version: 1.0.1 + resolution: "@discordjs/collection@npm:1.0.1" + checksum: 6477ae9870f3c069b190f673a6b34467930b409a6d763f1b0d4f6169051b8499d03de7b0e7e4c3697222845aea6d94283573ad6a488b50516764df675915ff44 languageName: node linkType: hard @@ -69,18 +69,18 @@ __metadata: languageName: node linkType: hard -"@discordjs/rest@npm:^1.0.0": - version: 1.0.0 - resolution: "@discordjs/rest@npm:1.0.0" +"@discordjs/rest@npm:^1.0.1": + version: 1.0.1 + resolution: "@discordjs/rest@npm:1.0.1" dependencies: - "@discordjs/collection": ^1.0.0 + "@discordjs/collection": ^1.0.1 "@sapphire/async-queue": ^1.3.2 "@sapphire/snowflake": ^3.2.2 - discord-api-types: ^0.36.2 - file-type: ^17.1.2 + discord-api-types: ^0.36.3 + file-type: ^17.1.4 tslib: ^2.4.0 - undici: ^5.7.0 - checksum: dfe4348ce3d9cd7e91b1ee090b4b7c9eaf9f0b5a2acb4e2a1e71cb9a08afa260393190db5461e5873663d7d3bd29fbeda1ebec1bd74dcce87577371cf887cbbe + undici: ^5.8.0 + checksum: d83b57de5b71eae15ecabc5da0767d70be9cd4667c872b2fdfd933670a6f162f9815208fe5a6dd018d38d8d25dea6dde62a7285e08b03b66c1896308605c2850 languageName: node linkType: hard @@ -130,14 +130,21 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.9.2": - version: 0.9.5 - resolution: "@humanwhocodes/config-array@npm:0.9.5" +"@humanwhocodes/config-array@npm:^0.10.4": + version: 0.10.4 + resolution: "@humanwhocodes/config-array@npm:0.10.4" dependencies: "@humanwhocodes/object-schema": ^1.2.1 debug: ^4.1.1 minimatch: ^3.0.4 - checksum: 8ba6281bc0590f6c6eadeefc14244b5a3e3f5903445aadd1a32099ed80e753037674026ce1b3c945ab93561bea5eb29e3c5bff67060e230c295595ba517a3492 + checksum: d480e5d57e6d787565b6cff78e27c3d1b380692d4ffb0ada7d7f5957a56c9032f034da05a3e443065dbd0671ebf4d859036ced34e96b325bbc1badbae3c05300 + languageName: node + linkType: hard + +"@humanwhocodes/gitignore-to-minimatch@npm:^1.0.2": + version: 1.0.2 + resolution: "@humanwhocodes/gitignore-to-minimatch@npm:1.0.2" + checksum: aba5c40c9e3770ed73a558b0bfb53323842abfc2ce58c91d7e8b1073995598e6374456d38767be24ab6176915f0a8d8b23eaae5c85e2b488c0dccca6d795e2ad languageName: node linkType: hard @@ -294,83 +301,83 @@ __metadata: languageName: node linkType: hard -"@sentry/core@npm:7.7.0": - version: 7.7.0 - resolution: "@sentry/core@npm:7.7.0" +"@sentry/core@npm:7.9.0": + version: 7.9.0 + resolution: "@sentry/core@npm:7.9.0" dependencies: - "@sentry/hub": 7.7.0 - "@sentry/types": 7.7.0 - "@sentry/utils": 7.7.0 + "@sentry/hub": 7.9.0 + "@sentry/types": 7.9.0 + "@sentry/utils": 7.9.0 tslib: ^1.9.3 - checksum: d3b9b5a92a9182bae7f39eef01502dd542d5be7365632ea9e26aa5247c90fd72e620856b20a393f4d3eeadb27f3b744bf25be93b1fdc4f7457a894e290c41fb0 + checksum: 427d66d53e2af6797c1fbb0f186db596802d8e498bae32a56be89caa2f0a91cd73aa5689943ddd4cd1c9e4afc0259cdecf496733fa220ee3c0c3bfe21e676d08 languageName: node linkType: hard -"@sentry/hub@npm:7.7.0": - version: 7.7.0 - resolution: "@sentry/hub@npm:7.7.0" +"@sentry/hub@npm:7.9.0": + version: 7.9.0 + resolution: "@sentry/hub@npm:7.9.0" dependencies: - "@sentry/types": 7.7.0 - "@sentry/utils": 7.7.0 + "@sentry/types": 7.9.0 + "@sentry/utils": 7.9.0 tslib: ^1.9.3 - checksum: 0683ae6da7d961e6bbb90ad1fded3b33cd9fc76dc54a080902a83bd7769991294ce8017277f5e0d145fcf9f2ad53ae89d3b0c7619fa0586c8513f4b585f14f6d + checksum: 594558fc360a5765389891f807119d2906da1c60b101862b9b13afdc0954b948495fb885471f6bfbf3c7e9bceeedb0111b84833ac1c7c974be7bf5e8b2dcfb8b languageName: node linkType: hard -"@sentry/integrations@npm:^7.7.0": - version: 7.7.0 - resolution: "@sentry/integrations@npm:7.7.0" +"@sentry/integrations@npm:^7.9.0": + version: 7.9.0 + resolution: "@sentry/integrations@npm:7.9.0" dependencies: - "@sentry/types": 7.7.0 - "@sentry/utils": 7.7.0 + "@sentry/types": 7.9.0 + "@sentry/utils": 7.9.0 localforage: ^1.8.1 tslib: ^1.9.3 - checksum: cd24f34301c55069e8487adc6d9b3c61e9f4f7284a01d4e9954324695f15b74806303cf53bd2e88db325289c057d2b33546986ed240b022f6d170cada94a0cab + checksum: 3a7c88e7c4939a3057780acfd3803673a3e6017fa386467e67379d3c2d26f6eee5b2d74d60563c4102c143d74393b78c1f0f5e0e166fc010b0a7717c6211d916 languageName: node linkType: hard -"@sentry/node@npm:^7.7.0": - version: 7.7.0 - resolution: "@sentry/node@npm:7.7.0" +"@sentry/node@npm:^7.9.0": + version: 7.9.0 + resolution: "@sentry/node@npm:7.9.0" dependencies: - "@sentry/core": 7.7.0 - "@sentry/hub": 7.7.0 - "@sentry/types": 7.7.0 - "@sentry/utils": 7.7.0 + "@sentry/core": 7.9.0 + "@sentry/hub": 7.9.0 + "@sentry/types": 7.9.0 + "@sentry/utils": 7.9.0 cookie: ^0.4.1 https-proxy-agent: ^5.0.0 lru_map: ^0.3.3 tslib: ^1.9.3 - checksum: 554f4165f7cee16c70eca1e4e42d354330bcfcbf157bfbcdf4a17e89393f0c39f042cfaa07ba51ebb8391bbf2091d8dc6108a81650a60d39632d3b6a1edafe6f + checksum: b8baa65a00b0c42f3b5d6eeb0c98812155081b9963482d9bd6b2de62bc8a81db86f5dbb3c17cc1177cf76fe6ac10397ff881e758245aab13904e333d8230250b languageName: node linkType: hard -"@sentry/tracing@npm:^7.7.0": - version: 7.7.0 - resolution: "@sentry/tracing@npm:7.7.0" +"@sentry/tracing@npm:^7.9.0": + version: 7.9.0 + resolution: "@sentry/tracing@npm:7.9.0" dependencies: - "@sentry/hub": 7.7.0 - "@sentry/types": 7.7.0 - "@sentry/utils": 7.7.0 + "@sentry/hub": 7.9.0 + "@sentry/types": 7.9.0 + "@sentry/utils": 7.9.0 tslib: ^1.9.3 - checksum: c3884c297e87284ab73f103338dfb2f8dc2d2fcf641981650ad72009f1d7a41292ded048a7283b57a66f730d8d7cb8932bb6ee64e8b512b33de08da8867a58fe + checksum: e8e8cfecbb4647aeea849225c7c898bde1c9029b0bdf75984109a19668fcd99a62abe93d4115b5dccd484f0f7e0b378a0715f830bcf5a2788e23e69c8199145d languageName: node linkType: hard -"@sentry/types@npm:7.7.0, @sentry/types@npm:^7.7.0": - version: 7.7.0 - resolution: "@sentry/types@npm:7.7.0" - checksum: 1f26c23617e9370cf32269ea5d5aa0f75fe86c34aede4fc07ae3bdae08803a788d628d0bba6f2e22c03d0430dcf63cc19453468ae086406448da07e13f36da70 +"@sentry/types@npm:7.9.0, @sentry/types@npm:^7.9.0": + version: 7.9.0 + resolution: "@sentry/types@npm:7.9.0" + checksum: 5f56d27454cab0344554bd85e9db8c34827dffa61145150664dc1ff478aaf599bffceb3a6bb20f592f0d8080b1f26b7af03c306a09c6463b8de4bdfdd10eecba languageName: node linkType: hard -"@sentry/utils@npm:7.7.0": - version: 7.7.0 - resolution: "@sentry/utils@npm:7.7.0" +"@sentry/utils@npm:7.9.0": + version: 7.9.0 + resolution: "@sentry/utils@npm:7.9.0" dependencies: - "@sentry/types": 7.7.0 + "@sentry/types": 7.9.0 tslib: ^1.9.3 - checksum: 990224e0542015952a4f1fa83dd69c82a3a85894576457f10bc3c0c60620c675969424bdbfde9872a19a5db2b682dd1d51c67ec99f0c57acfc993e6f7c970aaf + checksum: 414a81ae8005d12ba22578606dff57b906598fc8b761cb3b4143a87fe20226bc90f9018a8930df11625a69cf5706d6f834191ef01d3ee8362ca6078e59108d9c languageName: node linkType: hard @@ -388,6 +395,13 @@ __metadata: languageName: node linkType: hard +"@sindresorhus/is@npm:^5.2.0": + version: 5.3.0 + resolution: "@sindresorhus/is@npm:5.3.0" + checksum: b31cebabcdece3d5322de2a4dbc8c0f004e04147a00f2606787bcaf5655ad4b1954f6727fc6914c524009b2b9a2cc01c42835b55f651ce69fd2a0083b60bb852 + languageName: node + linkType: hard + "@szmarczak/http-timer@npm:^1.1.2": version: 1.1.2 resolution: "@szmarczak/http-timer@npm:1.1.2" @@ -605,10 +619,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^18.0.6": - version: 18.0.6 - resolution: "@types/node@npm:18.0.6" - checksum: 780f8885a6b6eb12f4c0246617747fdc37a451931b3c01ce8148d356c0903b705dcb16cc6a914de63d48b0dc1b002c7a3dfae681f580e1761aa551d3cd996813 +"@types/node@npm:^18.6.4": + version: 18.6.4 + resolution: "@types/node@npm:18.6.4" + checksum: fc453dd2b541f5812ba1a8f957f577727cf2d8aee886f1d5c03eb153b2b3373d2e0953c5bd2b7a5b184073bc317f54ec91f1ec4830a58eda4a833e90654021de languageName: node linkType: hard @@ -630,10 +644,10 @@ __metadata: languageName: node linkType: hard -"@types/prettier@npm:^2.6.3": - version: 2.6.3 - resolution: "@types/prettier@npm:2.6.3" - checksum: e1836699ca189fff6d2a73dc22e028b6a6f693ed1180d5998ac29fa197caf8f85aa92cb38db642e4a370e616b451cb5722ad2395dab11c78e025a1455f37d1f0 +"@types/prettier@npm:^2.7.0": + version: 2.7.0 + resolution: "@types/prettier@npm:2.7.0" + checksum: bf5d0c7c1270909b39399539ac106d20ddaa85fe92eb1d59922dc99159604b4f8d5e41b0045fb29c8011585cf5bca2350b7441ef3d9816c08bd0e10ebd4b31d4 languageName: node linkType: hard @@ -694,10 +708,10 @@ __metadata: languageName: node linkType: hard -"@types/validator@npm:^13.7.4": - version: 13.7.4 - resolution: "@types/validator@npm:13.7.4" - checksum: 718e72d86c897861bc7f35e7918e0305d4efa5891ffdce6a8b77dbdc6fd10a70c2c6851f716a7f75ab2b0c12b5534f74e6d6b1040ac6eb8ab40d918c022283e5 +"@types/validator@npm:^13.7.5": + version: 13.7.5 + resolution: "@types/validator@npm:13.7.5" + checksum: cc143351a23aef713b5d6b6794314b6b8b8332511cf44070c3358559b43267217b01c85eab0965c6104ffea362124a949187f348c67ff94ab0ee9966af6d3728 languageName: node linkType: hard @@ -710,13 +724,22 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.30.7": - version: 5.30.7 - resolution: "@typescript-eslint/eslint-plugin@npm:5.30.7" +"@types/yauzl@npm:^2.9.1": + version: 2.10.0 + resolution: "@types/yauzl@npm:2.10.0" + dependencies: + "@types/node": "*" + checksum: 55d27ae5d346ea260e40121675c24e112ef0247649073848e5d4e03182713ae4ec8142b98f61a1c6cbe7d3b72fa99bbadb65d8b01873e5e605cdc30f1ff70ef2 + languageName: node + linkType: hard + +"@typescript-eslint/eslint-plugin@npm:^5.32.0": + version: 5.32.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.32.0" dependencies: - "@typescript-eslint/scope-manager": 5.30.7 - "@typescript-eslint/type-utils": 5.30.7 - "@typescript-eslint/utils": 5.30.7 + "@typescript-eslint/scope-manager": 5.32.0 + "@typescript-eslint/type-utils": 5.32.0 + "@typescript-eslint/utils": 5.32.0 debug: ^4.3.4 functional-red-black-tree: ^1.0.1 ignore: ^5.2.0 @@ -729,7 +752,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: d42af514f5817732646b5601030699687b4ef619ba7983754a4173bf908f6c6030324038e3733b88342ec6ace07af61aa946d677da6a6266931275bd2afc9fc2 + checksum: 9785c34d9742b51130237bfe244924ca6dfd529bdcc5932a5cf81558f0235099c963a11125df393037db51ce451f7ab9442aba3c3a8bb2e0607569a0e31480c8 languageName: node linkType: hard @@ -744,20 +767,20 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.30.7": - version: 5.30.7 - resolution: "@typescript-eslint/parser@npm:5.30.7" +"@typescript-eslint/parser@npm:^5.32.0": + version: 5.32.0 + resolution: "@typescript-eslint/parser@npm:5.32.0" dependencies: - "@typescript-eslint/scope-manager": 5.30.7 - "@typescript-eslint/types": 5.30.7 - "@typescript-eslint/typescript-estree": 5.30.7 + "@typescript-eslint/scope-manager": 5.32.0 + "@typescript-eslint/types": 5.32.0 + "@typescript-eslint/typescript-estree": 5.32.0 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: f0b2da3cfd047d241f0bd3065a36afe008214aa9e8cd05e9f92d8b0e4b9ec19d3651d0e4a3995b8cb34b553cccb4b0d02d18c0cfbe11f53acd85923dd68366d5 + checksum: 3fcfa183cad125c3198fd63701c6e13dad1cc984d309e8cd40ec9a2eb857902abfd7e9ee3f030b18eb1c18c795a61ea289ef147a7f9dfac38df905e7514316af languageName: node linkType: hard @@ -771,21 +794,21 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.30.7": - version: 5.30.7 - resolution: "@typescript-eslint/scope-manager@npm:5.30.7" +"@typescript-eslint/scope-manager@npm:5.32.0": + version: 5.32.0 + resolution: "@typescript-eslint/scope-manager@npm:5.32.0" dependencies: - "@typescript-eslint/types": 5.30.7 - "@typescript-eslint/visitor-keys": 5.30.7 - checksum: 434ce7a13a8f3bffae2af2b7fe19bab6e490c78114584212519f50cd1b91fbdcddc8ad93bdb3cacdc8cecca5a8c5d2eb606557e66bd3fcd9d3040846846c22ff + "@typescript-eslint/types": 5.32.0 + "@typescript-eslint/visitor-keys": 5.32.0 + checksum: 69bdeb029f39d1112299dc0cb0ddef30e51bdb782fdb79cc4e72fa448e00d71e39938d3bff3fa4ee43b3416c2e3b4564de2c37252914772b07eeedafb14412d6 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.30.7": - version: 5.30.7 - resolution: "@typescript-eslint/type-utils@npm:5.30.7" +"@typescript-eslint/type-utils@npm:5.32.0": + version: 5.32.0 + resolution: "@typescript-eslint/type-utils@npm:5.32.0" dependencies: - "@typescript-eslint/utils": 5.30.7 + "@typescript-eslint/utils": 5.32.0 debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: @@ -793,7 +816,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: e7a8d4ec973355c0fe5bad4c317a55940e41d24b1c33b0bf40e8bb268d784f6584a8048fc84ebdb7287849a2c70e2b36365067cba7815de849cd41a1d7653167 + checksum: 4063808ca054789bebc6adb376d15c13e38f8ea14fa2842c38ae616d77fb77681b67a04b77887cf9ceb6f801ab3fc5eddfb6325779ab821404c62f36c56310bb languageName: node linkType: hard @@ -804,10 +827,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.30.7": - version: 5.30.7 - resolution: "@typescript-eslint/types@npm:5.30.7" - checksum: 2f6345bf0e2e9f392c1f62a5f96c630d4565574230a000508d923444229e51c1a05e07cef042935ca30f4f35755dbf3871b8b9da808911f578d63e6a4b897b79 +"@typescript-eslint/types@npm:5.32.0": + version: 5.32.0 + resolution: "@typescript-eslint/types@npm:5.32.0" + checksum: 6758f54d8d7763893cd7c1753f525ef1777eee8b558bf3d54fd2a2ce691ca0cf813c68a26e4db83a1deae4e4a62b247f1195e15a1f3577f1293849f9e55a232c languageName: node linkType: hard @@ -829,12 +852,12 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.30.7": - version: 5.30.7 - resolution: "@typescript-eslint/typescript-estree@npm:5.30.7" +"@typescript-eslint/typescript-estree@npm:5.32.0": + version: 5.32.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.32.0" dependencies: - "@typescript-eslint/types": 5.30.7 - "@typescript-eslint/visitor-keys": 5.30.7 + "@typescript-eslint/types": 5.32.0 + "@typescript-eslint/visitor-keys": 5.32.0 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 @@ -843,7 +866,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 7cff83a9b9c91a89bcbb677d539b7122b2a423a66f575364858b4635d7e53a25b9329cd20a5adfb732758a41d1c6801d4bfa3eb798a192f351aafb11eedc58b6 + checksum: 6aee08be5d36603d038fb8340f324f5cb38519150c9b37c012f0c1ff2a4d8cf22fbc6835de31d069949c2b3d8ed3e729076a724ef29db4289d9fe73b97c9d310 languageName: node linkType: hard @@ -863,19 +886,19 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.30.7": - version: 5.30.7 - resolution: "@typescript-eslint/utils@npm:5.30.7" +"@typescript-eslint/utils@npm:5.32.0": + version: 5.32.0 + resolution: "@typescript-eslint/utils@npm:5.32.0" dependencies: "@types/json-schema": ^7.0.9 - "@typescript-eslint/scope-manager": 5.30.7 - "@typescript-eslint/types": 5.30.7 - "@typescript-eslint/typescript-estree": 5.30.7 + "@typescript-eslint/scope-manager": 5.32.0 + "@typescript-eslint/types": 5.32.0 + "@typescript-eslint/typescript-estree": 5.32.0 eslint-scope: ^5.1.1 eslint-utils: ^3.0.0 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 77b0baf069f70290214294d74fdf7c46a7ddeab322ef53f65766b0c8e59f0e6f8074beb19233be34faca5beb390ac1b932dd1c983337355674c4437b4b1e2b44 + checksum: cfd88d93508c8fb0db17d2726691e1383db390357fa0637bd8111558fbe72da5130d995294001d71b1d929d620fbce3f20a70b277a77ca21a4241b3b470dc758 languageName: node linkType: hard @@ -889,13 +912,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.30.7": - version: 5.30.7 - resolution: "@typescript-eslint/visitor-keys@npm:5.30.7" +"@typescript-eslint/visitor-keys@npm:5.32.0": + version: 5.32.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.32.0" dependencies: - "@typescript-eslint/types": 5.30.7 + "@typescript-eslint/types": 5.32.0 eslint-visitor-keys: ^3.3.0 - checksum: f322972aeda3143d4c24826436357937131f7fbad102d48cfa6dfca70ac245f93b20cf7beb5f1809bda4fe8f454676a6cabf8f73e39af6724076f2b2c213ee80 + checksum: 1f9b756d648c2346a6e8538ffde729d3d9ce6621fded3d9f15c96aa0ebf8f511daf8232470423fb36359c2113538a4daaf3336181be78a0cfbfd297af91ce9ba languageName: node linkType: hard @@ -940,6 +963,15 @@ __metadata: languageName: node linkType: hard +"acorn@npm:^8.8.0": + version: 8.8.0 + resolution: "acorn@npm:8.8.0" + bin: + acorn: bin/acorn + checksum: 7270ca82b242eafe5687a11fea6e088c960af712683756abf0791b68855ea9cace3057bd5e998ffcef50c944810c1e0ca1da526d02b32110e13c722aa959afdc + languageName: node + linkType: hard + "agent-base@npm:6, agent-base@npm:^6.0.2": version: 6.0.2 resolution: "agent-base@npm:6.0.2" @@ -1182,13 +1214,6 @@ __metadata: languageName: node linkType: hard -"buffer-from@npm:^1.0.0": - version: 1.1.2 - resolution: "buffer-from@npm:1.1.2" - checksum: 0448524a562b37d4d7ed9efd91685a5b77a50672c556ea254ac9a6d30e3403a517d8981f10e565db24e8339413b43c97ca2951f10e399c6125a0d8911f5679bb - languageName: node - linkType: hard - "buffer-writer@npm:2.0.0": version: 2.0.0 resolution: "buffer-writer@npm:2.0.0" @@ -1210,8 +1235,8 @@ __metadata: version: 0.0.0-use.local resolution: "bush-bot@workspace:." dependencies: - "@discordjs/builders": ^1.0.0 - "@discordjs/rest": ^1.0.0 + "@discordjs/builders": ^1.1.0 + "@discordjs/rest": ^1.0.1 "@ironm00n/nbt-ts": ^1.4.0 "@notenoughupdates/discord.js-minesweeper": ^1.0.10 "@notenoughupdates/events-intercept": ^3.0.1 @@ -1219,41 +1244,41 @@ __metadata: "@notenoughupdates/simplify-number": ^1.0.1 "@notenoughupdates/wolfram-alpha-api": ^1.0.2 "@sapphire/snowflake": ^3.2.2 - "@sentry/integrations": ^7.7.0 - "@sentry/node": ^7.7.0 - "@sentry/tracing": ^7.7.0 - "@sentry/types": ^7.7.0 + "@sentry/integrations": ^7.9.0 + "@sentry/node": ^7.9.0 + "@sentry/tracing": ^7.9.0 + "@sentry/types": ^7.9.0 "@types/eslint": ^8.4.5 "@types/express": ^4.17.13 "@types/lodash": ^4.14.182 - "@types/node": ^18.0.6 + "@types/node": ^18.6.4 "@types/numeral": ^2.0.2 "@types/pg": ^8.6.5 - "@types/prettier": ^2.6.3 + "@types/prettier": ^2.7.0 "@types/rimraf": ^3.0.2 "@types/tinycolor2": ^1.4.3 - "@types/validator": ^13.7.4 - "@typescript-eslint/eslint-plugin": ^5.30.7 - "@typescript-eslint/parser": ^5.30.7 + "@types/validator": ^13.7.5 + "@typescript-eslint/eslint-plugin": ^5.32.0 + "@typescript-eslint/parser": ^5.32.0 canvas: ^2.9.3 chalk: ^5.0.1 deep-lock: ^1.0.0 discord-akairo: "npm:@notenoughupdates/discord-akairo@dev" - discord-api-types: 0.36.2 + discord-api-types: 0.37.1 discord.js: "npm:@notenoughupdates/discord.js@dev" - electron: latest - eslint: ^8.20.0 + electron: ^20.0.1 + eslint: ^8.21.0 eslint-config-prettier: ^8.5.0 eslint-plugin-deprecation: ^1.3.2 eslint-plugin-import: ^2.26.0 fuse.js: ^6.6.2 gif-to-apng: ^0.1.2 googleapis: ^105.0.0 - got: ^12.1.0 + got: ^12.3.0 lodash: ^4.17.21 - mathjs: ^10.6.4 + mathjs: ^11.0.1 nanoid: ^4.0.0 - node-fetch: ^3.2.9 + node-fetch: ^3.2.10 numeral: ^2.0.6 pg: ^8.7.3 pg-hstore: ^2.3.4 @@ -1264,7 +1289,7 @@ __metadata: tinycolor2: ^1.4.2 ts-essentials: ^9.2.0 typescript: ^4.7.4 - vitest: ^0.18.1 + vitest: ^0.21.0 vm2: ^3.9.10 languageName: unknown linkType: soft @@ -1479,18 +1504,6 @@ __metadata: languageName: node linkType: hard -"concat-stream@npm:^1.6.2": - version: 1.6.2 - resolution: "concat-stream@npm:1.6.2" - dependencies: - buffer-from: ^1.0.0 - inherits: ^2.0.3 - readable-stream: ^2.2.2 - typedarray: ^0.0.6 - checksum: 1ef77032cb4459dcd5187bd710d6fc962b067b64ec6a505810de3d2b8cc0605638551b42f8ec91edf6fcd26141b32ef19ad749239b58fae3aba99187adc32285 - languageName: node - linkType: hard - "config-chain@npm:^1.1.11": version: 1.1.13 resolution: "config-chain@npm:1.1.13" @@ -1769,10 +1782,10 @@ __metadata: languageName: node linkType: hard -"discord-api-types@npm:0.36.2, discord-api-types@npm:^0.36.2": - version: 0.36.2 - resolution: "discord-api-types@npm:0.36.2" - checksum: 0275ac9db1bb8354ed3fedb37d7fa66d02b63aa6dc749add1e9ed52b428e94cb8b5111bd60e781cf0c2c5cdb0e948c4e83d00b74f500f1b0ac90ddc38a822798 +"discord-api-types@npm:0.37.1": + version: 0.37.1 + resolution: "discord-api-types@npm:0.37.1" + checksum: 4adfd605dae426299b537105f657b4649535f446202051aaef0ccbbaf024175bdbe868487119480ff094c8e479c2e424ce393f2595b16e1840cc0f3a555e510f languageName: node linkType: hard @@ -1783,6 +1796,13 @@ __metadata: languageName: node linkType: hard +"discord-api-types@npm:^0.36.3": + version: 0.36.3 + resolution: "discord-api-types@npm:0.36.3" + checksum: 3089c0fb37425dc5df03c76d82988d43fcc272699b06a02fc830d0a3bef550009aaebdf6d646529e8a7ccea76ae3f43b099d736ea5ef37a0be143142ab49871d + languageName: node + linkType: hard + "discord.js@npm:@notenoughupdates/discord.js@dev": version: 14.0.0-dev.1655248959-627886d resolution: "@notenoughupdates/discord.js@npm:14.0.0-dev.1655248959-627886d" @@ -1843,16 +1863,16 @@ __metadata: languageName: node linkType: hard -"electron@npm:latest": - version: 19.0.9 - resolution: "electron@npm:19.0.9" +"electron@npm:^20.0.1": + version: 20.0.1 + resolution: "electron@npm:20.0.1" dependencies: "@electron/get": ^1.14.1 "@types/node": ^16.11.26 - extract-zip: ^1.0.3 + extract-zip: ^2.0.1 bin: electron: cli.js - checksum: 662e63216c2802340cd1d2f28664818ec30fade0e1cb9da3a1afb2b13b2c6d920d1506b2c62442ea0118ba8965edee3f1e7c365b8cd1d4060f9a250db1161d47 + checksum: 1ae66fdd7d9bb03bc8eaead814c429ccc20427cfc430ab70cd55c24e3f948c2aab7713de3478894ce15e5436bc4c5353b538062420b493f17bc62a626b836abe languageName: node linkType: hard @@ -2298,12 +2318,13 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.20.0": - version: 8.20.0 - resolution: "eslint@npm:8.20.0" +"eslint@npm:^8.21.0": + version: 8.21.0 + resolution: "eslint@npm:8.21.0" dependencies: "@eslint/eslintrc": ^1.3.0 - "@humanwhocodes/config-array": ^0.9.2 + "@humanwhocodes/config-array": ^0.10.4 + "@humanwhocodes/gitignore-to-minimatch": ^1.0.2 ajv: ^6.10.0 chalk: ^4.0.0 cross-spawn: ^7.0.2 @@ -2313,14 +2334,17 @@ __metadata: eslint-scope: ^7.1.1 eslint-utils: ^3.0.0 eslint-visitor-keys: ^3.3.0 - espree: ^9.3.2 + espree: ^9.3.3 esquery: ^1.4.0 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 file-entry-cache: ^6.0.1 + find-up: ^5.0.0 functional-red-black-tree: ^1.0.1 glob-parent: ^6.0.1 globals: ^13.15.0 + globby: ^11.1.0 + grapheme-splitter: ^1.0.4 ignore: ^5.2.0 import-fresh: ^3.0.0 imurmurhash: ^0.1.4 @@ -2339,7 +2363,7 @@ __metadata: v8-compile-cache: ^2.0.3 bin: eslint: bin/eslint.js - checksum: a31adf390d71d916925586bc8467b48f620e93dd0416bc1e897d99265af88b48d4eba3985b5ff4653ae5cc46311a360d373574002277e159bb38a4363abf9228 + checksum: 1d39ddb08772ea230cb7d74f7f81f85b9d46965d3600725c7eb39a27bcdaf28cb2a780dacf6cfa1cfbf2da606b57a5e7e3ab373ab474cbcf0ba042076821f501 languageName: node linkType: hard @@ -2354,6 +2378,17 @@ __metadata: languageName: node linkType: hard +"espree@npm:^9.3.3": + version: 9.3.3 + resolution: "espree@npm:9.3.3" + dependencies: + acorn: ^8.8.0 + acorn-jsx: ^5.3.2 + eslint-visitor-keys: ^3.3.0 + checksum: 33e8a36fc15d082e68672e322e22a53856b564d60aad8f291a667bfc21b2c900c42412d37dd3c7a0f18b9d0d8f8858dabe8776dbd4b4c2f72c5cf4d6afeabf65 + languageName: node + linkType: hard + "esquery@npm:^1.4.0": version: 1.4.0 resolution: "esquery@npm:1.4.0" @@ -2422,17 +2457,20 @@ __metadata: languageName: node linkType: hard -"extract-zip@npm:^1.0.3": - version: 1.7.0 - resolution: "extract-zip@npm:1.7.0" +"extract-zip@npm:^2.0.1": + version: 2.0.1 + resolution: "extract-zip@npm:2.0.1" dependencies: - concat-stream: ^1.6.2 - debug: ^2.6.9 - mkdirp: ^0.5.4 + "@types/yauzl": ^2.9.1 + debug: ^4.1.1 + get-stream: ^5.1.0 yauzl: ^2.10.0 + dependenciesMeta: + "@types/yauzl": + optional: true bin: extract-zip: cli.js - checksum: 011bab660d738614555773d381a6ba4815d98c1cfcdcdf027e154ebcc9fc8c9ef637b3ea5c9b2144013100071ee41722ed041fc9aacc60f6198ef747cac0c073 + checksum: 8cbda9debdd6d6980819cc69734d874ddd71051c9fe5bde1ef307ebcedfe949ba57b004894b585f758b7c9eeeea0e3d87f2dda89b7d25320459c2c9643ebb635 languageName: node linkType: hard @@ -2514,14 +2552,14 @@ __metadata: languageName: node linkType: hard -"file-type@npm:^17.1.2": - version: 17.1.2 - resolution: "file-type@npm:17.1.2" +"file-type@npm:^17.1.4": + version: 17.1.6 + resolution: "file-type@npm:17.1.6" dependencies: readable-web-to-node-stream: ^3.0.2 - strtok3: ^7.0.0-alpha.7 + strtok3: ^7.0.0-alpha.9 token-types: ^5.0.0-alpha.2 - checksum: 22103084b47d1fdc82e84b979512a2e9e488643f975b04cfd39acb2a9ab212438274a4f06039061631ca01be030f174c387c4a3ab9fe3417a1a199cb59079cb8 + checksum: 797e0d155ecaf4b575d4569a0188bfed85af19d18cf3d93ec8bb66d797172a1fde9f13d56135c6a0b471cacd7ecc1adb0c9a45c6e3a19436f682a275d0be16cc languageName: node linkType: hard @@ -2564,6 +2602,16 @@ __metadata: languageName: node linkType: hard +"find-up@npm:^5.0.0": + version: 5.0.0 + resolution: "find-up@npm:5.0.0" + dependencies: + locate-path: ^6.0.0 + path-exists: ^4.0.0 + checksum: 07955e357348f34660bde7920783204ff5a26ac2cafcaa28bace494027158a97b9f56faaf2d89a6106211a8174db650dd9f503f9c0d526b1202d5554a00b9095 + languageName: node + linkType: hard + "flat-cache@npm:^3.0.4": version: 3.0.4 resolution: "flat-cache@npm:3.0.4" @@ -2581,10 +2629,10 @@ __metadata: languageName: node linkType: hard -"form-data-encoder@npm:1.7.1": - version: 1.7.1 - resolution: "form-data-encoder@npm:1.7.1" - checksum: a2a360d5588a70d323c12a140c3db23a503a38f0a5d141af1efad579dde9f9fff2e49e5f31f378cb4631518c1ab4a826452c92f0d2869e954b6b2d77b05613e1 +"form-data-encoder@npm:^2.0.1": + version: 2.0.1 + resolution: "form-data-encoder@npm:2.0.1" + checksum: 66a8dd84d7fcbab5fdaec9382f29e26a12b625d491ddfd267c7c7b0bf5b41b142c51826d4b89155fa975c09ea32b67000b6d01074410d57d6a7adee7405754c0 languageName: node linkType: hard @@ -3001,24 +3049,24 @@ __metadata: languageName: node linkType: hard -"got@npm:^12.1.0": - version: 12.1.0 - resolution: "got@npm:12.1.0" +"got@npm:^12.3.0": + version: 12.3.0 + resolution: "got@npm:12.3.0" dependencies: - "@sindresorhus/is": ^4.6.0 + "@sindresorhus/is": ^5.2.0 "@szmarczak/http-timer": ^5.0.1 "@types/cacheable-request": ^6.0.2 "@types/responselike": ^1.0.0 cacheable-lookup: ^6.0.4 cacheable-request: ^7.0.2 decompress-response: ^6.0.0 - form-data-encoder: 1.7.1 + form-data-encoder: ^2.0.1 get-stream: ^6.0.1 http2-wrapper: ^2.1.10 lowercase-keys: ^3.0.0 p-cancelable: ^3.0.0 responselike: ^2.0.0 - checksum: 1cc9af6ca511338a7f1bbb0943999e6ac324ea3c7d826066c02e530b4ac41147b1a4cadad21b28c3938de82185ac99c33d64a3a4560c6e0b0b125191ba6ee619 + checksum: 3f2ec7a17d7fdd259a668888eb5ee6e6b7794ec466f1a7d3170697306e4838350515495c60879a3b4d6b228d2a42749fd43941bd876748671b9c04e37a7e34b5 languageName: node linkType: hard @@ -3048,6 +3096,13 @@ __metadata: languageName: node linkType: hard +"grapheme-splitter@npm:^1.0.4": + version: 1.0.4 + resolution: "grapheme-splitter@npm:1.0.4" + checksum: 0c22ec54dee1b05cd480f78cf14f732cb5b108edc073572c4ec205df4cd63f30f8db8025afc5debc8835a8ddeacf648a1c7992fe3dcd6ad38f9a476d84906620 + languageName: node + linkType: hard + "gtoken@npm:^5.3.2": version: 5.3.2 resolution: "gtoken@npm:5.3.2" @@ -3619,6 +3674,15 @@ __metadata: languageName: node linkType: hard +"locate-path@npm:^6.0.0": + version: 6.0.0 + resolution: "locate-path@npm:6.0.0" + dependencies: + p-locate: ^5.0.0 + checksum: 72eb661788a0368c099a184c59d2fee760b3831c9c1c33955e8a19ae4a21b4116e53fa736dc086cdeb9fce9f7cc508f2f92d2d3aae516f133e16a2bb59a39f5a + languageName: node + linkType: hard + "lodash.merge@npm:^4.6.2": version: 4.6.2 resolution: "lodash.merge@npm:4.6.2" @@ -3761,11 +3825,11 @@ __metadata: languageName: node linkType: hard -"mathjs@npm:^10.6.4": - version: 10.6.4 - resolution: "mathjs@npm:10.6.4" +"mathjs@npm:^11.0.1": + version: 11.0.1 + resolution: "mathjs@npm:11.0.1" dependencies: - "@babel/runtime": ^7.18.6 + "@babel/runtime": ^7.18.9 complex.js: ^2.1.1 decimal.js: ^10.3.1 escape-latex: ^1.2.0 @@ -3773,10 +3837,10 @@ __metadata: javascript-natural-sort: ^0.7.1 seedrandom: ^3.0.5 tiny-emitter: ^2.1.0 - typed-function: ^2.1.0 + typed-function: ^3.0.0 bin: mathjs: bin/cli.js - checksum: 64c785d6f3cd0500888be31793d677d50f7da51b04fe009ba2d5be5f29948b3ef70fd26f8fa80064f4c18716a9ab59dd600236ffcca7e9ea6265a91c5b1540a9 + checksum: 2feb1c9c16ff7a8375ec678bfc9e114007739cfb4fff7409042779f3f9496107974a4bb49a01e9e7358222f30d5b32fb763b41bf9b2a08ab84376af397825af1 languageName: node linkType: hard @@ -3913,17 +3977,6 @@ __metadata: languageName: node linkType: hard -"mkdirp@npm:^0.5.4": - version: 0.5.6 - resolution: "mkdirp@npm:0.5.6" - dependencies: - minimist: ^1.2.6 - bin: - mkdirp: bin/cmd.js - checksum: 0c91b721bb12c3f9af4b77ebf73604baf350e64d80df91754dc509491ae93bf238581e59c7188360cec7cb62fc4100959245a42cfe01834efedc5e9d068376c2 - languageName: node - linkType: hard - "mkdirp@npm:^1.0.3, mkdirp@npm:^1.0.4": version: 1.0.4 resolution: "mkdirp@npm:1.0.4" @@ -4032,14 +4085,14 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^3.2.9": - version: 3.2.9 - resolution: "node-fetch@npm:3.2.9" +"node-fetch@npm:^3.2.10": + version: 3.2.10 + resolution: "node-fetch@npm:3.2.10" dependencies: data-uri-to-buffer: ^4.0.0 fetch-blob: ^3.1.4 formdata-polyfill: ^4.0.10 - checksum: ba421350b2dbab67d8068f9d24f30ef8b9a37a3f83388d2efaf79628de754c85df81829c009579ea5562a2b11d9f07ecd21d27b5b8bed0cb393b92abe4817a75 + checksum: e65322431f4897ded04197aa5923eaec63a8d53e00432de4e70a4f7006625c8dc32629c5c35f4fe8ee719a4825544d07bf53f6e146a7265914262f493e8deac1 languageName: node linkType: hard @@ -4242,6 +4295,15 @@ __metadata: languageName: node linkType: hard +"p-limit@npm:^3.0.2": + version: 3.1.0 + resolution: "p-limit@npm:3.1.0" + dependencies: + yocto-queue: ^0.1.0 + checksum: 7c3690c4dbf62ef625671e20b7bdf1cbc9534e83352a2780f165b0d3ceba21907e77ad63401708145ca4e25bfc51636588d89a8c0aeb715e6c37d1c066430360 + languageName: node + linkType: hard + "p-locate@npm:^2.0.0": version: 2.0.0 resolution: "p-locate@npm:2.0.0" @@ -4251,6 +4313,15 @@ __metadata: languageName: node linkType: hard +"p-locate@npm:^5.0.0": + version: 5.0.0 + resolution: "p-locate@npm:5.0.0" + dependencies: + p-limit: ^3.0.2 + checksum: 1623088f36cf1cbca58e9b61c4e62bf0c60a07af5ae1ca99a720837356b5b6c5ba3eb1b2127e47a06865fee59dd0453cad7cc844cda9d5a62ac1a5a51b7c86d3 + languageName: node + linkType: hard + "p-map@npm:^4.0.0": version: 4.0.0 resolution: "p-map@npm:4.0.0" @@ -4290,6 +4361,13 @@ __metadata: languageName: node linkType: hard +"path-exists@npm:^4.0.0": + version: 4.0.0 + resolution: "path-exists@npm:4.0.0" + checksum: 505807199dfb7c50737b057dd8d351b82c033029ab94cb10a657609e00c1bc53b951cfdbccab8de04c5584d5eff31128ce6afd3db79281874a5ef2adbba55ed1 + languageName: node + linkType: hard + "path-is-absolute@npm:^1.0.0": version: 1.0.1 resolution: "path-is-absolute@npm:1.0.1" @@ -4332,10 +4410,10 @@ __metadata: languageName: node linkType: hard -"peek-readable@npm:^5.0.0-alpha.5": - version: 5.0.0-alpha.5 - resolution: "peek-readable@npm:5.0.0-alpha.5" - checksum: cab949ed457dac95ae191dd412c6a0ba05e8db4842fd51704ccf2c8c16d6f3ceeefc997e8caea584a0395f229e468c0203a38a8d0ec68cfef8bacc157a006dcb +"peek-readable@npm:^5.0.0": + version: 5.0.0 + resolution: "peek-readable@npm:5.0.0" + checksum: bef5ceb50586eb42e14efba274ac57ffe97f0ed272df9239ce029f688f495d9bf74b2886fa27847c706a9db33acda4b7d23bbd09a2d21eb4c2a54da915117414 languageName: node linkType: hard @@ -4627,7 +4705,7 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^2.2.2, readable-stream@npm:^2.3.0, readable-stream@npm:^2.3.5": +"readable-stream@npm:^2.3.0, readable-stream@npm:^2.3.5": version: 2.3.7 resolution: "readable-stream@npm:2.3.7" dependencies: @@ -5168,13 +5246,13 @@ __metadata: languageName: node linkType: hard -"strtok3@npm:^7.0.0-alpha.7": - version: 7.0.0-alpha.8 - resolution: "strtok3@npm:7.0.0-alpha.8" +"strtok3@npm:^7.0.0-alpha.9": + version: 7.0.0 + resolution: "strtok3@npm:7.0.0" dependencies: "@tokenizer/token": ^0.3.0 - peek-readable: ^5.0.0-alpha.5 - checksum: 00e5c9ed0c5de537839cf443d5628f0ae88d2956ca1fdcbd45cd97372045d7179a40ec99f6d06b02c59ec2141e362142ad0a87c59506d401dbd3bd1ee242abaa + peek-readable: ^5.0.0 + checksum: 2ebe7ad8f2aea611dec6742cf6a42e82764892a362907f7ce493faf334501bf981ce21c828dcc300457e6d460dc9c34d644ededb3b01dcb9e37559203cf1748c languageName: node linkType: hard @@ -5411,17 +5489,10 @@ __metadata: languageName: node linkType: hard -"typed-function@npm:^2.1.0": - version: 2.1.0 - resolution: "typed-function@npm:2.1.0" - checksum: 168c2c8f765fbecc842521a5fb62a5800958f9fcb0ce78d69c38a5e96c81fe133f853256ec8ee245ee2fc42b4c9342b5ba754c732189550c64c12e758892dc43 - languageName: node - linkType: hard - -"typedarray@npm:^0.0.6": - version: 0.0.6 - resolution: "typedarray@npm:0.0.6" - checksum: 33b39f3d0e8463985eeaeeacc3cb2e28bc3dfaf2a5ed219628c0b629d5d7b810b0eb2165f9f607c34871d5daa92ba1dc69f49051cf7d578b4cbd26c340b9d1b1 +"typed-function@npm:^3.0.0": + version: 3.0.0 + resolution: "typed-function@npm:3.0.0" + checksum: f05afc8254dcb72815903c764fc3f8064a50ce1a0db9eb3a5134528209a852c8817682bdaf8ee9a73b316d4a4bbf92b6ae030934dd0983e7a2fd7fa487a71cec languageName: node linkType: hard @@ -5437,7 +5508,7 @@ __metadata: "typescript@patch:typescript@^4.7.4#~builtin": version: 4.7.4 - resolution: "typescript@patch:typescript@npm%3A4.7.4#~builtin::version=4.7.4&hash=7ad353" + resolution: "typescript@patch:typescript@npm%3A4.7.4#~builtin::version=4.7.4&hash=f456af" bin: tsc: bin/tsc tsserver: bin/tsserver @@ -5481,10 +5552,10 @@ __metadata: languageName: node linkType: hard -"undici@npm:^5.7.0": - version: 5.8.0 - resolution: "undici@npm:5.8.0" - checksum: 7b486ad064da00628d3906e140b86223023cd3494c811da8d7aa1375c2392fe6a6ac421af236c056fd3d3136bba3a91b99e0505dde071dd946070946eb0718b8 +"undici@npm:^5.8.0": + version: 5.8.1 + resolution: "undici@npm:5.8.1" + checksum: 0d5d8b9654f031a5490dcd89cd73db452ad51b06def08ce4ac07a1a46564cb6f039be4862bc013ec45b7ca465a468eb5c4caa761a26541958307f8d75878129a languageName: node linkType: hard @@ -5600,9 +5671,9 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^0.18.1": - version: 0.18.1 - resolution: "vitest@npm:0.18.1" +"vitest@npm:^0.21.0": + version: 0.21.0 + resolution: "vitest@npm:0.21.0" dependencies: "@types/chai": ^4.3.1 "@types/chai-subset": ^1.3.3 @@ -5615,6 +5686,7 @@ __metadata: vite: ^2.9.12 || ^3.0.0-0 peerDependencies: "@edge-runtime/vm": "*" + "@vitest/browser": "*" "@vitest/ui": "*" c8: "*" happy-dom: "*" @@ -5622,6 +5694,8 @@ __metadata: peerDependenciesMeta: "@edge-runtime/vm": optional: true + "@vitest/browser": + optional: true "@vitest/ui": optional: true c8: @@ -5632,7 +5706,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: 0d3a77625eb542bae27715cb24c91b7f4379d1084ce154ff54c991ab669fe0977a927121d232e6659e97b71b852060ca85c0b1825612f2e092b436e24cca276c + checksum: c7aed226d7e67aa9409e7177c7dc6cacebc743212f22773b79d0d4795de83aff5c1c8559999b93c405afdef4f115cd527a84ecec4e2a25620be688ed3bd64695 languageName: node linkType: hard @@ -5784,3 +5858,10 @@ __metadata: checksum: 7f21fe0bbad6e2cb130044a5d1d0d5a0e5bf3d8d4f8c4e6ee12163ce798fee3de7388d22a7a0907f563ac5f9d40f8699a223d3d5c1718da90b0156da6904022b languageName: node linkType: hard + +"yocto-queue@npm:^0.1.0": + version: 0.1.0 + resolution: "yocto-queue@npm:0.1.0" + checksum: f77b3d8d00310def622123df93d4ee654fc6a0096182af8bd60679ddcdfb3474c56c6c7190817c84a2785648cdee9d721c0154eb45698c62176c322fb46fc700 + languageName: node + linkType: hard -- cgit From dc0784722cd92f9b2343ee7a5fa36f740cb9926e Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 22:57:41 -0400 Subject: add automod to quote --- src/lib/extensions/discord.js/ExtendedGuild.ts | 28 ++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/lib/extensions/discord.js/ExtendedGuild.ts b/src/lib/extensions/discord.js/ExtendedGuild.ts index c58916c..56bc1f8 100644 --- a/src/lib/extensions/discord.js/ExtendedGuild.ts +++ b/src/lib/extensions/discord.js/ExtendedGuild.ts @@ -11,6 +11,7 @@ import { type GuildLogType, type GuildModel } from '#lib'; +import assert from 'assert'; import { AttachmentBuilder, AttachmentPayload, @@ -735,10 +736,33 @@ export class ExtendedGuild extends Guild { sendOptions.content = 'Wondering who to invite? Start by inviting anyone who can help you build the server!'; break; + // todo: use enum for this + case 24 as MessageType: { + const embed = quote.embeds[0]; + assert.equal(embed.data.type, 'auto_moderation_message'); + const ruleName = embed.fields!.find((f) => f.name === 'rule_name')!.value; + const channelId = embed.fields!.find((f) => f.name === 'channel_id')!.value; + const keyword = embed.fields!.find((f) => f.name === 'keyword')!.value; + + sendOptions.username = `AutoMod (${quote.member?.displayName ?? quote.author.username})`; + sendOptions.content = `Automod has blocked a message in <#${channelId}>`; + sendOptions.embeds = [ + { + title: quote.member?.displayName ?? quote.author.username, + description: embed.description ?? 'There is no content???', + footer: { + text: `Keyword: ${keyword} • Rule: ${ruleName}` + }, + color: 0x36393f + } + ]; + + break; + } case MessageType.ChannelIconChange: case MessageType.Call: default: - sendOptions.content = `${emojis.error} I cannot quote **${ + sendOptions.content = `${emojis.error} I cannot quote messages of type **${ MessageType[quote.type] || quote.type }** messages, please report this to my developers.`; @@ -746,7 +770,7 @@ export class ExtendedGuild extends Guild { } sendOptions.allowedMentions = AllowedMentions.none(); - sendOptions.username = quote.member?.displayName ?? quote.author.username; + sendOptions.username ??= quote.member?.displayName ?? quote.author.username; sendOptions.avatarURL = quote.member?.displayAvatarURL({ size: 2048 }) ?? quote.author.displayAvatarURL({ size: 2048 }); return await webhook.send(sendOptions); /* .catch((e: any) => e); */ -- cgit From 341565e2c30bfdc60e174c6abfb9f6bacbb1d5e3 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 23:14:44 -0400 Subject: add command snippet --- .vscode/typescript.code-snippets | 61 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/.vscode/typescript.code-snippets b/.vscode/typescript.code-snippets index 6ab1c89..29418b1 100644 --- a/.vscode/typescript.code-snippets +++ b/.vscode/typescript.code-snippets @@ -72,5 +72,66 @@ "\trequired: $3", "},$0" ] + }, + + // prettier-ignore + "Command":{ + "prefix": "command", + "description": "A bot command template", + "body": [ + "import {", + "\tBushCommand,", + "\tclientSendAndPermCheck,", + "\temojis,", + "\ttype ArgType,", + "\ttype CommandMessage,", + "\ttype OptArgType,", + "\ttype SlashMessage", + "} from '#lib';", + "", + "import { ApplicationCommandOptionType } from 'discord.js';", + "export default class ${1:CommandName} extends BushCommand {", + "\tpublic constructor() {", + "\t\tsuper('${2:commandId}', {", + "\t\t\taliases: ['${3:alias}'],", + "\t\t\tcategory: '${4:category}',", + "\t\t\tdescription: '${5:description}.',", + "\t\t\tusage: ['${3:alias} <${6:arg}> [${7:arg}]'],", + "\t\t\texamples: ['${3:alias} ${8:argExample} ${9:argExample}'],", + "\t\t\targs: [", + "\t\t\t\t{", + "\t\t\t\t\tid: '${6:arg}',", + "\t\t\t\t\tdescription: '${10:Argument description}.',", + "\t\t\t\t\ttype: '${11:argType}',", + "\t\t\t\t\tprompt: '${12:What is arg}?',", + "\t\t\t\t\tretry: '{error} ${13:Invalid arg}.',", + "\t\t\t\t\toptional: ${14|true,false|},", + "\t\t\t\t\tslashType: ApplicationCommandOptionType.${15|Subcommand,SubcommandGroup,String,Integer,Boolean,User,Channel,Role,Mentionable,Number,Attachment|}", + "\t\t\t\t},", + "\t\t\t\t{", + "\t\t\t\t\tid: '${7:arg}',", + "\t\t\t\t\tdescription: '${16:Argument description}.',", + "\t\t\t\t\ttype: '${17:argType}',", + "\t\t\t\t\tprompt: '${18:What is arg}?',", + "\t\t\t\t\tretry: '{error} ${19:Invalid arg}.',", + "\t\t\t\t\toptional: ${20|true,false|},", + "\t\t\t\t\tslashType: ApplicationCommandOptionType.${21|Subcommand,SubcommandGroup,String,Integer,Boolean,User,Channel,Role,Mentionable,Number,Attachment|}", + "\t\t\t\t}", + "\t\t\t],", + "\t\t\tslash: ${22|true,false|},", + "\t\t\tchannel: '${23|guild,dm|}',", + "\t\t\tclientPermissions: (m) => clientSendAndPermCheck(m),", + "\t\t\tuserPermissions: []", + "\t\t});", + "\t}", + "", + "\tpublic override async exec(", + "\t\tmessage: CommandMessage | SlashMessage,", + "\t\targs: { ${6:arg}: ArgType<'${10:argType}'>; ${7:arg}: OptArgType<'${16:argType}'> }", + "\t) {", + "\t\t$0", + "\t}", + "}", + ] } } -- cgit From 904ee80b50148317c0edaf71395a86138833ed7e Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 23:15:04 -0400 Subject: add support thread solved command --- src/commands/moulberry-bush/solved.ts | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/commands/moulberry-bush/solved.ts diff --git a/src/commands/moulberry-bush/solved.ts b/src/commands/moulberry-bush/solved.ts new file mode 100644 index 0000000..836d575 --- /dev/null +++ b/src/commands/moulberry-bush/solved.ts @@ -0,0 +1,44 @@ +import { BushCommand, clientSendAndPermCheck, emojis, mappings, type CommandMessage, type SlashMessage } from '#lib'; +import assert from 'assert'; + +export default class Solved extends BushCommand { + public constructor() { + super('solved', { + aliases: ['solved'], + category: "Moulberry's Bush", + description: 'A command to mark a support threads as solved.', + usage: ['solved'], + examples: ['solved'], + slash: true, + channel: 'guild', + clientPermissions: (m) => clientSendAndPermCheck(m), + userPermissions: [], + slashGuilds: [mappings.guilds["Moulberry's Bush"]], + restrictedGuilds: [mappings.guilds["Moulberry's Bush"]] + }); + } + + public override async exec(message: CommandMessage | SlashMessage) { + assert(message.inGuild()); + assert(message.channel); + + if (!message.channel.isThread()) return message.util.reply(`${emojis.error} This command can only be used in threads.`); + + if (message.channel.parentId !== mappings.channels['neu-support']) + return message.util.reply( + `${emojis.error} This command can only be used in thread that are created in <#${mappings.channels['neu-support']}>.` + ); + + if (message.channel.name.startsWith('[Solved]')) return message.util.reply(`${emojis.error} This thread is already solved.`); + + if (!message.channel.name.startsWith('Support')) + return message.util.reply(`${emojis.error} This thread is not a support thread.`); + + const newName = `[Solved] ${message.channel.name}`; + + await message.channel.setName(newName); + await message.util.reply(`${emojis.success} This thread has been marked as solved.`); + + await message.channel.setArchived(true, `${message.author.tag} (${message.author.id}) marked this support thread as solved.`); + } +} -- cgit From 060349fcabe9e073eca9f6fd334e3355a9756096 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 23:15:35 -0400 Subject: use assert/strict --- src/commands/admin/channelPermissions.ts | 2 +- src/commands/admin/roleAll.ts | 2 +- src/commands/config/blacklist.ts | 2 +- src/commands/config/config.ts | 2 +- src/commands/config/disable.ts | 2 +- src/commands/config/features.ts | 2 +- src/commands/config/log.ts | 2 +- src/commands/dev/eval.ts | 2 +- src/commands/dev/javascript.ts | 2 +- src/commands/dev/sh.ts | 2 +- src/commands/fun/minesweeper.ts | 2 +- src/commands/info/botInfo.ts | 2 +- src/commands/info/color.ts | 2 +- src/commands/info/guildInfo.ts | 2 +- src/commands/info/help.ts | 2 +- src/commands/info/icon.ts | 2 +- src/commands/info/links.ts | 2 +- src/commands/leveling/leaderboard.ts | 2 +- src/commands/leveling/level.ts | 2 +- src/commands/leveling/levelRoles.ts | 2 +- src/commands/leveling/setLevel.ts | 2 +- src/commands/leveling/setXp.ts | 2 +- src/commands/moderation/ban.ts | 2 +- src/commands/moderation/block.ts | 2 +- src/commands/moderation/evidence.ts | 2 +- src/commands/moderation/hideCase.ts | 2 +- src/commands/moderation/kick.ts | 2 +- src/commands/moderation/lockdown.ts | 2 +- src/commands/moderation/massBan.ts | 2 +- src/commands/moderation/massEvidence.ts | 2 +- src/commands/moderation/modlog.ts | 2 +- src/commands/moderation/mute.ts | 2 +- src/commands/moderation/purge.ts | 2 +- src/commands/moderation/removeReactionEmoji.ts | 2 +- src/commands/moderation/role.ts | 2 +- src/commands/moderation/slowmode.ts | 2 +- src/commands/moderation/timeout.ts | 2 +- src/commands/moderation/unban.ts | 2 +- src/commands/moderation/unblock.ts | 2 +- src/commands/moderation/unmute.ts | 2 +- src/commands/moderation/untimeout.ts | 2 +- src/commands/moderation/warn.ts | 2 +- src/commands/moulberry-bush/capes.ts | 2 +- src/commands/moulberry-bush/giveawayPing.ts | 2 +- src/commands/moulberry-bush/moulHammer.ts | 2 +- src/commands/moulberry-bush/report.ts | 2 +- src/commands/moulberry-bush/serverStatus.ts | 2 +- src/commands/moulberry-bush/solved.ts | 2 +- src/commands/utilities/calculator.ts | 2 +- src/commands/utilities/hash.ts | 2 +- src/commands/utilities/highlight-add.ts | 2 +- src/commands/utilities/highlight-block.ts | 2 +- src/commands/utilities/highlight-clear.ts | 2 +- src/commands/utilities/highlight-matches.ts | 2 +- src/commands/utilities/highlight-remove.ts | 2 +- src/commands/utilities/highlight-show.ts | 2 +- src/commands/utilities/highlight-unblock.ts | 2 +- src/commands/utilities/price.ts | 2 +- src/commands/utilities/reminders.ts | 2 +- src/commands/utilities/steal.ts | 2 +- src/commands/utilities/viewRaw.ts | 2 +- src/commands/utilities/whoHasRole.ts | 2 +- src/commands/utilities/wolframAlpha.ts | 2 +- src/lib/common/AutoMod.ts | 2 +- src/lib/common/HighlightManager.ts | 2 +- src/lib/common/util/Moderation.ts | 2 +- src/lib/extensions/discord.js/ExtendedGuild.ts | 2 +- src/lib/utils/BushClientUtils.ts | 2 +- src/lib/utils/BushUtils.ts | 2 +- src/listeners/bush/appealListener.ts | 2 +- src/listeners/bush/supportThread.ts | 2 +- src/listeners/member-custom/bushLevelUpdate.ts | 2 +- src/listeners/ws/INTERACTION_CREATE.ts | 2 +- src/tasks/feature/memberCount.ts | 2 +- src/tasks/feature/removeExpiredPunishements.ts | 2 +- 75 files changed, 75 insertions(+), 75 deletions(-) diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts index 15a1128..0b09e54 100644 --- a/src/commands/admin/channelPermissions.ts +++ b/src/commands/admin/channelPermissions.ts @@ -9,7 +9,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js'; export default class ChannelPermissionsCommand extends BushCommand { diff --git a/src/commands/admin/roleAll.ts b/src/commands/admin/roleAll.ts index c731f08..a48bd6b 100644 --- a/src/commands/admin/roleAll.ts +++ b/src/commands/admin/roleAll.ts @@ -8,7 +8,7 @@ import { type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type GuildMember } from 'discord.js'; export default class RoleAllCommand extends BushCommand { diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts index 6768a1c..a098f9d 100644 --- a/src/commands/config/blacklist.ts +++ b/src/commands/config/blacklist.ts @@ -10,7 +10,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, GuildMember, PermissionFlagsBits, User } from 'discord.js'; export default class BlacklistCommand extends BushCommand { diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts index c562add..cbfc5f7 100644 --- a/src/commands/config/config.ts +++ b/src/commands/config/config.ts @@ -14,7 +14,7 @@ import { type GuildSettingType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { type ArgumentGeneratorReturn, type SlashOption } from 'discord-akairo'; import { diff --git a/src/commands/config/disable.ts b/src/commands/config/disable.ts index e9866d5..00dea76 100644 --- a/src/commands/config/disable.ts +++ b/src/commands/config/disable.ts @@ -9,7 +9,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, AutocompleteInteraction, PermissionFlagsBits } from 'discord.js'; import Fuse from 'fuse.js'; diff --git a/src/commands/config/features.ts b/src/commands/config/features.ts index 5eafb0c..625086a 100644 --- a/src/commands/config/features.ts +++ b/src/commands/config/features.ts @@ -9,7 +9,7 @@ import { type GuildFeatures, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ActionRowBuilder, ComponentType, diff --git a/src/commands/config/log.ts b/src/commands/config/log.ts index 3726105..f79f60e 100644 --- a/src/commands/config/log.ts +++ b/src/commands/config/log.ts @@ -9,7 +9,7 @@ import { type GuildLogType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ArgumentGeneratorReturn } from 'discord-akairo'; import { ApplicationCommandOptionType, ChannelType, PermissionFlagsBits } from 'discord.js'; diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts index ab7787d..a4a52b5 100644 --- a/src/commands/dev/eval.ts +++ b/src/commands/dev/eval.ts @@ -20,7 +20,7 @@ import { type SlashMessage } from '#lib'; import { Snowflake as Snowflake_ } from '@sapphire/snowflake'; -import assert from 'assert'; +import assert from 'assert/strict'; import { Canvas } from 'canvas'; import { exec } from 'child_process'; import { diff --git a/src/commands/dev/javascript.ts b/src/commands/dev/javascript.ts index 6b6c7e1..12ad6f7 100644 --- a/src/commands/dev/javascript.ts +++ b/src/commands/dev/javascript.ts @@ -8,7 +8,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js'; import { VM } from 'vm2'; assert(VM); diff --git a/src/commands/dev/sh.ts b/src/commands/dev/sh.ts index 1b9ce22..609129d 100644 --- a/src/commands/dev/sh.ts +++ b/src/commands/dev/sh.ts @@ -8,7 +8,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import chalk from 'chalk'; import { exec } from 'child_process'; import { ApplicationCommandOptionType, cleanCodeBlockContent, EmbedBuilder } from 'discord.js'; diff --git a/src/commands/fun/minesweeper.ts b/src/commands/fun/minesweeper.ts index c2fdccf..f2db6ee 100644 --- a/src/commands/fun/minesweeper.ts +++ b/src/commands/fun/minesweeper.ts @@ -8,7 +8,7 @@ import { type SlashMessage } from '#lib'; import { Minesweeper } from '@notenoughupdates/discord.js-minesweeper'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType } from 'discord.js'; assert(Minesweeper); diff --git a/src/commands/info/botInfo.ts b/src/commands/info/botInfo.ts index f284e0f..d84fd4e 100644 --- a/src/commands/info/botInfo.ts +++ b/src/commands/info/botInfo.ts @@ -7,7 +7,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { EmbedBuilder, PermissionFlagsBits, version as discordJSVersion } from 'discord.js'; import * as os from 'os'; const { default: prettyBytes } = await import('pretty-bytes'); diff --git a/src/commands/info/color.ts b/src/commands/info/color.ts index 7286c5c..7601562 100644 --- a/src/commands/info/color.ts +++ b/src/commands/info/color.ts @@ -8,7 +8,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, EmbedBuilder, GuildMember, PermissionFlagsBits, Role } from 'discord.js'; import tinycolor from 'tinycolor2'; assert(tinycolor); diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts index dd5704f..e67cdf4 100644 --- a/src/commands/info/guildInfo.ts +++ b/src/commands/info/guildInfo.ts @@ -12,7 +12,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, ChannelType, diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index 1a8eae5..492f25d 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -9,7 +9,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ActionRowBuilder, ApplicationCommandOptionType, diff --git a/src/commands/info/icon.ts b/src/commands/info/icon.ts index e66f900..b3434ec 100644 --- a/src/commands/info/icon.ts +++ b/src/commands/info/icon.ts @@ -1,5 +1,5 @@ import { BushCommand, clientSendAndPermCheck, colors, type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { EmbedBuilder, escapeMarkdown, PermissionFlagsBits } from 'discord.js'; export default class IconCommand extends BushCommand { diff --git a/src/commands/info/links.ts b/src/commands/info/links.ts index 3c7add2..3dbdbef 100644 --- a/src/commands/info/links.ts +++ b/src/commands/info/links.ts @@ -1,5 +1,5 @@ import { BushCommand, clientSendAndPermCheck, invite, type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js'; import packageDotJSON from '../../../package.json' assert { type: 'json' }; diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts index 7eef990..bb41a12 100644 --- a/src/commands/leveling/leaderboard.ts +++ b/src/commands/leveling/leaderboard.ts @@ -9,7 +9,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js'; export default class LeaderboardCommand extends BushCommand { diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts index 7888695..eda43f2 100644 --- a/src/commands/leveling/level.ts +++ b/src/commands/leveling/level.ts @@ -10,7 +10,7 @@ import { type SlashMessage } from '#lib'; import { SimplifyNumber } from '@notenoughupdates/simplify-number'; -import assert from 'assert'; +import assert from 'assert/strict'; import canvas from 'canvas'; import { ApplicationCommandOptionType, AttachmentBuilder, Guild, PermissionFlagsBits, User } from 'discord.js'; import got from 'got'; diff --git a/src/commands/leveling/levelRoles.ts b/src/commands/leveling/levelRoles.ts index 470cf58..312623c 100644 --- a/src/commands/leveling/levelRoles.ts +++ b/src/commands/leveling/levelRoles.ts @@ -8,7 +8,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js'; export default class LevelRolesCommand extends BushCommand { diff --git a/src/commands/leveling/setLevel.ts b/src/commands/leveling/setLevel.ts index b1d9516..8dc1cdf 100644 --- a/src/commands/leveling/setLevel.ts +++ b/src/commands/leveling/setLevel.ts @@ -9,7 +9,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js'; export default class SetLevelCommand extends BushCommand { diff --git a/src/commands/leveling/setXp.ts b/src/commands/leveling/setXp.ts index 96b3ad7..5cd3a61 100644 --- a/src/commands/leveling/setXp.ts +++ b/src/commands/leveling/setXp.ts @@ -9,7 +9,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js'; export default class SetXpCommand extends BushCommand { diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index 1b045aa..00fde01 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -13,7 +13,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type User } from 'discord.js'; export default class BanCommand extends BushCommand { diff --git a/src/commands/moderation/block.ts b/src/commands/moderation/block.ts index 48436eb..00a1996 100644 --- a/src/commands/moderation/block.ts +++ b/src/commands/moderation/block.ts @@ -14,7 +14,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type GuildMember } from 'discord.js'; export default class BlockCommand extends BushCommand { diff --git a/src/commands/moderation/evidence.ts b/src/commands/moderation/evidence.ts index f480844..d36000f 100644 --- a/src/commands/moderation/evidence.ts +++ b/src/commands/moderation/evidence.ts @@ -11,7 +11,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { Argument, ArgumentGeneratorReturn } from 'discord-akairo'; import { ApplicationCommandOptionType, PermissionFlagsBits, type Message } from 'discord.js'; diff --git a/src/commands/moderation/hideCase.ts b/src/commands/moderation/hideCase.ts index 6724d3c..9bd1d24 100644 --- a/src/commands/moderation/hideCase.ts +++ b/src/commands/moderation/hideCase.ts @@ -8,7 +8,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js'; export default class HideCaseCommand extends BushCommand { diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index df14271..7807166 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -12,7 +12,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type GuildMember } from 'discord.js'; export default class KickCommand extends BushCommand { diff --git a/src/commands/moderation/lockdown.ts b/src/commands/moderation/lockdown.ts index 1224763..0561767 100644 --- a/src/commands/moderation/lockdown.ts +++ b/src/commands/moderation/lockdown.ts @@ -11,7 +11,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, Collection, diff --git a/src/commands/moderation/massBan.ts b/src/commands/moderation/massBan.ts index 0db5263..db50c44 100644 --- a/src/commands/moderation/massBan.ts +++ b/src/commands/moderation/massBan.ts @@ -13,7 +13,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, Collection, PermissionFlagsBits } from 'discord.js'; export default class MassBanCommand extends BushCommand { diff --git a/src/commands/moderation/massEvidence.ts b/src/commands/moderation/massEvidence.ts index 6547203..62f4825 100644 --- a/src/commands/moderation/massEvidence.ts +++ b/src/commands/moderation/massEvidence.ts @@ -11,7 +11,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js'; import { EvidenceCommand } from '../index.js'; diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts index 2bcc54d..4671f58 100644 --- a/src/commands/moderation/modlog.ts +++ b/src/commands/moderation/modlog.ts @@ -14,7 +14,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, escapeMarkdown, PermissionFlagsBits, User } from 'discord.js'; export default class ModlogCommand extends BushCommand { diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts index 5502a84..4627f2c 100644 --- a/src/commands/moderation/mute.ts +++ b/src/commands/moderation/mute.ts @@ -14,7 +14,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type GuildMember } from 'discord.js'; export default class MuteCommand extends BushCommand { diff --git a/src/commands/moderation/purge.ts b/src/commands/moderation/purge.ts index ed5d49d..383c439 100644 --- a/src/commands/moderation/purge.ts +++ b/src/commands/moderation/purge.ts @@ -8,7 +8,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, Collection, PermissionFlagsBits, type Message } from 'discord.js'; export default class PurgeCommand extends BushCommand { diff --git a/src/commands/moderation/removeReactionEmoji.ts b/src/commands/moderation/removeReactionEmoji.ts index a088287..cc3713c 100644 --- a/src/commands/moderation/removeReactionEmoji.ts +++ b/src/commands/moderation/removeReactionEmoji.ts @@ -8,7 +8,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, Message, PermissionFlagsBits } from 'discord.js'; export default class RemoveReactionEmojiCommand extends BushCommand { diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts index 6febaa6..5251be7 100644 --- a/src/commands/moderation/role.ts +++ b/src/commands/moderation/role.ts @@ -13,7 +13,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { type ArgumentGeneratorReturn } from 'discord-akairo'; import { ApplicationCommandOptionType, PermissionFlagsBits, type Snowflake } from 'discord.js'; diff --git a/src/commands/moderation/slowmode.ts b/src/commands/moderation/slowmode.ts index 641f88e..44ed84f 100644 --- a/src/commands/moderation/slowmode.ts +++ b/src/commands/moderation/slowmode.ts @@ -10,7 +10,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { Argument } from 'discord-akairo'; import { ApplicationCommandOptionType, ChannelType, PermissionFlagsBits } from 'discord.js'; diff --git a/src/commands/moderation/timeout.ts b/src/commands/moderation/timeout.ts index 1ceedf9..3e2b10d 100644 --- a/src/commands/moderation/timeout.ts +++ b/src/commands/moderation/timeout.ts @@ -12,7 +12,7 @@ import { type SlashMessage, type TimeoutResponse } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type GuildMember } from 'discord.js'; export default class TimeoutCommand extends BushCommand { diff --git a/src/commands/moderation/unban.ts b/src/commands/moderation/unban.ts index c102434..3a6221a 100644 --- a/src/commands/moderation/unban.ts +++ b/src/commands/moderation/unban.ts @@ -11,7 +11,7 @@ import { type SlashMessage, type UnbanResponse } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type User } from 'discord.js'; export default class UnbanCommand extends BushCommand { diff --git a/src/commands/moderation/unblock.ts b/src/commands/moderation/unblock.ts index f8a57f8..6533da0 100644 --- a/src/commands/moderation/unblock.ts +++ b/src/commands/moderation/unblock.ts @@ -13,7 +13,7 @@ import { type SlashMessage, type UnblockResponse } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type GuildMember } from 'discord.js'; export default class UnblockCommand extends BushCommand { diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts index 31944fc..648a178 100644 --- a/src/commands/moderation/unmute.ts +++ b/src/commands/moderation/unmute.ts @@ -12,7 +12,7 @@ import { type SlashMessage, type UnmuteResponse } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type GuildMember } from 'discord.js'; import { BushCommand } from '../../lib/extensions/discord-akairo/BushCommand.js'; diff --git a/src/commands/moderation/untimeout.ts b/src/commands/moderation/untimeout.ts index aa6665d..6ca28f4 100644 --- a/src/commands/moderation/untimeout.ts +++ b/src/commands/moderation/untimeout.ts @@ -12,7 +12,7 @@ import { type RemoveTimeoutResponse, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type GuildMember } from 'discord.js'; export default class UntimeoutCommand extends BushCommand { diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts index 442cddc..e1d1e90 100644 --- a/src/commands/moderation/warn.ts +++ b/src/commands/moderation/warn.ts @@ -14,7 +14,7 @@ import { type SlashMessage, type WarnResponse } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type GuildMember } from 'discord.js'; export default class WarnCommand extends BushCommand { diff --git a/src/commands/moulberry-bush/capes.ts b/src/commands/moulberry-bush/capes.ts index 1db2f72..8693dba 100644 --- a/src/commands/moulberry-bush/capes.ts +++ b/src/commands/moulberry-bush/capes.ts @@ -12,7 +12,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type APIEmbed, type AutocompleteInteraction } from 'discord.js'; import Fuse from 'fuse.js'; import got from 'got'; diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts index 6803c0c..8f8941f 100644 --- a/src/commands/moulberry-bush/giveawayPing.ts +++ b/src/commands/moulberry-bush/giveawayPing.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, clientSendAndPermCheck, emojis, mappings, type CommandMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { PermissionFlagsBits } from 'discord.js'; export default class GiveawayPingCommand extends BushCommand { diff --git a/src/commands/moulberry-bush/moulHammer.ts b/src/commands/moulberry-bush/moulHammer.ts index 277f051..7bb514e 100644 --- a/src/commands/moulberry-bush/moulHammer.ts +++ b/src/commands/moulberry-bush/moulHammer.ts @@ -7,7 +7,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js'; export default class MoulHammerCommand extends BushCommand { diff --git a/src/commands/moulberry-bush/report.ts b/src/commands/moulberry-bush/report.ts index 6d1203c..d0c4f33 100644 --- a/src/commands/moulberry-bush/report.ts +++ b/src/commands/moulberry-bush/report.ts @@ -10,7 +10,7 @@ import { type CommandMessage } from '#lib'; import { stripIndent } from '#tags'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js'; export default class ReportCommand extends BushCommand { diff --git a/src/commands/moulberry-bush/serverStatus.ts b/src/commands/moulberry-bush/serverStatus.ts index a4d5e45..1237b3f 100644 --- a/src/commands/moulberry-bush/serverStatus.ts +++ b/src/commands/moulberry-bush/serverStatus.ts @@ -1,5 +1,5 @@ import { BushCommand, clientSendAndPermCheck, colors, emojis, type CommandMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { EmbedBuilder, PermissionFlagsBits } from 'discord.js'; import got from 'got'; diff --git a/src/commands/moulberry-bush/solved.ts b/src/commands/moulberry-bush/solved.ts index 836d575..8e123c4 100644 --- a/src/commands/moulberry-bush/solved.ts +++ b/src/commands/moulberry-bush/solved.ts @@ -1,5 +1,5 @@ import { BushCommand, clientSendAndPermCheck, emojis, mappings, type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; export default class Solved extends BushCommand { public constructor() { diff --git a/src/commands/utilities/calculator.ts b/src/commands/utilities/calculator.ts index f0db916..c9dbbf2 100644 --- a/src/commands/utilities/calculator.ts +++ b/src/commands/utilities/calculator.ts @@ -7,7 +7,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js'; import { evaluate } from 'mathjs'; diff --git a/src/commands/utilities/hash.ts b/src/commands/utilities/hash.ts index 6e8c37f..6817f04 100644 --- a/src/commands/utilities/hash.ts +++ b/src/commands/utilities/hash.ts @@ -1,5 +1,5 @@ import { BushCommand, clientSendAndPermCheck, type CommandMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import crypto from 'crypto'; import { ApplicationCommandOptionType } from 'discord.js'; import got from 'got'; diff --git a/src/commands/utilities/highlight-add.ts b/src/commands/utilities/highlight-add.ts index facee2c..e7d3ec6 100644 --- a/src/commands/utilities/highlight-add.ts +++ b/src/commands/utilities/highlight-add.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, emojis, format, type ArgType, type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { highlightSubcommands } from './highlight-!.js'; export default class HighlightAddCommand extends BushCommand { diff --git a/src/commands/utilities/highlight-block.ts b/src/commands/utilities/highlight-block.ts index 9ee8a5a..7843836 100644 --- a/src/commands/utilities/highlight-block.ts +++ b/src/commands/utilities/highlight-block.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, emojis, type ArgType, type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { Argument, ArgumentGeneratorReturn } from 'discord-akairo'; import { Channel, GuildMember, User } from 'discord.js'; import { BlockResult } from '../../lib/common/HighlightManager.js'; diff --git a/src/commands/utilities/highlight-clear.ts b/src/commands/utilities/highlight-clear.ts index a5ff19e..5451e4e 100644 --- a/src/commands/utilities/highlight-clear.ts +++ b/src/commands/utilities/highlight-clear.ts @@ -1,5 +1,5 @@ import { BushCommand, ConfirmationPrompt, emojis, type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { highlightSubcommands } from './highlight-!.js'; export default class HighlightClearCommand extends BushCommand { diff --git a/src/commands/utilities/highlight-matches.ts b/src/commands/utilities/highlight-matches.ts index 8964af8..863445e 100644 --- a/src/commands/utilities/highlight-matches.ts +++ b/src/commands/utilities/highlight-matches.ts @@ -1,5 +1,5 @@ import { BushCommand, ButtonPaginator, chunk, colors, emojis, type ArgType, type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { type ArgumentGeneratorReturn } from 'discord-akairo'; import { type APIEmbed } from 'discord.js'; import { highlightSubcommands } from './highlight-!.js'; diff --git a/src/commands/utilities/highlight-remove.ts b/src/commands/utilities/highlight-remove.ts index 67cf029..fd2fa90 100644 --- a/src/commands/utilities/highlight-remove.ts +++ b/src/commands/utilities/highlight-remove.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, emojis, type ArgType, type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { highlightSubcommands } from './highlight-!.js'; export default class HighlightRemoveCommand extends BushCommand { diff --git a/src/commands/utilities/highlight-show.ts b/src/commands/utilities/highlight-show.ts index 301d719..bed8f19 100644 --- a/src/commands/utilities/highlight-show.ts +++ b/src/commands/utilities/highlight-show.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, colors, emojis, Highlight, type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { EmbedBuilder } from 'discord.js'; import { highlightSubcommands } from './highlight-!.js'; diff --git a/src/commands/utilities/highlight-unblock.ts b/src/commands/utilities/highlight-unblock.ts index d70fb28..d731205 100644 --- a/src/commands/utilities/highlight-unblock.ts +++ b/src/commands/utilities/highlight-unblock.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, emojis, type ArgType, type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { Argument, ArgumentGeneratorReturn } from 'discord-akairo'; import { Channel, GuildMember, User } from 'discord.js'; import { UnblockResult } from '../../lib/common/HighlightManager.js'; diff --git a/src/commands/utilities/price.ts b/src/commands/utilities/price.ts index 3973844..8a3b5c6 100644 --- a/src/commands/utilities/price.ts +++ b/src/commands/utilities/price.ts @@ -1,5 +1,5 @@ import { ArgType, BushCommand, clientSendAndPermCheck, colors, emojis, format, oxford, type CommandMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, AutocompleteInteraction, EmbedBuilder, PermissionFlagsBits } from 'discord.js'; import Fuse from 'fuse.js'; import got from 'got'; diff --git a/src/commands/utilities/reminders.ts b/src/commands/utilities/reminders.ts index 18243fe..fdce981 100644 --- a/src/commands/utilities/reminders.ts +++ b/src/commands/utilities/reminders.ts @@ -10,7 +10,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { PermissionFlagsBits, type APIEmbed } from 'discord.js'; import { Op } from 'sequelize'; diff --git a/src/commands/utilities/steal.ts b/src/commands/utilities/steal.ts index 3741d27..b07338f 100644 --- a/src/commands/utilities/steal.ts +++ b/src/commands/utilities/steal.ts @@ -9,7 +9,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { type ArgumentGeneratorReturn, type ArgumentType, type ArgumentTypeCaster } from 'discord-akairo'; import { ApplicationCommandOptionType, Attachment, PermissionFlagsBits } from 'discord.js'; import _ from 'lodash'; diff --git a/src/commands/utilities/viewRaw.ts b/src/commands/utilities/viewRaw.ts index d2aef0d..a7d8b25 100644 --- a/src/commands/utilities/viewRaw.ts +++ b/src/commands/utilities/viewRaw.ts @@ -10,7 +10,7 @@ import { type OptArgType, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, Constants, EmbedBuilder, Message, PermissionFlagsBits } from 'discord.js'; export default class ViewRawCommand extends BushCommand { diff --git a/src/commands/utilities/whoHasRole.ts b/src/commands/utilities/whoHasRole.ts index 851411a..789701c 100644 --- a/src/commands/utilities/whoHasRole.ts +++ b/src/commands/utilities/whoHasRole.ts @@ -10,7 +10,7 @@ import { type CommandMessage, type SlashMessage } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, escapeMarkdown, type CommandInteraction, type Role } from 'discord.js'; export default class WhoHasRoleCommand extends BushCommand { diff --git a/src/commands/utilities/wolframAlpha.ts b/src/commands/utilities/wolframAlpha.ts index bac9f58..b35e14f 100644 --- a/src/commands/utilities/wolframAlpha.ts +++ b/src/commands/utilities/wolframAlpha.ts @@ -9,7 +9,7 @@ import { type SlashMessage } from '#lib'; import { initializeClass as WolframAlphaAPI } from '@notenoughupdates/wolfram-alpha-api'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ApplicationCommandOptionType, EmbedBuilder, type MessageOptions } from 'discord.js'; assert(WolframAlphaAPI); diff --git a/src/lib/common/AutoMod.ts b/src/lib/common/AutoMod.ts index 21bcb00..093f8af 100644 --- a/src/lib/common/AutoMod.ts +++ b/src/lib/common/AutoMod.ts @@ -1,5 +1,5 @@ import { colors, emojis, format, formatError, Moderation, unmuteResponse } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import chalk from 'chalk'; import { ActionRowBuilder, diff --git a/src/lib/common/HighlightManager.ts b/src/lib/common/HighlightManager.ts index 4346007..8784b35 100644 --- a/src/lib/common/HighlightManager.ts +++ b/src/lib/common/HighlightManager.ts @@ -1,5 +1,5 @@ import { addToArray, format, Highlight, removeFromArray, timestamp, type HighlightWord } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { Collection, GuildMember, diff --git a/src/lib/common/util/Moderation.ts b/src/lib/common/util/Moderation.ts index fc01602..60e32c0 100644 --- a/src/lib/common/util/Moderation.ts +++ b/src/lib/common/util/Moderation.ts @@ -12,7 +12,7 @@ import { type ModLogType, type ValueOf } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ActionRowBuilder, ButtonBuilder, diff --git a/src/lib/extensions/discord.js/ExtendedGuild.ts b/src/lib/extensions/discord.js/ExtendedGuild.ts index 56bc1f8..88bf5f1 100644 --- a/src/lib/extensions/discord.js/ExtendedGuild.ts +++ b/src/lib/extensions/discord.js/ExtendedGuild.ts @@ -11,7 +11,7 @@ import { type GuildLogType, type GuildModel } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { AttachmentBuilder, AttachmentPayload, diff --git a/src/lib/utils/BushClientUtils.ts b/src/lib/utils/BushClientUtils.ts index af49803..920ff40 100644 --- a/src/lib/utils/BushClientUtils.ts +++ b/src/lib/utils/BushClientUtils.ts @@ -1,4 +1,4 @@ -import assert from 'assert'; +import assert from 'assert/strict'; import { cleanCodeBlockContent, DMChannel, diff --git a/src/lib/utils/BushUtils.ts b/src/lib/utils/BushUtils.ts index 19260c8..af173f9 100644 --- a/src/lib/utils/BushUtils.ts +++ b/src/lib/utils/BushUtils.ts @@ -10,7 +10,7 @@ import { type SlashMessage } from '#lib'; import { humanizeDuration as humanizeDurationMod } from '@notenoughupdates/humanize-duration'; -import assert from 'assert'; +import assert from 'assert/strict'; import cp from 'child_process'; import deepLock from 'deep-lock'; import { Util as AkairoUtil } from 'discord-akairo'; diff --git a/src/listeners/bush/appealListener.ts b/src/listeners/bush/appealListener.ts index bbcb9d8..cbe62a8 100644 --- a/src/listeners/bush/appealListener.ts +++ b/src/listeners/bush/appealListener.ts @@ -1,5 +1,5 @@ import { BushListener, colors, mappings, ModLog, type BushClientEvents } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { EmbedBuilder } from 'discord.js'; import UserInfoCommand from '../../commands/info/userInfo.js'; import ModlogCommand from '../../commands/moderation/modlog.js'; diff --git a/src/listeners/bush/supportThread.ts b/src/listeners/bush/supportThread.ts index 32eae02..5145ff2 100644 --- a/src/listeners/bush/supportThread.ts +++ b/src/listeners/bush/supportThread.ts @@ -1,6 +1,6 @@ import { BushListener, colors, mappings, type BushClientEvents } from '#lib'; import { stripIndent } from '#tags'; -import assert from 'assert'; +import assert from 'assert/strict'; import { EmbedBuilder, MessageType, PermissionFlagsBits, TextChannel } from 'discord.js'; export default class SupportThreadListener extends BushListener { diff --git a/src/listeners/member-custom/bushLevelUpdate.ts b/src/listeners/member-custom/bushLevelUpdate.ts index a9c0820..0281288 100644 --- a/src/listeners/member-custom/bushLevelUpdate.ts +++ b/src/listeners/member-custom/bushLevelUpdate.ts @@ -1,5 +1,5 @@ import { BushListener, format, type BushClientEvents } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { type TextChannel } from 'discord.js'; type Args = BushClientEvents['bushLevelUpdate']; diff --git a/src/listeners/ws/INTERACTION_CREATE.ts b/src/listeners/ws/INTERACTION_CREATE.ts index 20c2b3e..67fe56b 100644 --- a/src/listeners/ws/INTERACTION_CREATE.ts +++ b/src/listeners/ws/INTERACTION_CREATE.ts @@ -1,5 +1,5 @@ import { BushListener, capitalize, colors, emojis, Moderation, PunishmentTypePresent } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; import { ActionRowBuilder, ButtonBuilder, diff --git a/src/tasks/feature/memberCount.ts b/src/tasks/feature/memberCount.ts index ea422fa..9c31c5b 100644 --- a/src/tasks/feature/memberCount.ts +++ b/src/tasks/feature/memberCount.ts @@ -1,5 +1,5 @@ import { BushTask, MemberCount, Time } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; export default class MemberCountTask extends BushTask { public constructor() { diff --git a/src/tasks/feature/removeExpiredPunishements.ts b/src/tasks/feature/removeExpiredPunishements.ts index 0b20a27..c21454b 100644 --- a/src/tasks/feature/removeExpiredPunishements.ts +++ b/src/tasks/feature/removeExpiredPunishements.ts @@ -1,5 +1,5 @@ import { ActivePunishment, ActivePunishmentType, BushTask, Time } from '#lib'; -import assert from 'assert'; +import assert from 'assert/strict'; const { Op } = (await import('sequelize')).default; export default class RemoveExpiredPunishmentsTask extends BushTask { -- cgit