mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-29 20:29:26 +00:00
Forbid dashes in emoji names
This commit is contained in:
@@ -107,6 +107,7 @@ router.post(
|
||||
|
||||
if (emoji_count >= maxEmojis) throw DiscordApiErrors.MAXIMUM_NUMBER_OF_EMOJIS_REACHED.withParams(maxEmojis);
|
||||
if (body.require_colons == null) body.require_colons = true;
|
||||
if (body.name?.includes("-")) body.name = body.name?.replaceAll("-", ""); // Dashes are invalid apparently
|
||||
|
||||
const user = req.user;
|
||||
await handleFile(`/emojis/${id}`, body.image);
|
||||
@@ -155,6 +156,8 @@ router.patch(
|
||||
const { emoji_id, guild_id } = req.params;
|
||||
const body = req.body as EmojiModifySchema;
|
||||
|
||||
if (body.name?.includes("-")) body.name = body.name?.replaceAll("-", ""); // Dashes are invalid apparently
|
||||
|
||||
const emoji = await Emoji.create({
|
||||
...body,
|
||||
id: emoji_id,
|
||||
|
||||
Reference in New Issue
Block a user