aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moulberry-bush/capes.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-08-20 23:07:02 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-08-20 23:07:02 -0400
commitb81f9e8b73cb520ad5ae916c3e571ea55f4ca489 (patch)
tree25d7f42d66c3e3190022ece043c86082a9e85709 /src/commands/moulberry-bush/capes.ts
parentf2e5cfff7dc275bd93fac446a508b7d18ecd6c58 (diff)
downloadtanzanite-b81f9e8b73cb520ad5ae916c3e571ea55f4ca489.tar.gz
tanzanite-b81f9e8b73cb520ad5ae916c3e571ea55f4ca489.tar.bz2
tanzanite-b81f9e8b73cb520ad5ae916c3e571ea55f4ca489.zip
fix ts composite shit, replace got with native fetch, update deps
Diffstat (limited to 'src/commands/moulberry-bush/capes.ts')
-rw-r--r--src/commands/moulberry-bush/capes.ts10
1 files changed, 4 insertions, 6 deletions
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\/(?<name>\w+)_preview\.png/),