feat(api): drop NSFW classification for emojis and stickers (#2462)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-04 22:55:58 +02:00
1 parent 1e6c332eae
commit 51cb750502
191 files changed
+18464 -19351

No files matched your search

-4
View File
@@ -116,7 +116,6 @@ export function mapGuildEmojiToResponse(emoji: GuildEmoji): z.infer<typeof Guild
id,
name: emoji.name,
animated: emoji.isAnimated,
nsfw: emoji.isNsfw,
};
}
@@ -128,7 +127,6 @@ export function mapGuildStickerToResponse(sticker: GuildSticker): z.infer<typeof
description: sticker.description ?? '',
tags: sticker.tags,
animated: sticker.animated,
nsfw: sticker.isNsfw,
};
}
@@ -180,7 +178,6 @@ function mapEmojiWithUser(
id,
name: emoji.name,
animated: emoji.isAnimated,
nsfw: emoji.isNsfw,
user: userPartial,
};
}
@@ -207,7 +204,6 @@ function mapStickerWithUser(
description: sticker.description ?? '',
tags: sticker.tags,
animated: sticker.animated,
nsfw: sticker.isNsfw,
user: userPartial,
};
}
@@ -109,12 +109,7 @@ export class EmojiService {
if (allEmojis.length >= maxEmojis) {
throw new MaxGuildEmojisError(maxEmojis);
}
const {
animated,
imageBuffer,
contentType,
nsfw: isNsfw,
} = await this.avatarService.processEmoji({
const {animated, imageBuffer, contentType} = await this.avatarService.processEmoji({
errorPath: 'image',
base64Image: image,
});
@@ -131,7 +126,6 @@ export class EmojiService {
name,
creator_id: user.id,
animated,
nsfw: isNsfw,
version: 1,
});
const updatedEmojis = [...allEmojis, emoji];
@@ -184,7 +178,6 @@ export class EmojiService {
name: sourceEmoji.name,
creator_id: user.id,
animated: sourceEmoji.isAnimated,
nsfw: sourceEmoji.hasNsfwClassification ? sourceEmoji.isNsfw : null,
version: 1,
});
const updatedEmojis = [...allEmojis, emoji];
@@ -247,12 +240,7 @@ export class EmojiService {
});
continue;
}
const {
animated,
imageBuffer,
contentType,
nsfw: isNsfw,
} = await this.avatarService.processEmoji({
const {animated, imageBuffer, contentType} = await this.avatarService.processEmoji({
errorPath: `emojis[${success.length + failed.length}].image`,
base64Image: emojiData.image,
});
@@ -268,7 +256,6 @@ export class EmojiService {
emoji_id: emojiId,
name: emojiData.name,
animated,
nsfw: isNsfw,
creator_id: user.id,
version: 1,
});
@@ -126,11 +126,7 @@ export class StickerService {
if (stickerCount >= maxStickers) {
throw new MaxGuildStickersStaticError(maxStickers);
}
const {
animated,
imageBuffer,
nsfw: isNsfw,
} = await this.avatarService.processSticker({
const {animated, imageBuffer} = await this.avatarService.processSticker({
errorPath: 'image',
base64Image: image,
});
@@ -142,7 +138,6 @@ export class StickerService {
name,
description: description ?? null,
animated,
nsfw: isNsfw,
tags,
creator_id: user.id,
version: 1,
@@ -198,7 +193,6 @@ export class StickerService {
name: sourceSticker.name,
description: sourceSticker.description,
animated: sourceSticker.animated,
nsfw: sourceSticker.hasNsfwClassification ? sourceSticker.isNsfw : null,
tags: sourceSticker.tags,
creator_id: user.id,
version: 1,
@@ -275,11 +269,7 @@ export class StickerService {
contentModerationService.scanText(stickerData.name, bulkStickerModCtx);
contentModerationService.scanText(stickerData.description, bulkStickerModCtx);
contentModerationService.scanText(stickerData.tags.join(' '), bulkStickerModCtx);
const {
animated,
imageBuffer,
nsfw: isNsfw,
} = await this.avatarService.processSticker({
const {animated, imageBuffer} = await this.avatarService.processSticker({
errorPath: `stickers[${success.length + failed.length}].image`,
base64Image: stickerData.image,
});
@@ -292,7 +282,6 @@ export class StickerService {
description: stickerData.description ?? null,
tags: stickerData.tags,
animated,
nsfw: isNsfw,
creator_id: user.id,
version: 1,
});