summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-07 19:21:00 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-07 19:21:00 +0200
commit30e05fdb86df8393cefa299ac7ffa53d2af2b5a2 (patch)
treeadc1d81e11882924a0f401834e282b55a6c29cbd /src/util
parent:art: add handleFile() (diff)
downloadserver-30e05fdb86df8393cefa299ac7ffa53d2af2b5a2.tar.xz
:bug: fix handleFile()
Diffstat (limited to 'src/util')
-rw-r--r--src/util/cdn.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/cdn.ts b/src/util/cdn.ts

index fb0cfb53..b0d0f62a 100644 --- a/src/util/cdn.ts +++ b/src/util/cdn.ts
@@ -31,9 +31,10 @@ export async function handleFile(path: string, body?: string): Promise<string | const buffer = Buffer.from(body.split(",")[1], "base64"); // @ts-ignore - const { id } = await uploadFile(`/${path}/${guild_id}`, { buffer, mimetype, originalname: "banner" }); + const { id } = await uploadFile(path, { buffer, mimetype, originalname: "banner" }); return id; } catch (error) { - throw new HTTPError("Invalid " + path); + console.error(error); + throw new HTTPError("Invalid icon"); } }