From b81f9e8b73cb520ad5ae916c3e571ea55f4ca489 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 20 Aug 2022 23:07:02 -0400 Subject: fix ts composite shit, replace got with native fetch, update deps --- src/commands/moulberry-bush/capes.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/commands/moulberry-bush/capes.ts') diff --git a/src/commands/moulberry-bush/capes.ts b/src/commands/moulberry-bush/capes.ts index 8693dba..6ffc540 100644 --- a/src/commands/moulberry-bush/capes.ts +++ b/src/commands/moulberry-bush/capes.ts @@ -14,11 +14,9 @@ import { } from '#lib'; import assert from 'assert/strict'; import { ApplicationCommandOptionType, PermissionFlagsBits, type APIEmbed, type AutocompleteInteraction } from 'discord.js'; -import Fuse from 'fuse.js'; -import got from 'got'; +import { default as Fuse } from 'fuse.js'; assert(Fuse); -assert(got); export default class CapesCommand extends BushCommand { public constructor() { @@ -47,9 +45,9 @@ export default class CapesCommand extends BushCommand { } public override async exec(message: CommandMessage | SlashMessage, args: { cape: OptArgType<'string'> }) { - const { tree: neuFileTree }: GithubTreeApi = await got - .get('https://api.github.com/repos/NotEnoughUpdates/NotEnoughUpdates/git/trees/master?recursive=1') - .json(); + const { tree: neuFileTree }: GithubTreeApi = await fetch( + 'https://api.github.com/repos/NotEnoughUpdates/NotEnoughUpdates/git/trees/master?recursive=1' + ).then((p) => (p.ok ? p.json() : { tree: [] })); const rawCapes = neuFileTree .map((f) => ({ match: f.path.match(/src\/main\/resources\/assets\/notenoughupdates\/capes\/(?\w+)_preview\.png/), -- cgit