This commit is contained in:
Ryan Cao 2022-09-16 22:00:08 +08:00
parent 2a35abdce0
commit 9829b2bf9b
No known key found for this signature in database

View file

@ -43,9 +43,6 @@ export const modrinthCommand = async (
}
const res = await fetch('https://api.modrinth.com/v2/project/' + id);
const data = (await res.json()) as
| ModrinthProject
| { error: string; description: string };
if (!res.ok) {
await i.editReply({
@ -60,6 +57,10 @@ export const modrinthCommand = async (
return;
}
const data = (await res.json()) as
| ModrinthProject
| { error: string; description: string };
if ('error' in data) {
console.error(data);