1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 10:22:39 +01:00

Merge pull request #1209 from DEVTomatoCake/fix/emoji-creation

Fix uploading of emojis
This commit is contained in:
Madeline 2024-09-03 09:23:30 +10:00 committed by GitHub
commit 64c233b84c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,13 +123,13 @@ router.post(
if (body.require_colons == null) body.require_colons = true; if (body.require_colons == null) body.require_colons = true;
const user = await User.findOneOrFail({ where: { id: req.user_id } }); const user = await User.findOneOrFail({ where: { id: req.user_id } });
body.image = (await handleFile(`/emojis/${id}`, body.image)) as string; await handleFile(`/emojis/${id}`, body.image);
const mimeType = body.image.split(":")[1].split(";")[0]; const mimeType = body.image.split(":")[1].split(";")[0];
const emoji = await Emoji.create({ const emoji = await Emoji.create({
id: id, id: id,
guild_id: guild_id, guild_id: guild_id,
...body, name: body.name,
require_colons: body.require_colons ?? undefined, // schema allows nulls, db does not require_colons: body.require_colons ?? undefined, // schema allows nulls, db does not
user: user, user: user,
managed: false, managed: false,