fix(api): keep a deprecated nsfw field for older clients (#2463)

This commit is contained in:
Hampus
2026-09-04 23:08:34 +02:00
committed by GitHub
parent 51cb750502
commit 3f1f899b23
3 changed files with 30 additions and 6 deletions
+4
View File
@@ -116,6 +116,7 @@ export function mapGuildEmojiToResponse(emoji: GuildEmoji): z.infer<typeof Guild
id,
name: emoji.name,
animated: emoji.isAnimated,
nsfw: false,
};
}
@@ -127,6 +128,7 @@ export function mapGuildStickerToResponse(sticker: GuildSticker): z.infer<typeof
description: sticker.description ?? '',
tags: sticker.tags,
animated: sticker.animated,
nsfw: false,
};
}
@@ -178,6 +180,7 @@ function mapEmojiWithUser(
id,
name: emoji.name,
animated: emoji.isAnimated,
nsfw: false,
user: userPartial,
};
}
@@ -204,6 +207,7 @@ function mapStickerWithUser(
description: sticker.description ?? '',
tags: sticker.tags,
animated: sticker.animated,
nsfw: false,
user: userPartial,
};
}
+22 -6
View File
@@ -27925,9 +27925,13 @@
"description": "The unique identifier for this emoji"
},
"name": {"type": "string", "description": "The name of the emoji"},
"animated": {"type": "boolean", "description": "Whether this emoji is animated"}
"animated": {"type": "boolean", "description": "Whether this emoji is animated"},
"nsfw": {
"type": "boolean",
"description": "Deprecated; always false. Retained for compatibility with older clients"
}
},
"required": ["id", "name", "animated"]
"required": ["id", "name", "animated", "nsfw"]
},
"GuildStickerResponse": {
"type": "object",
@@ -27945,9 +27949,13 @@
"maxItems": 100,
"description": "Autocomplete/suggestion tags for the sticker"
},
"animated": {"type": "boolean", "description": "Whether this sticker is animated"}
"animated": {"type": "boolean", "description": "Whether this sticker is animated"},
"nsfw": {
"type": "boolean",
"description": "Deprecated; always false. Retained for compatibility with older clients"
}
},
"required": ["id", "name", "description", "tags", "animated"]
"required": ["id", "name", "description", "tags", "animated", "nsfw"]
},
"GuildCreateRequest": {
"type": "object",
@@ -28931,9 +28939,13 @@
},
"name": {"type": "string", "description": "The name of the emoji"},
"animated": {"type": "boolean", "description": "Whether this emoji is animated"},
"nsfw": {
"type": "boolean",
"description": "Deprecated; always false. Retained for compatibility with older clients"
},
"user": {"$ref": "#/components/schemas/UserPartialResponse"}
},
"required": ["id", "name", "animated", "user"]
"required": ["id", "name", "animated", "nsfw", "user"]
},
"GuildEmojiBulkCreateResponse": {
"type": "object",
@@ -29430,9 +29442,13 @@
"description": "Autocomplete/suggestion tags for the sticker"
},
"animated": {"type": "boolean", "description": "Whether this sticker is animated"},
"nsfw": {
"type": "boolean",
"description": "Deprecated; always false. Retained for compatibility with older clients"
},
"user": {"$ref": "#/components/schemas/UserPartialResponse"}
},
"required": ["id", "name", "description", "tags", "animated", "user"]
"required": ["id", "name", "description", "tags", "animated", "nsfw", "user"]
},
"GuildStickerBulkCreateResponse": {
"type": "object",
@@ -8,6 +8,7 @@ export const GuildEmojiResponse = z.object({
id: SnowflakeStringType.describe('The unique identifier for this emoji'),
name: z.string().describe('The name of the emoji'),
animated: z.boolean().describe('Whether this emoji is animated'),
nsfw: z.boolean().describe('Deprecated; always false. Retained for compatibility with older clients'),
});
export type GuildEmojiResponse = z.infer<typeof GuildEmojiResponse>;
@@ -16,6 +17,7 @@ export const GuildEmojiWithUserResponse = z.object({
id: SnowflakeStringType.describe('The unique identifier for this emoji'),
name: z.string().describe('The name of the emoji'),
animated: z.boolean().describe('Whether this emoji is animated'),
nsfw: z.boolean().describe('Deprecated; always false. Retained for compatibility with older clients'),
user: z.lazy(() => UserPartialResponse).describe('The user who uploaded this emoji'),
});
@@ -27,6 +29,7 @@ export const GuildStickerResponse = z.object({
description: z.string().describe('The description of the sticker'),
tags: z.array(z.string()).max(100).describe('Autocomplete/suggestion tags for the sticker'),
animated: z.boolean().describe('Whether this sticker is animated'),
nsfw: z.boolean().describe('Deprecated; always false. Retained for compatibility with older clients'),
});
export type GuildStickerResponse = z.infer<typeof GuildStickerResponse>;
@@ -37,6 +40,7 @@ export const GuildStickerWithUserResponse = z.object({
description: z.string().describe('The description of the sticker'),
tags: z.array(z.string()).max(100).describe('Autocomplete/suggestion tags for the sticker'),
animated: z.boolean().describe('Whether this sticker is animated'),
nsfw: z.boolean().describe('Deprecated; always false. Retained for compatibility with older clients'),
user: z.lazy(() => UserPartialResponse).describe('The user who uploaded this sticker'),
});