mirror of
https://github.com/spacebarchat/server.git
synced 2024-09-19 17:21:35 +02:00
Support apng & webm
This commit is contained in:
parent
0096938d36
commit
2f679fda5d
@ -125,6 +125,7 @@ router.post(
|
||||
const user = await User.findOneOrFail({ where: { id: req.user_id } });
|
||||
body.image = (await handleFile(`/emojis/${id}`, body.image)) as string;
|
||||
|
||||
const mimeType = body.image.split(":")[1].split(";")[0];
|
||||
const emoji = await Emoji.create({
|
||||
id: id,
|
||||
guild_id: guild_id,
|
||||
@ -132,7 +133,10 @@ router.post(
|
||||
require_colons: body.require_colons ?? undefined, // schema allows nulls, db does not
|
||||
user: user,
|
||||
managed: false,
|
||||
animated: body.image.split(":")[1].split(";")[0] == "image/gif",
|
||||
animated:
|
||||
mimeType == "image/gif" ||
|
||||
mimeType == "image/apng" ||
|
||||
mimeType == "video/webm",
|
||||
available: true,
|
||||
roles: [],
|
||||
}).save();
|
||||
|
Loading…
Reference in New Issue
Block a user