Skip to content

Commit f3f4a55

Browse files
Forbid dashes in emoji names
1 parent e52f4c3 commit f3f4a55

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/api/routes/guilds/#guild_id/emojis.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ router.post(
107107

108108
if (emoji_count >= maxEmojis) throw DiscordApiErrors.MAXIMUM_NUMBER_OF_EMOJIS_REACHED.withParams(maxEmojis);
109109
if (body.require_colons == null) body.require_colons = true;
110+
if (body.name?.includes("-")) body.name = body.name?.replaceAll("-", ""); // Dashes are invalid apparently
110111

111112
const user = req.user;
112113
await handleFile(`/emojis/${id}`, body.image);
@@ -155,6 +156,8 @@ router.patch(
155156
const { emoji_id, guild_id } = req.params;
156157
const body = req.body as EmojiModifySchema;
157158

159+
if (body.name?.includes("-")) body.name = body.name?.replaceAll("-", ""); // Dashes are invalid apparently
160+
158161
const emoji = await Emoji.create({
159162
...body,
160163
id: emoji_id,

0 commit comments

Comments
 (0)