diff --git a/src/commands/modpack.command.ts b/src/commands/modpack.command.ts index 845e99f3..8605518e 100644 --- a/src/commands/modpack.command.ts +++ b/src/commands/modpack.command.ts @@ -4,7 +4,6 @@ import Command from "../struct/Command.js" import ModpackImage, { ModpackImageKey } from "../entities/ModpackImage.entity.js" import CommandMessage from "../struct/CommandMessage.js" -import JSON5 from "json5" import fetch from "node-fetch" import sizeOf from "buffer-image-size" import { hexToNum, isURL } from "@buildtheearth/bot-utils" @@ -161,7 +160,7 @@ export default new Command({ await message.continue() const { body } = await ModpackImage.fetch() - const code = `\`\`\`${JSON5.stringify(body, null, 2)}\`\`\`` + const code = `\`\`\`${JSON.stringify(body, null, 2)}\`\`\`` await message.sendSuccessMessage("updatedJsonData", code) } else if (subcommand === "push") { await message.continue() diff --git a/src/entities/ModpackImage.entity.ts b/src/entities/ModpackImage.entity.ts index 766b5046..1ad2ffa3 100644 --- a/src/entities/ModpackImage.entity.ts +++ b/src/entities/ModpackImage.entity.ts @@ -9,7 +9,7 @@ export type ModpackImageSet = Partial> @typeorm.Entity({ name: "modpack_images" }) export default class ModpackImage extends typeorm.BaseEntity { - static readonly API_URL = "https://buildtheearth.net/api/modpack/images" + static readonly API_URL = "https://api.buildtheearth.net/api/v1/jsonstore/modpack" @typeorm.PrimaryGeneratedColumn() id!: number @@ -76,6 +76,8 @@ export default class ModpackImage extends typeorm.BaseEntity { } } + console.log(JSON.stringify(object)) + const response: Response = await fetch(this.API_URL, { method: "POST", headers: { Authorization: `Bearer ${token}` },