Skip to content

Commit

Permalink
Modpack updates
Browse files Browse the repository at this point in the history
  • Loading branch information
XboxBedrock committed Jul 8, 2024
1 parent 6a15bc3 commit 4003cb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/commands/modpack.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion src/entities/ModpackImage.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type ModpackImageSet = Partial<Record<ModpackImageKey, ModpackImageData>>

@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
Expand Down Expand Up @@ -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}` },
Expand Down

0 comments on commit 4003cb7

Please sign in to comment.